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

@@ -289,10 +289,8 @@ namespace OpenRA
gameInfo.DisabledSpawnPoints = OrderManager.LobbyInfo.DisabledSpawnPoints;
var rc = (OrderManager.Connection as EchoConnection)?.Recorder;
if (rc != null)
rc.Metadata = new ReplayMetadata(gameInfo);
if (OrderManager.Connection is NetworkConnection nc && nc.Recorder != null)
nc.Recorder.Metadata = new ReplayMetadata(gameInfo);
}
public void SetWorldOwner(Player p)