fix sync-checking in replays

This commit is contained in:
Bob
2010-10-21 15:33:24 +13:00
parent 2bcf33661a
commit a61d21e501
2 changed files with 15 additions and 1 deletions

View File

@@ -29,10 +29,23 @@ namespace OpenRA.Network
// do nothing; ignore locally generated orders
public void Send( int frame, List<byte[]> orders ) { }
public void SendImmediate( List<byte[]> orders ) { }
public void SendSync( int frame, byte[] syncData ) { }
public void SendSync( int frame, byte[] syncData )
{
var ms = new MemoryStream();
ms.Write( BitConverter.GetBytes( frame ) );
ms.Write( syncData );
sync.Add( ms.ToArray() );
}
List<byte[]> sync = new List<byte[]>();
public void Receive( Action<int, byte[]> packetFn )
{
while( sync.Count != 0 )
{
packetFn( LocalClientId, sync[ 0 ] );
sync.RemoveAt( 0 );
}
if( replayStream == null ) return;
var reader = new BinaryReader( replayStream );

View File

@@ -41,6 +41,7 @@ namespace OpenRA
public void Draw( WorldRenderer wr, World world )
{
if( world.LocalPlayer == null ) return;
if (world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().UnitInfluenceDebug)
{
var uim = world.WorldActor.Trait<UnitInfluence>();