quantum-space-buddies/QSB/TransformSync/SectorMessage.cs

26 lines
605 B
C#
Raw Normal View History

2020-02-21 22:36:07 +00:00
using QSB.Messaging;
using UnityEngine.Networking;
2020-02-12 19:58:42 +00:00
2020-02-21 22:36:07 +00:00
namespace QSB.TransformSync
2020-02-15 19:48:02 +00:00
{
2020-02-21 22:36:07 +00:00
public class SectorMessage : QSBMessage
2020-02-15 19:48:02 +00:00
{
2020-02-21 22:36:07 +00:00
public override MessageType MessageType => MessageType.Sector;
2020-02-15 19:48:02 +00:00
public int SectorId;
public uint SenderId;
2020-02-12 19:58:42 +00:00
2020-02-15 19:48:02 +00:00
public override void Deserialize(NetworkReader reader)
{
SectorId = reader.ReadInt32();
SenderId = reader.ReadPackedUInt32();
2020-02-12 19:58:42 +00:00
}
2020-02-15 19:48:02 +00:00
public override void Serialize(NetworkWriter writer)
{
writer.Write(SectorId);
writer.Write(SenderId);
2020-02-12 19:58:42 +00:00
}
2020-02-21 22:36:07 +00:00
2020-02-12 19:58:42 +00:00
}
}