2020-08-09 09:11:45 +00:00
|
|
|
|
using UnityEngine.Networking;
|
2020-05-19 17:31:54 +00:00
|
|
|
|
|
2020-08-09 11:40:35 +00:00
|
|
|
|
namespace QSB.Messaging
|
2020-05-19 17:31:54 +00:00
|
|
|
|
{
|
2020-08-09 20:46:51 +00:00
|
|
|
|
public class PlayerStateMessage : PlayerMessage
|
2020-05-19 17:31:54 +00:00
|
|
|
|
{
|
2020-07-27 23:13:43 +00:00
|
|
|
|
public string PlayerName { get; set; }
|
2020-08-10 10:45:24 +00:00
|
|
|
|
public bool PlayerReady { get; set; }
|
2020-08-09 20:46:51 +00:00
|
|
|
|
public State PlayerState { get; set; }
|
2020-08-14 18:31:33 +00:00
|
|
|
|
public Sector.Name SectorID { get; set; }
|
|
|
|
|
public string SectorName { get; set; }
|
2020-05-19 17:31:54 +00:00
|
|
|
|
|
|
|
|
|
public override void Deserialize(NetworkReader reader)
|
|
|
|
|
{
|
|
|
|
|
base.Deserialize(reader);
|
2020-07-27 23:13:43 +00:00
|
|
|
|
PlayerName = reader.ReadString();
|
2020-08-10 10:45:24 +00:00
|
|
|
|
PlayerReady = reader.ReadBoolean();
|
2020-08-09 20:46:51 +00:00
|
|
|
|
PlayerState = (State)reader.ReadInt32();
|
2020-08-14 18:31:33 +00:00
|
|
|
|
SectorID = (Sector.Name)reader.ReadInt32();
|
|
|
|
|
SectorName = reader.ReadString();
|
2020-05-19 17:31:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Serialize(NetworkWriter writer)
|
|
|
|
|
{
|
|
|
|
|
base.Serialize(writer);
|
2020-07-27 23:13:43 +00:00
|
|
|
|
writer.Write(PlayerName);
|
2020-08-10 10:45:24 +00:00
|
|
|
|
writer.Write(PlayerReady);
|
2020-08-09 20:46:51 +00:00
|
|
|
|
writer.Write((int)PlayerState);
|
2020-08-14 18:31:33 +00:00
|
|
|
|
writer.Write((int)SectorID);
|
|
|
|
|
writer.Write(SectorName);
|
2020-05-19 17:31:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|