Print actors list on desync [squashed]
This commit is contained in:
@@ -23,6 +23,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Network
|
namespace OpenRA.Network
|
||||||
{
|
{
|
||||||
@@ -116,17 +117,22 @@ namespace OpenRA.Network
|
|||||||
if( syncForFrame.TryGetValue( frame, out existingSync ) )
|
if( syncForFrame.TryGetValue( frame, out existingSync ) )
|
||||||
{
|
{
|
||||||
if( packet.Length != existingSync.Length )
|
if( packet.Length != existingSync.Length )
|
||||||
|
{
|
||||||
|
DumpActors();
|
||||||
OutOfSync( frame );
|
OutOfSync( frame );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for( int i = 0 ; i < packet.Length ; i++ )
|
for( int i = 0 ; i < packet.Length ; i++ )
|
||||||
{
|
{
|
||||||
if( packet[ i ] != existingSync[ i ] )
|
if( packet[ i ] != existingSync[ i ] )
|
||||||
{
|
{
|
||||||
|
DumpActors();
|
||||||
|
|
||||||
if ( i < SyncHeaderSize )
|
if ( i < SyncHeaderSize )
|
||||||
OutOfSync(frame, "Tick");
|
OutOfSync(frame, "Tick");
|
||||||
else
|
else
|
||||||
OutOfSync( frame , (i - SyncHeaderSize) / 4);
|
OutOfSync( frame , (i - SyncHeaderSize) / 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,6 +141,17 @@ namespace OpenRA.Network
|
|||||||
syncForFrame.Add( frame, packet );
|
syncForFrame.Add( frame, packet );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void DumpActors()
|
||||||
|
{
|
||||||
|
Log.Write( "Actors:" );
|
||||||
|
foreach( var a in Game.world.Actors )
|
||||||
|
Log.Write( "\t {0} {1} {2} ({3})", a.ActorID, a.Info.Name, ( a.Owner == null ) ? "null" : a.Owner.InternalName, Sync.CalculateSyncHash( a ) );
|
||||||
|
|
||||||
|
Log.Write( "Tick Actors:" );
|
||||||
|
foreach( var a in Game.world.Queries.WithTraitMultiple<ITick>() )
|
||||||
|
Log.Write( "\t {0} {1} {2} {3} ({4})", a.Actor.ActorID, a.Actor.Info.Name, ( a.Actor.Owner == null ) ? "null" : a.Actor.Owner.InternalName, a.Trait.GetType().Name, Sync.CalculateSyncHash( a.Trait ) );
|
||||||
|
}
|
||||||
|
|
||||||
void OutOfSync( int frame , int index)
|
void OutOfSync( int frame , int index)
|
||||||
{
|
{
|
||||||
var frameData = clientQuitTimes
|
var frameData = clientQuitTimes
|
||||||
|
|||||||
Reference in New Issue
Block a user