Move SetupBasicGameInfo to initializer so it can be called before ui thread init

This commit is contained in:
2023-06-27 15:51:12 -04:00
parent e9a9e180a8
commit ed694ae95b
2 changed files with 3 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ using Microsoft.Extensions.Configuration;
using NLog; using NLog;
using NLog.Targets; using NLog.Targets;
using Sandbox.Engine.Utils; using Sandbox.Engine.Utils;
using SpaceEngineers.Game;
using Torch.Utils; using Torch.Utils;
using VRage.FileSystem; using VRage.FileSystem;
@@ -103,7 +104,8 @@ namespace Torch.Server
} }
#endif #endif
SpaceEngineersGame.SetupBasicGameInfo();
SpaceEngineersGame.SetupPerGameSettings();
var uiThread = new Thread(() => var uiThread = new Thread(() =>
{ {
var ui = new TorchUI(_server); var ui = new TorchUI(_server);

View File

@@ -10,7 +10,6 @@ using Sandbox;
using Sandbox.Game; using Sandbox.Game;
using Sandbox.Game.Multiplayer; using Sandbox.Game.Multiplayer;
using Sandbox.Game.Screens.Helpers; using Sandbox.Game.Screens.Helpers;
using SpaceEngineers.Game;
using Torch.API; using Torch.API;
using Torch.API.Managers; using Torch.API.Managers;
using Torch.API.ModAPI; using Torch.API.ModAPI;
@@ -248,8 +247,6 @@ namespace Torch
public virtual void Init() public virtual void Init()
{ {
Debug.Assert(!_init, "Torch instance is already initialized."); Debug.Assert(!_init, "Torch instance is already initialized.");
SpaceEngineersGame.SetupBasicGameInfo();
SpaceEngineersGame.SetupPerGameSettings();
VRageGame.SetupVersionInfo(); VRageGame.SetupVersionInfo();
Debug.Assert(MyPerGameSettings.BasicGameInfo.GameVersion != null, "MyPerGameSettings.BasicGameInfo.GameVersion != null"); Debug.Assert(MyPerGameSettings.BasicGameInfo.GameVersion != null, "MyPerGameSettings.BasicGameInfo.GameVersion != null");