colyseus / colyseus-unity-sdk

⚔ Colyseus Multiplayer SDK for Unity
https://docs.colyseus.io/getting-started/unity-sdk/
MIT License
378 stars 104 forks source link

`room.OnstateChange` sometimes isn't called with the initial state in `v0.11` #85

Closed rnd256 closed 4 years ago

rnd256 commented 5 years ago

room.OnstateChange sometimes isn't called with the initial state in v0.11. I can reproduce this about 10% of the time in the Unity client. Subsequent state updates do correctly result in calls to room.OnstateChange.

I have a feeling that this may be due to the fact that room.OnstateChange can no longer be configured before the room is actually connected (in v0.11).

In the cases where room.OnstateChange isn't called, I have tested and verified that the initial state does get properly downloaded to the Unity client.

endel commented 4 years ago

Hi @rnd256, this issue is probably fixed on version 0.12. Now the server is waiting for the client to acknowledge the JOIN_ROOM to send the first full state - and then the patches. Let me know if version 0.12 fixes this for you! Cheers!

rnd256 commented 4 years ago

Updated to 0.12, and looks like I can't repro this issue anymore. Cheers!