2020-12-14 16:28:03 +00:00
|
|
|
|
using QSB.Messaging;
|
2020-12-16 09:08:38 +00:00
|
|
|
|
using QuantumUNET.Transport;
|
2020-05-19 17:31:54 +00:00
|
|
|
|
|
2020-11-03 21:33:48 +00:00
|
|
|
|
namespace QSB.Player.Events
|
2020-05-19 17:31:54 +00:00
|
|
|
|
{
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public class PlayerStateMessage : PlayerMessage
|
|
|
|
|
{
|
|
|
|
|
public string PlayerName { get; set; }
|
|
|
|
|
public bool PlayerReady { get; set; }
|
|
|
|
|
public State PlayerState { get; set; }
|
2020-12-11 22:42:21 +00:00
|
|
|
|
|
2020-12-23 12:58:45 +00:00
|
|
|
|
public override void Deserialize(QNetworkReader reader)
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
base.Deserialize(reader);
|
|
|
|
|
PlayerName = reader.ReadString();
|
|
|
|
|
PlayerReady = reader.ReadBoolean();
|
|
|
|
|
PlayerState = (State)reader.ReadInt32();
|
|
|
|
|
}
|
2020-05-19 17:31:54 +00:00
|
|
|
|
|
2020-12-23 12:58:45 +00:00
|
|
|
|
public override void Serialize(QNetworkWriter writer)
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
base.Serialize(writer);
|
|
|
|
|
writer.Write(PlayerName);
|
|
|
|
|
writer.Write(PlayerReady);
|
|
|
|
|
writer.Write((int)PlayerState);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-03 08:28:05 +00:00
|
|
|
|
}
|