From 1146197f56da630ba9a8be49fd9a12a35149bb3f Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 11 Dec 2022 13:59:04 +0000 Subject: [PATCH] Update WorldObjectsHashMessage.cs --- QSB/WorldSync/WorldObjectsHashMessage.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/QSB/WorldSync/WorldObjectsHashMessage.cs b/QSB/WorldSync/WorldObjectsHashMessage.cs index fc18ec15..97401be1 100644 --- a/QSB/WorldSync/WorldObjectsHashMessage.cs +++ b/QSB/WorldSync/WorldObjectsHashMessage.cs @@ -14,13 +14,16 @@ internal class WorldObjectsHashMessage : QSBMessage<(string managerName, string public override void OnReceiveRemote() { - var serverHash = QSBWorldSync.ManagerHashes[Data.managerName]; - - if (serverHash != Data.hash) + Delay.RunWhen(() => QSBWorldSync.AllObjectsReady, () => { - // oh fuck oh no oh god - DebugLog.ToConsole($"Kicking {From} because their WorldObjects hash for {Data.managerName} is wrong. (server:{serverHash}, client:{Data.hash})", MessageType.Error); - new PlayerKickMessage(From, $"WorldObject hash error for {Data.managerName}. (Server:{serverHash}, Client:{Data.hash})").Send(); - } + var serverHash = QSBWorldSync.ManagerHashes[Data.managerName]; + + if (serverHash != Data.hash) + { + // oh fuck oh no oh god + DebugLog.ToConsole($"Kicking {From} because their WorldObjects hash for {Data.managerName} is wrong. (server:{serverHash}, client:{Data.hash})", MessageType.Error); + new PlayerKickMessage(From, $"WorldObject hash error for {Data.managerName}. (Server:{serverHash}, Client:{Data.hash})").Send(); + } + }); } }