From 2dbc57bb14d51b5b407ce8dfb570143417e56034 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Wed, 9 Nov 2022 14:35:33 -0800 Subject: [PATCH] do DeterministicManager things on world objects added instead of ready --- QSB/Utility/DeterministicManager.cs | 6 +++--- QSB/WorldSync/QSBWorldSync.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/QSB/Utility/DeterministicManager.cs b/QSB/Utility/DeterministicManager.cs index c1982a1d..05bf5d2b 100644 --- a/QSB/Utility/DeterministicManager.cs +++ b/QSB/Utility/DeterministicManager.cs @@ -31,7 +31,7 @@ public static class DeterministicManager } }; - public static void OnWorldObjectsReady() + public static void OnWorldObjectsAdded() { if (QSBCore.DebugSettings.DumpWorldObjects) { @@ -267,7 +267,7 @@ public static class DeterministicManager } /// - /// only call this before world objects ready + /// only call this before world objects added /// public static string DeterministicPath(this Component component) { @@ -298,7 +298,7 @@ public static class DeterministicManager } /// - /// only call this before world objects ready + /// only call this before world objects added /// public static IEnumerable SortDeterministic(this IEnumerable components) where T : Component => components.OrderBy(DeterministicPath); diff --git a/QSB/WorldSync/QSBWorldSync.cs b/QSB/WorldSync/QSBWorldSync.cs index 198bfbca..c57d6eeb 100644 --- a/QSB/WorldSync/QSBWorldSync.cs +++ b/QSB/WorldSync/QSBWorldSync.cs @@ -83,6 +83,8 @@ public static class QSBWorldSync AllObjectsAdded = true; DebugLog.DebugWrite("World Objects added.", MessageType.Success); + DeterministicManager.OnWorldObjectsAdded(); + WorldObjectsHash = WorldObjects.Select(x => x.GetType().Name).GetMD5Hash(); DebugLog.DebugWrite($"WorldObject hash is {WorldObjectsHash}"); @@ -101,8 +103,6 @@ public static class QSBWorldSync AllObjectsReady = true; DebugLog.DebugWrite("World Objects ready.", MessageType.Success); - DeterministicManager.OnWorldObjectsReady(); - if (!QSBCore.IsHost) { new RequestInitialStatesMessage().Send();