Colyseus handles state synchronization automatically through its strongly-typed
How does it work?¶
- When the user successfully joins the room, they receive the full state from the server.
- At every patchRate, binary patches of the state are sent to every client (
- schema callbacks are triggered on client-side when applying patches coming from the server.
onStateChangeis triggered after all latest patches have been applied in the client.
- Your server-side logic may mutate the room state at any moment. Connected clients are always ensured to be in sync with the server.