mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-07 13:05:41 +00:00
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using QSB.ClientServerStateSync;
|
|
using QSB.Messaging;
|
|
using QuantumUNET.Transport;
|
|
|
|
namespace QSB.Player.Events
|
|
{
|
|
public class PlayerInformationMessage : PlayerMessage
|
|
{
|
|
public string PlayerName { get; set; }
|
|
public PlayerState PlayerState { get; set; }
|
|
public ClientState ClientState { get; set; }
|
|
|
|
public override void Deserialize(QNetworkReader reader)
|
|
{
|
|
base.Deserialize(reader);
|
|
PlayerName = reader.ReadString();
|
|
PlayerState = new PlayerState
|
|
{
|
|
IsReady = reader.ReadBoolean(),
|
|
FlashlightActive = reader.ReadBoolean(),
|
|
SuitedUp = reader.ReadBoolean(),
|
|
ProbeLauncherEquipped = reader.ReadBoolean(),
|
|
SignalscopeEquipped = reader.ReadBoolean(),
|
|
TranslatorEquipped = reader.ReadBoolean(),
|
|
ProbeActive = reader.ReadBoolean()
|
|
};
|
|
ClientState = (ClientState)reader.ReadInt32();
|
|
}
|
|
|
|
public override void Serialize(QNetworkWriter writer)
|
|
{
|
|
base.Serialize(writer);
|
|
writer.Write(PlayerName);
|
|
writer.Write(PlayerState.IsReady);
|
|
writer.Write(PlayerState.FlashlightActive);
|
|
writer.Write(PlayerState.SuitedUp);
|
|
writer.Write(PlayerState.ProbeLauncherEquipped);
|
|
writer.Write(PlayerState.SignalscopeEquipped);
|
|
writer.Write(PlayerState.TranslatorEquipped);
|
|
writer.Write(PlayerState.ProbeActive);
|
|
writer.Write((int)ClientState);
|
|
}
|
|
}
|
|
}
|