extract replay saving from OrderManager

This commit is contained in:
Bob
2010-10-10 20:32:39 +13:00
parent 07023b6c35
commit 915ad7fb7b
6 changed files with 121 additions and 98 deletions

View File

@@ -140,6 +140,7 @@ namespace OpenRA
public static T CheckSyncUnchanged<T>( World world, Func<T> fn )
{
int sync = world.SyncHash();
bool prevInUnsyncedCode = inUnsyncedCode;
inUnsyncedCode = true;
try
{
@@ -147,9 +148,9 @@ namespace OpenRA
}
finally
{
inUnsyncedCode = false;
inUnsyncedCode = prevInUnsyncedCode;
if( sync != world.SyncHash() )
throw new InvalidOperationException( "Desync in DispatchMouseInput" );
throw new InvalidOperationException( "CheckSyncUnchanged: sync-changing code may not run here" );
}
}