Overhaul client latency calculations.

The ping/pong orders are replaced with a dedicated
(and much smaller) Ping packet that is handled
directly in the client and server Connection wrappers.

This allows clients to respond when the orders are
processed, instead of queuing the pong order to be
sent in the next frame (which added an extra 120ms
of unwanted latency).

The ping frequency has been raised to 1Hz, and pings
are now routed through the server events queue in
preparation for the future dynamic latency system.

The raw ping numbers are no longer sent to clients,
the server instead evaluates a single ConnectionQuality
value that in the future may be based on more than
just the ping times.
This commit is contained in:
Paul Chote
2021-09-20 22:44:49 +01:00
committed by abcdefg30
parent 67face8cf0
commit df798fb620
12 changed files with 161 additions and 150 deletions

View File

@@ -38,6 +38,8 @@ namespace OpenRA.Server
// - Order-specific data - see OpenRA.Game/Server/Order.cs for details
// - 0x10: Order acknowledgement (sent from the server to a client in response to a packet with world orders)
// - Int32 containing the frame number that the client should apply the orders it sent
// - 0x20: Ping
// - Int64 containing the server timestamp when the ping was generated
//
// A connection handshake begins when a client opens a connection to the server:
// - Server sends:
@@ -71,6 +73,6 @@ namespace OpenRA.Server
// The protocol for server and world orders
// This applies after the handshake has completed, and is provided to support
// alternative server implementations that wish to support multiple versions in parallel
public const int Orders = 15;
public const int Orders = 16;
}
}