From 8fbafd7e4c2f05ceb5dd5f9876b83b00c63d05c3 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Mon, 10 Aug 2020 12:02:01 +0100 Subject: [PATCH] add logs --- QSB/Events/PlayerReadyEvent.cs | 1 + QSB/Events/PlayerStatesRequest.cs | 1 + QSB/PlayerInfo.cs | 3 ++- QSB/PlayerRegistry.cs | 4 +++- QSB/QSB.cs | 1 + QSB/TimeSync/WakeUpSync.cs | 6 ------ 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/QSB/Events/PlayerReadyEvent.cs b/QSB/Events/PlayerReadyEvent.cs index 54f5c614..375dd663 100644 --- a/QSB/Events/PlayerReadyEvent.cs +++ b/QSB/Events/PlayerReadyEvent.cs @@ -27,6 +27,7 @@ namespace QSB.Events public override void OnServerReceive(ToggleMessage message) { + DebugLog.ToConsole($"Receieved ready message from {message.SenderId}"); PlayerRegistry.GetPlayer(message.SenderId).IsReady = message.ToggleValue; PlayerState.LocalInstance.Send(); } diff --git a/QSB/Events/PlayerStatesRequest.cs b/QSB/Events/PlayerStatesRequest.cs index 9de860da..153e3c74 100644 --- a/QSB/Events/PlayerStatesRequest.cs +++ b/QSB/Events/PlayerStatesRequest.cs @@ -23,6 +23,7 @@ namespace QSB.Events public void Request() { + DebugLog.ToConsole("Requesting player states...", OWML.Common.MessageType.Info); StartCoroutine(SendRequest()); } diff --git a/QSB/PlayerInfo.cs b/QSB/PlayerInfo.cs index b8f5702e..db85d0db 100644 --- a/QSB/PlayerInfo.cs +++ b/QSB/PlayerInfo.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using QSB.Tools; using QSB.Utility; using UnityEngine; diff --git a/QSB/PlayerRegistry.cs b/QSB/PlayerRegistry.cs index 19312678..86398093 100644 --- a/QSB/PlayerRegistry.cs +++ b/QSB/PlayerRegistry.cs @@ -5,6 +5,7 @@ using QSB.TransformSync; using QSB.Animation; using QSB.Utility; using QSB.Messaging; +using System; namespace QSB { @@ -19,6 +20,7 @@ namespace QSB public static PlayerInfo CreatePlayer(uint id) { + DebugLog.ToConsole($"Creating player with ID {id}", OWML.Common.MessageType.Info); if (PlayerExists(id)) { return null; @@ -49,7 +51,7 @@ namespace QSB player.Name = message.PlayerName; player.IsReady = message.PlayerReady; player.State = message.PlayerState; - + DebugLog.ToConsole($"Updating state for player {player.NetId} to {Convert.ToString((int)player.State, 2)}"); if (LocalPlayer.IsReady == true) { player.UpdateStateObjects(); diff --git a/QSB/QSB.cs b/QSB/QSB.cs index 1190724c..fb4c9714 100644 --- a/QSB/QSB.cs +++ b/QSB/QSB.cs @@ -37,6 +37,7 @@ namespace QSB private void OnWakeUp() { WokenUp = true; + PlayerStatesRequest.Instance.Request(); } private void OnLoopStart() diff --git a/QSB/TimeSync/WakeUpSync.cs b/QSB/TimeSync/WakeUpSync.cs index d3d06133..65dea54d 100644 --- a/QSB/TimeSync/WakeUpSync.cs +++ b/QSB/TimeSync/WakeUpSync.cs @@ -50,7 +50,6 @@ namespace QSB.TimeSync } GlobalMessenger.AddListener("RestartTimeLoop", OnLoopStart); - GlobalMessenger.AddListener("WakeUp", OnWakeUp); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) @@ -70,11 +69,6 @@ namespace QSB.TimeSync _localLoopCount++; } - private void OnWakeUp() - { - PlayerStatesRequest.Instance.Request(); - } - private void Init() { PlayerStatesRequest.Instance.Request();