extract SyncReport class from Game

This commit is contained in:
Bob
2010-08-21 17:53:39 +12:00
parent 0e16aa339d
commit 9eaa0e5765
4 changed files with 69 additions and 55 deletions

View File

@@ -18,6 +18,8 @@ namespace OpenRA.Network
{
class OrderManager : IDisposable
{
SyncReport syncReport = new SyncReport();
public int FrameNumber { get; private set; }
public int FramesAhead = 0;
@@ -109,7 +111,7 @@ namespace OpenRA.Network
{
if (packet.Length != existingSync.Length)
{
Game.DumpSyncReport(frame);
syncReport.DumpSyncReport(frame);
OutOfSync(frame);
}
else
@@ -118,7 +120,7 @@ namespace OpenRA.Network
{
if (packet[i] != existingSync[i])
{
Game.DumpSyncReport(frame);
syncReport.DumpSyncReport(frame);
if (i < SyncHeaderSize)
OutOfSync(frame, "Tick");
@@ -189,7 +191,7 @@ namespace OpenRA.Network
Connection.Send( ss );
WriteToReplay( frameData, ss );
Game.UpdateSyncReport();
syncReport.UpdateSyncReport();
CheckSync( ss );