diff --git a/SeamlessClient.cs b/SeamlessClient.cs index 6a5b996..92b62ec 100644 --- a/SeamlessClient.cs +++ b/SeamlessClient.cs @@ -108,7 +108,7 @@ namespace SeamlessClientPlugin public static string Version = "1.3.04"; - public static bool Debug = false; + public static bool Debug = true; private static bool Initilized = false; diff --git a/SeamlessTransfer/ModLoader.cs b/SeamlessTransfer/ModLoader.cs index 4c98be7..8724b6d 100644 --- a/SeamlessTransfer/ModLoader.cs +++ b/SeamlessTransfer/ModLoader.cs @@ -91,11 +91,12 @@ namespace SeamlessClientPlugin.SeamlessTransfer if (!DownloadSuccess) return; + /* MySession.Static.ScriptManager.LoadData(); MyDefinitionManager.Static.LoadData(TargetServerMods); MyLocalCache.PreloadLocalInventoryConfig(); SeamlessClient.TryShow("Finished transfering!"); - + */ } diff --git a/SeamlessTransfer/SwitchServers.cs b/SeamlessTransfer/SwitchServers.cs index 592c47b..c170e9b 100644 --- a/SeamlessTransfer/SwitchServers.cs +++ b/SeamlessTransfer/SwitchServers.cs @@ -10,8 +10,10 @@ using Sandbox.Game.Multiplayer; using Sandbox.Game.SessionComponents; using Sandbox.Game.World; using Sandbox.Game.World.Generator; +using Sandbox.Graphics.GUI; using Sandbox.ModAPI; using SeamlessClientPlugin.Utilities; +using SpaceEngineers.Game.GUI; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -134,11 +136,11 @@ namespace SeamlessClientPlugin.SeamlessTransfer string text = ((!string.IsNullOrEmpty(TargetWorld.Checkpoint.CustomSkybox)) ? TargetWorld.Checkpoint.CustomSkybox : MySector.EnvironmentDefinition.EnvironmentTexture); MyRenderProxy.PreloadTextures(new string[1] { text }, TextureType.CubeMap); MySession.Static.LoadDataComponents(); - MySession.Static.LoadObjectBuildersComponents(TargetWorld.Checkpoint.SessionComponents); + // MySession.Static.LoadObjectBuildersComponents(TargetWorld.Checkpoint.SessionComponents); - MethodInfo A = typeof(MySession).GetMethod("LoadGameDefinition", BindingFlags.Instance | BindingFlags.NonPublic); - A.Invoke(MySession.Static, new object[] { TargetWorld.Checkpoint }); + //MethodInfo A = typeof(MySession).GetMethod("LoadGameDefinition", BindingFlags.Instance | BindingFlags.NonPublic); + // A.Invoke(MySession.Static, new object[] { TargetWorld.Checkpoint }); @@ -426,6 +428,10 @@ namespace SeamlessClientPlugin.SeamlessTransfer MyMultiplayer.Static.ReplicationLayer.Dispose(); MyMultiplayer.Static.Dispose(); MyMultiplayer.Static = null; + + //Close any respawn screens that are open + MyGuiScreenMedicals.Close(); + } private void RemoveOldEntities() diff --git a/Utilities/Patches.cs b/Utilities/Patches.cs index 23a4eb1..bde0e47 100644 --- a/Utilities/Patches.cs +++ b/Utilities/Patches.cs @@ -121,13 +121,16 @@ namespace SeamlessClientPlugin.SeamlessTransfer MethodInfo LoadingScreenDraw = GetMethod(typeof(MyGuiScreenLoading), "DrawInternal", BindingFlags.Instance | BindingFlags.NonPublic); - + Patcher.Patch(LoadingScreenDraw, prefix: new HarmonyMethod(GetPatchMethod(nameof(DrawInternal)))); Patcher.Patch(OnJoin, postfix: new HarmonyMethod(GetPatchMethod(nameof(OnUserJoined)))); Patcher.Patch(LoadingAction, prefix: new HarmonyMethod(GetPatchMethod(nameof(LoadMultiplayerSession)))); + + + } @@ -152,8 +155,8 @@ namespace SeamlessClientPlugin.SeamlessTransfer private static bool LoadMultiplayerSession(MyObjectBuilder_World world, MyMultiplayerBase multiplayerSession) { - if (SeamlessClient.IsSwitching) - return true; + // + MyLog.Default.WriteLine("LoadSession() - Start"); @@ -164,6 +167,9 @@ namespace SeamlessClientPlugin.SeamlessTransfer return false; } + MyLog.Default.WriteLine("Seamless Downloading mods!"); + + MyWorkshop.DownloadModsAsync(world.Checkpoint.Mods, delegate (bool success) {