fix(gamemanager): subscribe only after room is created
This commit is contained in:
parent
b9c1d74943
commit
dc20e8e87e
@ -207,11 +207,12 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code)
|
||||
else
|
||||
{
|
||||
myOnlineRoom = realtimeDB.Child("rooms").Child(_code);
|
||||
//subscribe to it
|
||||
myOnlineRoom.ValueChanged += OnRoomUpdate;
|
||||
//if room exists, join it
|
||||
JoinRoom(() =>
|
||||
{
|
||||
//subscribe to it
|
||||
myOnlineRoom.ValueChanged += OnRoomUpdate;
|
||||
|
||||
myRoom.currentState = (int)GameState.WaitingForOtherPlayersToJoin;
|
||||
players.Add(currentPlayer);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user