From d58195da63c07425982dba7584c94198106609d7 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sun, 24 Sep 2023 14:28:18 -0700 Subject: [PATCH] Revert "QSBMessageManager: init after addons" This reverts commit 74945dbeb4aa14e8b099b6fd36487c3809875fb2. --- QSB/Messaging/QSBMessageManager.cs | 4 ++-- QSB/QSBCore.cs | 4 ---- QSB/QSBNetworkManager.cs | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/QSB/Messaging/QSBMessageManager.cs b/QSB/Messaging/QSBMessageManager.cs index 1dfca500..c4be56f9 100644 --- a/QSB/Messaging/QSBMessageManager.cs +++ b/QSB/Messaging/QSBMessageManager.cs @@ -33,7 +33,7 @@ public static class QSBMessageManager private static string _rxPath; private static string _txPath; - public static void InitTypes() + static QSBMessageManager() { foreach (var type in typeof(QSBMessage).GetDerivedTypes()) { @@ -44,7 +44,7 @@ public static class QSBMessageManager } } - public static void InitHandlers() + public static void Init() { NetworkServer.RegisterHandler((_, wrapper) => OnServerReceive(wrapper)); NetworkClient.RegisterHandler(wrapper => OnClientReceive(wrapper)); diff --git a/QSB/QSBCore.cs b/QSB/QSBCore.cs index 51171a23..988d60b4 100644 --- a/QSB/QSBCore.cs +++ b/QSB/QSBCore.cs @@ -122,8 +122,6 @@ public class QSBCore : ModBehaviour public void Awake() { - // TODO: try manually loading steam dll for xbox. need to move all the steam stuff to new method or else it tries to load it first :( - // no, we cant localize this - languages are loaded after the splash screen UIHelper.ReplaceUI(UITextType.PleaseUseController, "Quantum Space Buddies is best experienced with friends..."); @@ -253,8 +251,6 @@ public class QSBCore : ModBehaviour // init again to get addon patches QSBPatchManager.Init(); - // have to register message after addons get added dummy - QSBMessageManager.InitTypes(); MenuApi = ModHelper.Interaction.TryGetModApi(ModHelper.Manifest.Dependencies[0]); diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index 881be16b..60255e0e 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -291,7 +291,7 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart OnClientConnected?.SafeInvoke(); - QSBMessageManager.InitHandlers(); + QSBMessageManager.Init(); gameObject.AddComponent(); gameObject.AddComponent();