void GenerateSyncReport(Report report) { report.Frame = orderManager.NetFrameNumber; report.SyncedRandom = orderManager.world.SharedRandom.Last; report.TotalCount = orderManager.world.SharedRandom.TotalCount; report.Traits.Clear(); foreach (var a in orderManager.world.ActorsWithTrait <ISync>()) { var sync = Sync.CalculateSyncHash(a.Trait); if (sync != 0) { var tr = new TraitReport() { ActorID = a.Actor.ActorID, Type = a.Actor.Info.Name, Owner = (a.Actor.Owner == null) ? "null" : a.Actor.Owner.PlayerName, Trait = a.Trait.GetType().Name, Hash = sync }; tr.Fields = DumpSyncTrait(a.Trait); report.Traits.Add(tr); } } }
void GenerateSyncReport(Report report) { report.Frame = orderManager.NetFrameNumber; report.SyncedRandom = orderManager.world.SharedRandom.Last; report.TotalCount = orderManager.world.SharedRandom.TotalCount; report.Traits.Clear(); foreach (var a in orderManager.world.ActorsWithTrait <ISync>()) { var sync = Sync.CalculateSyncHash(a.Trait); if (sync != 0) { report.Traits.Add(new TraitReport() { ActorID = a.Actor.ActorID, Type = a.Actor.Info.Name, Owner = (a.Actor.Owner == null) ? "null" : a.Actor.Owner.PlayerName, Trait = a.Trait.GetType().Name, Hash = sync, NamesValues = DumpSyncTrait(a.Trait) }); } } foreach (var e in orderManager.world.Effects) { var sync = e as ISync; if (sync != null) { var hash = Sync.CalculateSyncHash(sync); if (hash != 0) { report.Effects.Add(new EffectReport() { Name = sync.ToString().Split('.').Last(), Hash = hash, NamesValues = DumpSyncTrait(sync) }); } } } }