-
I updated my colyseus package in order to take advantage of the new view features, however after updating it callbacks like .onAdd and .onRemove are no longer working on the client side. I checked and I am recieving the state data from the server. Here are my current colyseus core dependecies [email protected] C:\Users\andre\Desktop\server Here is my client side colyseus package and here is the offending code. The error that I get from the debugger now is that "room.state.players.onAdd is not a function" is javascript just no longer supported? I'm not sure what happened. I would prefer to not have to refactor my entire client side code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @AndadH, nice to see you're upgrading to latest version! The syntax for schema callbacks had to change in order to decouple the encoding/decoding internally. (Now you don't get See docs here: https://docs.colyseus.io/state/callbacks Let me know if you have any issues during the migration! 🙏 |
Beta Was this translation helpful? Give feedback.
Hi @AndadH, nice to see you're upgrading to latest version! The syntax for schema callbacks had to change in order to decouple the encoding/decoding internally. (Now you don't get
.onAdd()
auto-completions on the server, which were never supported, for example.)See docs here: https://docs.colyseus.io/state/callbacks
Let me know if you have any issues during the migration! 🙏