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