GodotTicTacToe/scripts/net/packethandling/packets/SyncPkt.cs
2017-11-25 12:29:48 +02:00

28 lines
942 B
C#

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();
}
}
}