mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-04 03:39:55 +00:00
add check for not ready player
This commit is contained in:
parent
13069d6088
commit
125a0527dc
@ -1,6 +1,8 @@
|
||||
using OWML.Common;
|
||||
using QSB.ClientServerStateSync;
|
||||
using QSB.Messaging;
|
||||
using QSB.Player;
|
||||
using QSB.Player.Events;
|
||||
using QSB.Player.TransformSync;
|
||||
using QSB.Utility;
|
||||
using QuantumUNET.Components;
|
||||
@ -79,6 +81,20 @@ namespace QSB.Events
|
||||
return;
|
||||
}
|
||||
|
||||
if (QSBPlayerManager.PlayerExists(message.FromId))
|
||||
{
|
||||
var player = QSBPlayerManager.GetPlayer(message.FromId);
|
||||
|
||||
if (!player.IsReady
|
||||
&& player.PlayerId != LocalPlayerId
|
||||
&& (player.State is ClientState.AliveInSolarSystem or ClientState.AliveInEye or ClientState.DeadInSolarSystem)
|
||||
&& (message is not PlayerInformationEvent or PlayerReadyEvent))
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Got message from player {message.FromId}, but they were not ready. Asking for state resync, just in case.", MessageType.Warning);
|
||||
QSBEventManager.FireEvent(EventNames.QSBRequestStateResync);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (message.FromId == QSBPlayerManager.LocalPlayerId ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user