add debug logs

This commit is contained in:
Fangh 2024-02-04 12:23:12 +01:00
parent 723edde647
commit 825c69fcc1

View File

@ -285,7 +285,6 @@ public void StartGame()
/// </summary> /// </summary>
private void OnRoomUpdate(object sender, ValueChangedEventArgs e) private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
{ {
Debug.Log("begin OnRoomUpdate");
GameState lastState = (GameState)myRoom.currentState; GameState lastState = (GameState)myRoom.currentState;
try try
@ -294,8 +293,8 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
if (e?.Snapshot?.GetRawJsonValue() != null) if (e?.Snapshot?.GetRawJsonValue() != null)
{ {
string JSON = e.Snapshot.GetRawJsonValue(); string JSON = e.Snapshot.GetRawJsonValue();
Debug.Log($"Room has been updated : {JSON}", this);
myRoom = JsonConvert.DeserializeObject<Room>(e.Snapshot.GetRawJsonValue()); myRoom = JsonConvert.DeserializeObject<Room>(e.Snapshot.GetRawJsonValue());
} }
} }
catch (Exception ex) catch (Exception ex)
@ -304,7 +303,7 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
} }
if (myRoom == null) if (myRoom == null)
{ {
Debug.Log("myroom is null"); Debug.LogError("Got an update for an empty room.", this);
return; return;
} }
@ -347,7 +346,9 @@ private void OnNewGameState()
} }
case (int)GameState.Explanation: case (int)GameState.Explanation:
{ {
Debug.Log("Explanation time.", this);
EndGame.SetActive(false); EndGame.SetActive(false);
WaitingOtherPlayers.SetActive(false);
WaitingRoom.SetActive(false); WaitingRoom.SetActive(false);
BeforeStart.SetActive(true); BeforeStart.SetActive(true);
endOfViewDate = DateTime.Now.AddSeconds(4); endOfViewDate = DateTime.Now.AddSeconds(4);