diff --git a/QSB/AssetBundles/qsb_network b/QSB/AssetBundles/qsb_network index 9b03b4b4..c9a19ef1 100644 Binary files a/QSB/AssetBundles/qsb_network and b/QSB/AssetBundles/qsb_network differ diff --git a/QSB/TimeSync/WakeUpSync.cs b/QSB/TimeSync/WakeUpSync.cs index 26479397..13741f95 100644 --- a/QSB/TimeSync/WakeUpSync.cs +++ b/QSB/TimeSync/WakeUpSync.cs @@ -16,11 +16,7 @@ using UnityEngine; namespace QSB.TimeSync; -/// -/// BUG: this runs on remote players = BAD! can we move this off of network player? -/// -[UsedInUnityProject] -public class WakeUpSync : NetworkBehaviour +public class WakeUpSync : MonoBehaviour, IAddComponentOnStart { public static WakeUpSync LocalInstance { get; private set; } @@ -41,8 +37,6 @@ public class WakeUpSync : NetworkBehaviour private int _serverLoopCount; private bool _hasWokenUp; - public override void OnStartLocalPlayer() => LocalInstance = this; - public void OnDisconnect() { OWTime.SetTimeScale(1f); @@ -60,10 +54,7 @@ public class WakeUpSync : NetworkBehaviour public void Start() { - if (!isLocalPlayer) - { - return; - } + LocalInstance = this; if (QSBSceneManager.IsInUniverse) { @@ -120,7 +111,7 @@ public class WakeUpSync : NetworkBehaviour { new RequestStateResyncMessage().Send(); CurrentState = State.Loaded; - if (isServer) + if (QSBCore.IsHost) { SendServerTime(); } @@ -162,7 +153,7 @@ public class WakeUpSync : NetworkBehaviour return; } - if (PlayerData.LoadLoopCount() != _serverLoopCount && !isServer) + if (PlayerData.LoadLoopCount() != _serverLoopCount && !QSBCore.IsHost) { DebugLog.ToConsole($"Warning - ServerLoopCount is not the same as local loop count! local:{PlayerData.LoadLoopCount()} server:{_serverLoopCount}"); return; @@ -268,11 +259,11 @@ public class WakeUpSync : NetworkBehaviour public void Update() { - if (isServer) + if (QSBCore.IsHost) { UpdateServer(); } - else if (isLocalPlayer && !QSBCore.DebugSettings.AvoidTimeSync) + else if (!QSBCore.DebugSettings.AvoidTimeSync) { UpdateClient(); }