Stylecop ReplayConnection.

This commit is contained in:
Paul Chote
2014-03-03 12:41:36 +13:00
parent fd4aa222f7
commit 6385e7ebaa

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,
@@ -19,11 +19,14 @@ namespace OpenRA.Network
FileStream replayStream; FileStream replayStream;
List<byte[]> sync = new List<byte[]>(); List<byte[]> sync = new List<byte[]>();
public ReplayConnection( string replayFilename ) { replayStream = File.OpenRead( replayFilename ); }
public int LocalClientId { get { return 0; } } public int LocalClientId { get { return 0; } }
public ConnectionState ConnectionState { get { return ConnectionState.Connected; } } public ConnectionState ConnectionState { get { return ConnectionState.Connected; } }
public ReplayConnection(string replayFilename)
{
replayStream = File.OpenRead(replayFilename);
}
// do nothing; ignore locally generated orders // do nothing; ignore locally generated orders
public void Send(int frame, List<byte[]> orders) { } public void Send(int frame, List<byte[]> orders) { }
public void SendImmediate(List<byte[]> orders) { } public void SendImmediate(List<byte[]> orders) { }
@@ -44,7 +47,8 @@ namespace OpenRA.Network
sync.RemoveAt(0); sync.RemoveAt(0);
} }
if( replayStream == null ) return; if (replayStream == null)
return;
var reader = new BinaryReader(replayStream); var reader = new BinaryReader(replayStream);