Hello,
I am having trouble with the lobby event callback system as I am finding the call backs are not being called even though the correct events are firing and the data is being updated on all clients.
I have a lobby screen, where the initial event callbacks are setup to handle players joining/leaving the lobby, changing team and reading up.
Once all players are ready, then the lobby owner will load the game scene, start the session, notify the lobby and then all the other players load the scene and join the session. This all works fine.
When the lobby owner wants to restart the game or one team wins, the “restart game” function will execute, which will follow the same flow, which is:
- Network session is shutdown
- Lobby owner loads new scene
- New network session is created
- Lobby owner notifies lobby
- All players load scene and join session
The problem occurs when restarting the game from the game scene as the lobby owner loads the new scene and updates the lobby data to notify all the other players. I have tested that the lobby data DEFINITELY gets updated for all clients, but the lobby event call backs do NOT get called when the data is added/changed.
A fix i have tried is when the game scene loads and before the session is created, unsubscribe from previous lobby events, create new specific “in game” lobby event callbacks and re-subscribe to the lobby events with new callbacks. This still doesn’t work.
The only other thing i can think of is to continuously check the lobby data in an update function somewhere to detect the changes, but surely this is unneeded as the callbacks should work?