Code Monkey home page Code Monkey logo

Comments (5)

britzl avatar britzl commented on July 19, 2024

In the case of HTML5 all TCP connections will be upgraded to websocket connections by Emscripten and the handshake and everything else will be dealt with by the browser. The basic TCP Server in DefNet does however not handle any of this.

I would recommend that you also take a look at defold-websocket as this provides websocket communication on all platforms, with protocol negotiation done in Lua for non-HTML5 targets.

from defnet.

britzl avatar britzl commented on July 19, 2024

Oh, and there's Colyseus for Defold which provides both server and client logic for multiplayer games using websockets.

from defnet.

SupremeTechnopriest avatar SupremeTechnopriest commented on July 19, 2024

Thanks for the reply! So I am aware of colyseus, but what I really like about defold is that you can build headless. Id like to be able to create my game logic inside defold. With colyseus you have to implement your own physics, collision... all of it. Defold just becomes a glorified renderer. I want to use an actual defold instance as the server so I can utilize all of defolds features.

It seems that the websocket implementation does not include a websocket server for defold, so in using it I would be forced to implement all the features I want from defold in node.

Do you have any thoughts on this? Is there a better way to make a hybrid server/client in defold? Construct does this really nicely, but unfortunately it uses WebRTC and cant support that many concurrent players. Thanks again!

from defnet.

SupremeTechnopriest avatar SupremeTechnopriest commented on July 19, 2024

I think all we need to do here is add the handshake negotiation logic to the tcp_server. I'm a fairly advanced programmer, but this is my first foray into lua. I think the problem might have already been solved here. This project is no longer maintained, but we could port in the handshake logic. If you don't have the bandwidth to take this on, I'm willing to take a crack at it. Its probably an hour job for you and a 4 hour job for me. LMK

from defnet.

SupremeTechnopriest avatar SupremeTechnopriest commented on July 19, 2024

No worries mate, ended up switching engines. Somethings to thing about perhaps. Ping this issue if you decide to implement this. I'd be interested in revisiting defold.

from defnet.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.