2021-08-08 19:04:15 +00:00
|
|
|
|
using QSB.ClientServerStateSync;
|
|
|
|
|
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
|
|
|
|
{
|
2021-08-08 19:04:15 +00:00
|
|
|
|
public class PlayerInformationMessage : PlayerMessage
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
public string PlayerName { get; set; }
|
2021-04-18 17:42:22 +00:00
|
|
|
|
public PlayerState PlayerState { get; set; }
|
2021-08-08 19:04:15 +00:00
|
|
|
|
public ClientState ClientState { 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();
|
2021-04-18 17:42:22 +00:00
|
|
|
|
PlayerState = new PlayerState
|
|
|
|
|
{
|
2021-04-18 17:46:55 +00:00
|
|
|
|
IsReady = reader.ReadBoolean(),
|
2021-04-18 17:42:22 +00:00
|
|
|
|
FlashlightActive = reader.ReadBoolean(),
|
|
|
|
|
SuitedUp = reader.ReadBoolean(),
|
|
|
|
|
ProbeLauncherEquipped = reader.ReadBoolean(),
|
|
|
|
|
SignalscopeEquipped = reader.ReadBoolean(),
|
|
|
|
|
TranslatorEquipped = reader.ReadBoolean(),
|
|
|
|
|
ProbeActive = reader.ReadBoolean()
|
|
|
|
|
};
|
2021-08-08 19:04:15 +00:00
|
|
|
|
ClientState = (ClientState)reader.ReadInt32();
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
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);
|
2021-04-18 17:46:55 +00:00
|
|
|
|
writer.Write(PlayerState.IsReady);
|
2021-04-18 17:42:22 +00:00
|
|
|
|
writer.Write(PlayerState.FlashlightActive);
|
|
|
|
|
writer.Write(PlayerState.SuitedUp);
|
|
|
|
|
writer.Write(PlayerState.ProbeLauncherEquipped);
|
|
|
|
|
writer.Write(PlayerState.SignalscopeEquipped);
|
|
|
|
|
writer.Write(PlayerState.TranslatorEquipped);
|
|
|
|
|
writer.Write(PlayerState.ProbeActive);
|
2021-08-08 19:04:15 +00:00
|
|
|
|
writer.Write((int)ClientState);
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-08-08 19:04:15 +00:00
|
|
|
|
}
|