Move order latency control to the server.

This commit is contained in:
Paul Chote
2021-09-02 22:08:28 +01:00
committed by abcdefg30
parent 6421c17515
commit 8f412f869d
9 changed files with 120 additions and 45 deletions

View File

@@ -106,6 +106,19 @@ namespace OpenRA.Network
return true;
}
public static bool TryParseAck((int FromClient, byte[] Data) packet, out int frame)
{
// Ack packets are only accepted from the server
if (packet.FromClient != 0 || packet.Data.Length != 5 || packet.Data[4] != (byte)OrderType.Ack)
{
frame = 0;
return false;
}
frame = BitConverter.ToInt32(packet.Data, 0);
return true;
}
public static bool TryParseOrderPacket(byte[] packet, out (int Frame, OrderPacket Orders) data)
{
// Not a valid packet