Revert "QSBMessageManager: init after addons"

This reverts commit 74945dbeb4.
This commit is contained in:
JohnCorby 2023-09-24 14:28:18 -07:00
parent 74945dbeb4
commit d58195da63
3 changed files with 3 additions and 7 deletions

View File

@ -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>((_, wrapper) => OnServerReceive(wrapper));
NetworkClient.RegisterHandler<Wrapper>(wrapper => OnClientReceive(wrapper));

View File

@ -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,
"<color=orange>Quantum Space Buddies</color> 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<IMenuAPI>(ModHelper.Manifest.Dependencies[0]);

View File

@ -291,7 +291,7 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
OnClientConnected?.SafeInvoke();
QSBMessageManager.InitHandlers();
QSBMessageManager.Init();
gameObject.AddComponent<RespawnOnDeath>();
gameObject.AddComponent<ServerStateManager>();