fix sync-checking in replays
This commit is contained in:
@@ -29,10 +29,23 @@ namespace OpenRA.Network
|
|||||||
// 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 ) { }
|
||||||
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 )
|
public void Receive( Action<int, byte[]> packetFn )
|
||||||
{
|
{
|
||||||
|
while( sync.Count != 0 )
|
||||||
|
{
|
||||||
|
packetFn( LocalClientId, sync[ 0 ] );
|
||||||
|
sync.RemoveAt( 0 );
|
||||||
|
}
|
||||||
if( replayStream == null ) return;
|
if( replayStream == null ) return;
|
||||||
|
|
||||||
var reader = new BinaryReader( replayStream );
|
var reader = new BinaryReader( replayStream );
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ namespace OpenRA
|
|||||||
|
|
||||||
public void Draw( WorldRenderer wr, World world )
|
public void Draw( WorldRenderer wr, World world )
|
||||||
{
|
{
|
||||||
|
if( world.LocalPlayer == null ) return;
|
||||||
if (world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().UnitInfluenceDebug)
|
if (world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().UnitInfluenceDebug)
|
||||||
{
|
{
|
||||||
var uim = world.WorldActor.Trait<UnitInfluence>();
|
var uim = world.WorldActor.Trait<UnitInfluence>();
|
||||||
|
|||||||
Reference in New Issue
Block a user