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

@@ -128,13 +128,13 @@ namespace OpenRA.Server
{
// Ping packets are sent and processed internally within this thread to reduce
// server-introduced latencies from polling loops
if (expectLength == 9 && bytes[0] == (byte)OrderType.Ping)
if (expectLength == 10 && bytes[0] == (byte)OrderType.Ping)
{
if (pingHistory.Count == MaxPingSamples)
pingHistory.Dequeue();
pingHistory.Enqueue((int)(Game.RunTime - BitConverter.ToInt64(bytes, 1)));
server.OnConnectionPing(this, pingHistory.ToArray());
server.OnConnectionPing(this, pingHistory.ToArray(), bytes[9]);
}
else
server.OnConnectionPacket(this, frame, bytes);