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