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);
|
EndGame.SetActive(false);
|
||||||
|
|
||||||
VotePicture.SetActive(true);
|
VotePicture.SetActive(true);
|
||||||
|
Debug.Log("subscribe to question ID");
|
||||||
myOnlineRoom.Child("currentQuestionId").ValueChanged += OnCurrentQuestionChanged;
|
myOnlineRoom.Child("currentQuestionId").ValueChanged += OnCurrentQuestionChanged;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (int)GameState.Score:
|
case (int)GameState.Score:
|
||||||
{
|
{
|
||||||
Debug.Log("it's scoring time !", this);
|
Debug.Log("it's scoring time !", this);
|
||||||
|
Debug.Log("unsubscribe to question ID");
|
||||||
myOnlineRoom.Child("currentQuestionId").ValueChanged -= OnCurrentQuestionChanged;
|
myOnlineRoom.Child("currentQuestionId").ValueChanged -= OnCurrentQuestionChanged;
|
||||||
|
|
||||||
WaitingOtherPlayers.SetActive(false);
|
WaitingOtherPlayers.SetActive(false);
|
||||||
|
@ -401,7 +401,7 @@ private void QueryRoomsInDatabase(Action<List<Room>> callback)
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.LogException(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 =>
|
snapshot.Reference.RemoveValueAsync().ContinueWithOnMainThread(task =>
|
||||||
{
|
{
|
||||||
if (task.IsFaulted)
|
if (task.IsFaulted)
|
||||||
@ -409,8 +409,9 @@ private void QueryRoomsInDatabase(Action<List<Room>> callback)
|
|||||||
Debug.LogException(task.Exception);
|
Debug.LogException(task.Exception);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Debug.Log($"Broken room has been deleted", this);
|
Debug.Log($"Broken room has been deleted. Checking again", this);
|
||||||
}); ;
|
QueryRoomsInDatabase(callback);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user