Server: add basic replay recording

Signed-off-by: Paul Chote <pchote@users.noreply.github.com>
This commit is contained in:
Clément Bœsch
2020-10-09 23:44:19 +01:00
committed by abcdefg30
parent dd18829def
commit e5da58e2b4
6 changed files with 105 additions and 4 deletions

View File

@@ -10,6 +10,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using OpenRA.FileFormats;
@@ -85,6 +86,14 @@ namespace OpenRA.Network
writer.Write(data);
}
public void ReceiveFrame(int clientID, int frame, byte[] data)
{
var ms = new MemoryStream(4 + data.Length);
ms.WriteArray(BitConverter.GetBytes(frame));
ms.WriteArray(data);
Receive(clientID, ms.GetBuffer());
}
bool disposed;
public void Dispose()