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
|
else
|
||||||
{
|
{
|
||||||
myOnlineRoom = realtimeDB.Child("rooms").Child(_code);
|
myOnlineRoom = realtimeDB.Child("rooms").Child(_code);
|
||||||
//subscribe to it
|
|
||||||
myOnlineRoom.ValueChanged += OnRoomUpdate;
|
|
||||||
//if room exists, join it
|
//if room exists, join it
|
||||||
JoinRoom(() =>
|
JoinRoom(() =>
|
||||||
{
|
{
|
||||||
|
//subscribe to it
|
||||||
|
myOnlineRoom.ValueChanged += OnRoomUpdate;
|
||||||
|
|
||||||
myRoom.currentState = (int)GameState.WaitingForOtherPlayersToJoin;
|
myRoom.currentState = (int)GameState.WaitingForOtherPlayersToJoin;
|
||||||
players.Add(currentPlayer);
|
players.Add(currentPlayer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user