From 26a5f1ba074aeaba17b3affb060b860bcd9f6295 Mon Sep 17 00:00:00 2001 From: Garrett <52760019+Casimir255@users.noreply.github.com> Date: Sun, 14 Jul 2024 21:31:44 -0500 Subject: [PATCH] Possible fix for Dynamic session settings --- Components/ServerSwitcherComponentOLD.cs | 6 ++++-- Messages/WorldRequestData.cs | 1 - Seamless.cs | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Components/ServerSwitcherComponentOLD.cs b/Components/ServerSwitcherComponentOLD.cs index 2b9f664..a39b100 100644 --- a/Components/ServerSwitcherComponentOLD.cs +++ b/Components/ServerSwitcherComponentOLD.cs @@ -186,7 +186,7 @@ namespace SeamlessClient.Components MyMultiplayer.Static.StartProcessingClientMessages(); //Recreate all controls... Will fix weird gui/paint/crap - MyGuiScreenHudSpace.Static.RecreateControls(true); + MyGuiScreenHudSpace.Static?.RecreateControls(true); //MySession.Static.LocalHumanPlayer.BuildArmorSkin = OldArmorSkin; } @@ -272,6 +272,8 @@ namespace SeamlessClient.Components MySession.Static.CustomLoadingScreenImage = TargetWorld.Checkpoint.CustomLoadingScreenImage; MySession.Static.CustomLoadingScreenText = TargetWorld.Checkpoint.CustomLoadingScreenText; MySession.Static.CustomSkybox = TargetWorld.Checkpoint.CustomSkybox; + MyAPIUtilities.Static.Variables = TargetWorld.Checkpoint.ScriptManagerData.variables.Dictionary; + try { @@ -281,7 +283,7 @@ namespace SeamlessClient.Components } catch (Exception ex) { - Seamless.TryShow($"An error occured while loading GPS points! You will have an empty gps list! \n {ex.ToString()}"); + Seamless.TryShow($"An error occurred while loading GPS points! You will have an empty gps list! \n {ex.ToString()}"); } diff --git a/Messages/WorldRequestData.cs b/Messages/WorldRequestData.cs index 678b2ac..18ade84 100644 --- a/Messages/WorldRequestData.cs +++ b/Messages/WorldRequestData.cs @@ -56,7 +56,6 @@ namespace SeamlessClient.Messages MyObjectBuilderSerializerKeen.SerializeXML(memoryStream, WorldData, MyObjectBuilderSerializerKeen.XmlCompression.Gzip); this.WorldData = memoryStream.ToArray(); - Log.Warn("Successfully Converted World"); } } diff --git a/Seamless.cs b/Seamless.cs index 72867e3..ebf8184 100644 --- a/Seamless.cs +++ b/Seamless.cs @@ -34,10 +34,10 @@ namespace SeamlessClient private List allComps = new List(); private Assembly thisAssembly => typeof(Seamless).Assembly; - private bool Initilized = false; + private bool Initialized = false; public static bool isSeamlessServer { get; private set; } = false; public static bool isDebug = false; - public static bool UseNewVersion = true; + public static bool UseNewVersion = false; @@ -95,14 +95,14 @@ namespace SeamlessClient } } - private void InitilizeComponents() + private void InitializeComponents() { foreach(ComponentBase component in allComps) { try { component.Initilized(); - TryShow($"Initilized {component.GetType()}"); + TryShow($"Initialized {component.GetType()}"); }catch(Exception ex) { @@ -169,12 +169,12 @@ namespace SeamlessClient return; } - if (!Initilized) + if (!Initialized) { MyAPIGateway.Multiplayer.RegisterSecureMessageHandler(SeamlessClientNetId, MessageHandler); - InitilizeComponents(); + InitializeComponents(); - Initilized = true; + Initialized = true; } IMyGameServer server = MyServiceManager.Instance.GetService();