mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 03:40:46 +00:00
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using UnityEngine.Networking;
|
|
|
|
namespace QSB.Messaging
|
|
{
|
|
public class PlayerStateMessage : PlayerMessage
|
|
{
|
|
public string PlayerName { get; set; }
|
|
public bool PlayerReady { get; set; }
|
|
public State PlayerState { get; set; }
|
|
public Sector.Name SectorID { get; set; }
|
|
public string SectorName { get; set; }
|
|
|
|
public override void Deserialize(NetworkReader reader)
|
|
{
|
|
base.Deserialize(reader);
|
|
PlayerName = reader.ReadString();
|
|
PlayerReady = reader.ReadBoolean();
|
|
PlayerState = (State)reader.ReadInt32();
|
|
SectorID = (Sector.Name)reader.ReadInt32();
|
|
SectorName = reader.ReadString();
|
|
}
|
|
|
|
public override void Serialize(NetworkWriter writer)
|
|
{
|
|
base.Serialize(writer);
|
|
writer.Write(PlayerName);
|
|
writer.Write(PlayerReady);
|
|
writer.Write((int)PlayerState);
|
|
writer.Write((int)SectorID);
|
|
writer.Write(SectorName);
|
|
}
|
|
}
|
|
}
|