GitHub Documentation Patreon donate button

Haxe externs for server?



  • Hey Serjek,

    Thank you for your detailed steps.
    These steps work perfectly together when both client and server are made with haXe.

    I'm a bit confused why the externs would not work with, for instance the html demo from colyseus-examples static/02-state-handler.html ...

    I need to experiment with pure haXe client to see if that can communicate with the haxe externs.

    Thanks for your work. It is appreciated!



  • @mdotedot oh I understand your concern. I should've added more details on how to run official examples with server build with haxe. So, in order to run those examples you will need to checkout colyseus examples in your projects folder and bundle colyseus client lib:

    git clone https://github.com/colyseus/colyseus-examples.git
    cd colyseus-examples
    npm install
    npm run bundle-colyseus-client
    

    Now things are going to be bit complicated since you will need to configure and run your http server to serve client static bundle.

    There are multiple options how you can do this, I would recommend nginx server as you can install and run this server as local host, and it's easy to configure as well! Once you start serving those examples you can run the server and verify that clients and server are actually talking. Just make sure that port is the same for client and server and you're good. Let me know if I can help with anything.

    Oh and I didn't verify how official haxe client works with latest official server as this is bit out of scope of my current task ;) This is why I created externs for js client as well, because this makes sure that client and server are up to date and compliment each other.



  • @mdotedot now to think of it. Perhaps static/02-state-handler.html does not work for you because you don't use haxe rc2 to compile server. Thing is that haxe prior to rc2 will still compile the js server code but it will be ES5 javascript. Code generated in this way does not work with states for example; perhaps I need to add some compilation error for this case.

    So you need to be sure that js got generated with ES6 features with classes and all that. Check generated index.js - it should contain classes, something like this: class server_rooms_StateHandlerRoom extends colyseus_server_Room


 

GitHub Documentation Patreon donate button

© 2019 Endel Dreyer