Update WorldObjectsHashMessage.cs

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

View File

@ -13,6 +13,8 @@ internal class WorldObjectsHashMessage : QSBMessage<(string managerName, string
public WorldObjectsHashMessage(string managerName, string hash) : base((managerName, hash)) => To = 0;
public override void OnReceiveRemote()
{
Delay.RunWhen(() => QSBWorldSync.AllObjectsReady, () =>
{
var serverHash = QSBWorldSync.ManagerHashes[Data.managerName];
@ -22,5 +24,6 @@ internal class WorldObjectsHashMessage : QSBMessage<(string managerName, string
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();
}
});
}
}