fix: if there is a broken room, retry
This commit is contained in:
parent
50bff13fae
commit
ee6c2fa97c
@ -385,12 +385,14 @@ private void OnNewGameState()
|
||||
EndGame.SetActive(false);
|
||||
|
||||
VotePicture.SetActive(true);
|
||||
Debug.Log("subscribe to question ID");
|
||||
myOnlineRoom.Child("currentQuestionId").ValueChanged += OnCurrentQuestionChanged;
|
||||
break;
|
||||
}
|
||||
case (int)GameState.Score:
|
||||
{
|
||||
Debug.Log("it's scoring time !", this);
|
||||
Debug.Log("unsubscribe to question ID");
|
||||
myOnlineRoom.Child("currentQuestionId").ValueChanged -= OnCurrentQuestionChanged;
|
||||
|
||||
WaitingOtherPlayers.SetActive(false);
|
||||
|
@ -401,7 +401,7 @@ private void QueryRoomsInDatabase(Action<List<Room>> callback)
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogException(e);
|
||||
Debug.LogError($"Room {JSON} was broken, deleting it", this);
|
||||
Debug.Log($"Room {JSON} is broken, deleting it", this);
|
||||
snapshot.Reference.RemoveValueAsync().ContinueWithOnMainThread(task =>
|
||||
{
|
||||
if (task.IsFaulted)
|
||||
@ -409,8 +409,9 @@ private void QueryRoomsInDatabase(Action<List<Room>> callback)
|
||||
Debug.LogException(task.Exception);
|
||||
return;
|
||||
}
|
||||
Debug.Log($"Broken room has been deleted", this);
|
||||
}); ;
|
||||
Debug.Log($"Broken room has been deleted. Checking again", this);
|
||||
QueryRoomsInDatabase(callback);
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user