basic Sync checking. No protocol stuff yet; just checks that input events are well-behaved.
This commit is contained in:
@@ -12,15 +12,15 @@ namespace OpenRa.Game
|
||||
|
||||
public void Add(Actor a)
|
||||
{
|
||||
a.IsInWorld = true;
|
||||
actors.Add(a);
|
||||
a.IsInWorld = true;
|
||||
actors.Add(a);
|
||||
ActorAdded(a);
|
||||
}
|
||||
|
||||
public void Remove(Actor a)
|
||||
{
|
||||
a.IsInWorld = false;
|
||||
actors.Remove(a);
|
||||
a.IsInWorld = false;
|
||||
actors.Remove(a);
|
||||
ActorRemoved(a);
|
||||
}
|
||||
|
||||
@@ -52,5 +52,14 @@ namespace OpenRa.Game
|
||||
{
|
||||
return nextAID++;
|
||||
}
|
||||
|
||||
public int SyncHash()
|
||||
{
|
||||
int ret = 0;
|
||||
foreach( var a in Actors )
|
||||
ret += (int)a.ActorID * Sync.CalculateSyncHash( a );
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user