Update WorldObjectsHashMessage.cs

This commit is contained in:
_nebula 2022-12-11 13:59:04 +00:00
parent 206dadcfdb
commit 1146197f56

View File

@ -14,13 +14,16 @@ internal class WorldObjectsHashMessage : QSBMessage<(string managerName, string
public override void OnReceiveRemote() public override void OnReceiveRemote()
{ {
var serverHash = QSBWorldSync.ManagerHashes[Data.managerName]; Delay.RunWhen(() => QSBWorldSync.AllObjectsReady, () =>
if (serverHash != Data.hash)
{ {
// oh fuck oh no oh god var serverHash = QSBWorldSync.ManagerHashes[Data.managerName];
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(); 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();
}
});
} }
} }