diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 6aaef64..94e8e28 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.1")] -[assembly: AssemblyFileVersion("1.3.0.1")] +[assembly: AssemblyVersion("1.3.0.3")] +[assembly: AssemblyFileVersion("1.3.0.3")] [assembly: NeutralResourcesLanguage("en")] diff --git a/SeamlessClient.cs b/SeamlessClient.cs index f49840d..0a0dbfb 100644 --- a/SeamlessClient.cs +++ b/SeamlessClient.cs @@ -106,7 +106,7 @@ namespace SeamlessClientPlugin - public static string Version = "1.3.01"; + public static string Version = "1.3.03"; public static bool Debug = false; private static bool Initilized = false; @@ -139,6 +139,9 @@ namespace SeamlessClientPlugin TryShow("Initilizing Communications!"); RunInitilizations(); } + + + //OnNewPlayerRequest //throw new NotImplementedException(); } @@ -152,6 +155,8 @@ namespace SeamlessClientPlugin // Terrible way to make sure server knows we are running seamless client try { + + ClientMessage PingServer = new ClientMessage(ClientMessageType.FirstJoin); MyAPIGateway.Multiplayer?.SendMessageToServer(SeamlessClientNetID, Utilities.Utility.Serialize(PingServer)); } diff --git a/SeamlessTransfer/SwitchServers.cs b/SeamlessTransfer/SwitchServers.cs index 7cd7a56..d616365 100644 --- a/SeamlessTransfer/SwitchServers.cs +++ b/SeamlessTransfer/SwitchServers.cs @@ -6,6 +6,7 @@ using Sandbox.Game.Entities; using Sandbox.Game.Gui; using Sandbox.Game.GUI; using Sandbox.Game.Multiplayer; +using Sandbox.Game.SessionComponents; using Sandbox.Game.World; using Sandbox.Game.World.Generator; using Sandbox.ModAPI; @@ -34,6 +35,8 @@ namespace SeamlessClientPlugin.SeamlessTransfer public MyGameServerItem TargetServer { get; } public MyObjectBuilder_World TargetWorld { get; } + private string OldArmorSkin { get; set; } = string.Empty; + public SwitchServers(MyGameServerItem TargetServer, MyObjectBuilder_World TargetWorld) { @@ -44,6 +47,8 @@ namespace SeamlessClientPlugin.SeamlessTransfer public void BeginSwitch() { + OldArmorSkin = MySession.Static.LocalHumanPlayer.BuildArmorSkin; + MySandboxGame.Static.Invoke(delegate { //Set camera controller to fixed spectator @@ -74,6 +79,8 @@ namespace SeamlessClientPlugin.SeamlessTransfer MyMultiplayer.Static = Utility.CastToReflected(instance, Patches.ClientType); MyMultiplayer.Static.ExperimentalMode = true; + + // Set the new SyncLayer to the MySession.Static.SyncLayer Patches.MySessionLayer.SetValue(MySession.Static, MyMultiplayer.Static.SyncLayer); @@ -122,6 +129,10 @@ namespace SeamlessClientPlugin.SeamlessTransfer MyModAPIHelper.Initialize(); // Allow the game to start proccessing incoming messages in the buffer MyMultiplayer.Static.StartProcessingClientMessages(); + + //Recreate all controls... Will fix weird gui/paint/crap + MyGuiScreenHudSpace.Static.RecreateControls(true); + //MySession.Static.LocalHumanPlayer.BuildArmorSkin = OldArmorSkin; } @@ -277,7 +288,7 @@ namespace SeamlessClientPlugin.SeamlessTransfer private void LoadConnectedClients() { - + Patches.LoadMembersFromWorld.Invoke(MySession.Static, new object[] { TargetWorld, MyMultiplayer.Static }); @@ -320,10 +331,6 @@ namespace SeamlessClientPlugin.SeamlessTransfer SeamlessClient.TryShow("OnlinePlayers: " + MySession.Static.Players.GetOnlinePlayers().Count); SeamlessClient.TryShow("Loading Complete!"); - - - //Recreate all controls... Will fix weird gui/paint/crap - MyGuiScreenHudSpace.Static.RecreateControls(true); } private void MyMultiplayer_PendingReplicablesDone() @@ -378,6 +385,9 @@ namespace SeamlessClientPlugin.SeamlessTransfer if (MyMultiplayer.Static == null) throw new Exception("MyMultiplayer.Static is null on unloading? dafuq?"); + //Try and close the quest log + MySessionComponentIngameHelp component = MySession.Static.GetComponent(); + component?.TryCancelObjective(); //Clear all old players and clients. Sync.Clients.Clear();