Why can't I join the room through room id? (SOLVED)
Why can't I join the room through room id?
Hi @samael65535, you should be able to do that. Can you provide more details like your room handler (
requestJoinmethod) and the colyseus versions you're using?
One more question, When I use the client in Electron, the message is not correct
var message = msgpack.decode(new Uint8Array(event.data));
This is really weird indeed. It looks like an issue with
notepack.iodecoder. I've just created an issue in their repository: https://github.com/darrachequesne/notepack/issues/17
I'll try to debug that in the meantime.
I finally understood why this is happening, still don't know how to fix it though.
notepack.iohas a browser-specific version for browsers specified on its
package.json(see), it decodes the messages properly in the browser environment.
- When running inside Electron, it will load the Node.js version, not the browser one
colyseus.jsclient converts the incoming data to array via
new Uint8Array(event.data), which can't be properly decoded in the Node.js version of the decoder.
Maybe you can fix this temporarily by replacing the
node_modules/notepack.iowith the ones located on
browser/*. Of course this is not a definitive solution.
OK, I'll try
Thanks a lot for reporting and providing your example!