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