diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 3e769c7..f3450bd 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -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); diff --git a/Assets/Scripts/RoomManager.cs b/Assets/Scripts/RoomManager.cs index 9dd62c9..a1482d5 100644 --- a/Assets/Scripts/RoomManager.cs +++ b/Assets/Scripts/RoomManager.cs @@ -401,7 +401,7 @@ private void QueryRoomsInDatabase(Action> 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> 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