Hotfix for save issues
This commit is contained in:
@@ -97,6 +97,8 @@ namespace Torch.Server.Managers
|
|||||||
if (!File.Exists(sandboxPath))
|
if (!File.Exists(sandboxPath))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
MyObjectBuilderSerializer.DeserializeXML(sandboxPath, out MyObjectBuilder_Checkpoint checkpoint, out ulong sizeInBytes);
|
MyObjectBuilderSerializer.DeserializeXML(sandboxPath, out MyObjectBuilder_Checkpoint checkpoint, out ulong sizeInBytes);
|
||||||
if (checkpoint == null)
|
if (checkpoint == null)
|
||||||
{
|
{
|
||||||
@@ -115,6 +117,12 @@ namespace Torch.Server.Managers
|
|||||||
if (!modsOnly)
|
if (!modsOnly)
|
||||||
DedicatedConfig.SessionSettings = new SessionSettingsViewModel(checkpoint.Settings);
|
DedicatedConfig.SessionSettings = new SessionSettingsViewModel(checkpoint.Settings);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.Error($"Error loading mod list from world '{DedicatedConfig.LoadWorld}'.");
|
||||||
|
Log.Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void SaveConfig()
|
public void SaveConfig()
|
||||||
{
|
{
|
||||||
|
@@ -67,6 +67,7 @@ namespace Torch.Server
|
|||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
Log.Info($"Init server '{Config.InstanceName}' at '{Config.InstancePath}'");
|
Log.Info($"Init server '{Config.InstanceName}' at '{Config.InstancePath}'");
|
||||||
|
MyObjectBuilderSerializer.RegisterFromAssembly(typeof(MyObjectBuilder_CheckpointSerializer).Assembly);
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
MyPerGameSettings.SendLogToKeen = false;
|
MyPerGameSettings.SendLogToKeen = false;
|
||||||
@@ -77,8 +78,6 @@ namespace Torch.Server
|
|||||||
MySessionComponentExtDebug.ForceDisable = true;
|
MySessionComponentExtDebug.ForceDisable = true;
|
||||||
MyPerServerSettings.AppId = 244850;
|
MyPerServerSettings.AppId = 244850;
|
||||||
MyFinalBuildConstants.APP_VERSION = MyPerGameSettings.BasicGameInfo.GameVersion;
|
MyFinalBuildConstants.APP_VERSION = MyPerGameSettings.BasicGameInfo.GameVersion;
|
||||||
|
|
||||||
MyObjectBuilderSerializer.RegisterFromAssembly(typeof(MyObjectBuilder_CheckpointSerializer).Assembly);
|
|
||||||
InvokeBeforeRun();
|
InvokeBeforeRun();
|
||||||
|
|
||||||
MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly);
|
MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly);
|
||||||
@@ -143,6 +142,8 @@ namespace Torch.Server
|
|||||||
VRage.Service.ExitListenerSTA.OnExit += delegate { MySandboxGame.Static?.Exit(); };
|
VRage.Service.ExitListenerSTA.OnExit += delegate { MySandboxGame.Static?.Exit(); };
|
||||||
|
|
||||||
base.Start();
|
base.Start();
|
||||||
|
//Stops RunInternal from calling MyFileSystem.InitUserSpecific(null), we call it in InstanceManager.
|
||||||
|
MySandboxGame.IsReloading = true;
|
||||||
runInternal.Invoke(null, null);
|
runInternal.Invoke(null, null);
|
||||||
|
|
||||||
MySandboxGame.Log.Close();
|
MySandboxGame.Log.Close();
|
||||||
|
Reference in New Issue
Block a user