mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 03:28:26 +00:00
30 lines
757 B
C#
30 lines
757 B
C#
using QSB.ClientServerStateSync;
|
|
using QSB.ClientServerStateSync.Messages;
|
|
using QSB.Messaging;
|
|
using QSB.Patches;
|
|
using QSB.Utility;
|
|
|
|
namespace QSB.DeathSync.Messages;
|
|
|
|
// when all players die
|
|
public class EndLoopMessage : QSBMessage
|
|
{
|
|
public override void OnReceiveLocal() => OnReceiveRemote();
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
DebugLog.DebugWrite($" ~~~~ END LOOP - all players are dead ~~~~ ");
|
|
if (ServerStateManager.Instance.GetServerState() == ServerState.WaitingForAllPlayersToDie)
|
|
{
|
|
return;
|
|
}
|
|
|
|
QSBPatchManager.DoUnpatchType(QSBPatchTypes.RespawnTime);
|
|
|
|
Locator.GetDeathManager().KillPlayer(DeathType.TimeLoop);
|
|
if (QSBCore.IsHost)
|
|
{
|
|
new ServerStateMessage(ServerState.WaitingForAllPlayersToDie).Send();
|
|
}
|
|
}
|
|
} |