mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 03:28:26 +00:00
23 lines
557 B
C#
23 lines
557 B
C#
using QSB.ClientServerStateSync;
|
|
using QSB.Messaging;
|
|
using QSB.Player;
|
|
|
|
namespace QSB.RespawnSync.Messages;
|
|
|
|
public class PlayerRespawnMessage : QSBMessage<uint>
|
|
{
|
|
public PlayerRespawnMessage(uint playerId) : base(playerId) { }
|
|
|
|
public override void OnReceiveLocal() => OnReceiveRemote();
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
if (Data == QSBPlayerManager.LocalPlayerId)
|
|
{
|
|
RespawnManager.Instance.Respawn();
|
|
ClientStateManager.Instance.OnRespawn();
|
|
}
|
|
|
|
RespawnManager.Instance.OnPlayerRespawn(QSBPlayerManager.GetPlayer(Data));
|
|
}
|
|
} |