Send order queue length in ping responses.

This commit is contained in:
Paul Chote
2021-09-25 15:31:04 +01:00
committed by abcdefg30
parent 2d08f2bbfd
commit defaf92752
6 changed files with 30 additions and 17 deletions

View File

@@ -304,12 +304,11 @@ namespace OpenRA.Network
orderManager.ReceiveDisconnect(disconnect.ClientId, disconnect.Frame);
else if (OrderIO.TryParseSync(p.Data, out var sync))
orderManager.ReceiveSync(sync);
else if (OrderIO.TryParsePing(p.FromClient, p.Data, out var ping))
else if (OrderIO.TryParsePingRequest(p, out var timestamp))
{
// The Ping packet is sent back directly without changes
// Note that processing this here, rather than in NetworkConnectionReceive,
// so that poor world tick performance can be reflected in the latency measurement
Send(ping);
Send(OrderIO.SerializePingResponse(timestamp, (byte)orderManager.OrderQueueLength));
record = false;
}
else if (OrderIO.TryParseAck(p, out var ackFrame, out var ackCount))