Rework IConnection implementations:

* EchoConnection is now a trivial buffer that stores
  and repeats orders directly without serialization.

* NetworkConnection no longer subclasses EchoConnection,
  and now also caches local orders without serialization.

* Replay recording was moved to NetworkConnection
  (it is never used on EchoConnection).
This commit is contained in:
Paul Chote
2021-08-29 15:15:54 +01:00
committed by abcdefg30
parent 408f30b5cd
commit 6421c17515
6 changed files with 169 additions and 140 deletions

View File

@@ -29,10 +29,10 @@ namespace OpenRA.Network
static bool IsGameStart(byte[] data)
{
if (!OrderIO.TryParseOrderPacket(data, out var frame, out var orders))
if (!OrderIO.TryParseOrderPacket(data, out var orders))
return false;
return frame == 0 && orders.GetOrders(null).Any(o => o.OrderString == "StartGame");
return orders.Frame == 0 && orders.Orders.GetOrders(null).Any(o => o.OrderString == "StartGame");
}
public ReplayRecorder(Func<string> chooseFilename)