colyseus.js
colyseus.js copied to clipboard
Cannot broadcast empty typed messages
It seems like empty typed messages are not supported. I tried doing this:
class ExampleMessage extends Schema {}
And then in the room:
this.broadcast(new ExampleMessage())
This fails with this error:
Starting at colyseus >= 0.13 You must provide a type and message when calling `this.broadcast()` or `client.send()`. Please see: https://docs.colyseus.io/migrating/0.13/
Error: an instance of Schema was expected, but {} has been provided.
If I just add a dummy field on the message class it works fine.