GodotTicTacToe/scripts/net/packethandling/packets/SyncPkt.cs

28 lines
942 B
C#
Raw Normal View History


2017-11-25 11:29:48 +01:00
namespace Network.PacketHandling.Packets {
public class SyncPkt : Serializable {
public int LastReliableIDReceived = -1;
public int LastUnreliableIDReceived = -1;
public int AmountOfUnreliablePackets = 0;
public int AmountOfReliablePackets = 0;
public override void WriteContents(PacketBuffer packetBuffer) {
packetBuffer.Write(LastReliableIDReceived);
packetBuffer.Write(LastUnreliableIDReceived);
packetBuffer.Write(AmountOfUnreliablePackets);
packetBuffer.Write(AmountOfReliablePackets);
}
public override void ReadContents(PacketBuffer packetBuffer) {
LastReliableIDReceived = packetBuffer.ReadInt();
LastUnreliableIDReceived = packetBuffer.ReadInt();
AmountOfUnreliablePackets = packetBuffer.ReadInt();
AmountOfReliablePackets = packetBuffer.ReadInt();
}
}
}