colyseus / colyseus-examples

Examples for learning how Colyseus works
https://examples.colyseus.dev/
MIT License
178 stars 90 forks source link

Listening to `client.send("hello", "world");` msg. #28

Closed atharvashukla closed 4 years ago

atharvashukla commented 4 years ago

Before: client.send("hello", "world"); was sent from onJoin (in 02-state-handler.ts) but that resulted in the following warning on the console: onMessage not registered for type 'hello'.

Now: We listen to the 'hello' type and print the message onto the console. No warning, and we see a message when someone joins.

endel commented 4 years ago

Thanks @atharvashukla 👍 👍