Thank you for your fast and positive response, @endel. I suggest the following additional changes to make the documentation fully consistent within in itself:
send(type, message)
I think this should be:
send(identifier, message)
Send message a type of message to the client.
I think this should be:
Send message with identifier and payload message to the client.
The type can be either a string or a number.
I think this should be:
The identifier can be either a string or a number.
// sending message with string type
I think this should be:
// sending message with string identifier
Because it should be consistent with:
// sending message with number identifier
The green "Tip - See how to handle these messages on client-side." was removed. I'm not sure whether this was intentional. I think it should come back.
I found the algorithm explained at
https://docs.colyseus.io/server/api/
. The filter may return multiple rooms, and when that happens, the server sorts the rooms using sortBy settings and selects which one to join.
Hi @tsum,
Some people on Discord have reported issues because they're including the master JavaScript client from GitHack (https://raw.githack.com/colyseus/colyseus.js/master/dist/colyseus.js)
This link points now to the version 0.13.0. If you're using version 0.12.x, you should include that version of the client instead:
https://raw.githack.com/colyseus/colyseus.js/0.12.0/dist/colyseus.js
Hope this helps.
@endel very cool! I see how that’s handled now.
Also very handy to know about the filtering features :). It seems could be really useful in implementing some sort of ranked matchmaking service.
Hi @garimabhasin ,I think maybe there is any mistake in your code, you post message is too little information. Did you used the sample project before? You can try.
Also, if you’re creating separate files to keep your code lean, I created a class with a static variable pointing to the room. In the onCreate event of Room, I assign the static room property. Then I can import that class from any file and use the room methods.
Hi @JimboAction, not yet. It would be great to have it eventually.
We already have a C++11 client written for Cocos2d-x: https://github.com/colyseus/colyseus-cocos2d-x
Godot recently released their new WebSocket implementation: https://godotengine.org/article/websocket-updates-udp-multicast
AFAIK Godot still uses C++03 in their engine, but C++11/17 is supported if using GDNative: https://docs.godotengine.org/en/3.1/tutorials/plugins/gdnative/gdnative-cpp-example.html
@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