quantum-space-buddies/QSB/Player/Events/PlayerJoinMessage.cs

31 lines
776 B
C#
Raw Normal View History

2020-11-03 21:33:48 +00:00
using QSB.Messaging;
using QuantumUNET.Transport;
2020-08-09 07:37:32 +00:00
2020-11-03 21:33:48 +00:00
namespace QSB.Player.Events
2020-08-09 07:37:32 +00:00
{
2020-12-02 21:23:01 +00:00
public class PlayerJoinMessage : PlayerMessage
{
public string PlayerName { get; set; }
2021-03-09 16:43:41 +00:00
public string QSBVersion { get; set; }
2021-08-10 13:54:23 +00:00
public string GameVersion { get; set; }
2021-10-21 16:21:54 +00:00
public GamePlatform Platform { get; set; }
2020-08-09 07:37:32 +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-03-09 16:43:41 +00:00
QSBVersion = reader.ReadString();
2021-08-10 13:54:23 +00:00
GameVersion = reader.ReadString();
2021-10-21 16:21:54 +00:00
Platform = (GamePlatform)reader.ReadInt32();
2020-12-02 21:23:01 +00:00
}
2020-08-09 07:37:32 +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-03-09 16:43:41 +00:00
writer.Write(QSBVersion);
2021-08-10 13:54:23 +00:00
writer.Write(GameVersion);
2021-10-21 16:21:54 +00:00
writer.Write((int)Platform);
2020-12-02 21:23:01 +00:00
}
}
2020-08-09 07:37:32 +00:00
}