diff --git a/Torch.Server/Managers/InstanceManager.cs b/Torch.Server/Managers/InstanceManager.cs index 6d71931..706b81f 100644 --- a/Torch.Server/Managers/InstanceManager.cs +++ b/Torch.Server/Managers/InstanceManager.cs @@ -9,6 +9,7 @@ using System.Text; using System.Threading.Tasks; using Havok; using NLog; +using Sandbox; using Sandbox.Engine.Networking; using Sandbox.Engine.Utils; using Sandbox.Game; @@ -56,17 +57,19 @@ namespace Torch.Server.Managers //Initializes saves path. Why this isn't in Init() we may never know. MyFileSystem.InitUserSpecific(null); - var configPath = Path.Combine(path, CONFIG_NAME); - if (!File.Exists(configPath)) - { - Log.Error($"Failed to load dedicated config at {path}"); - return; - } + // why?.... + // var configPath = Path.Combine(path, CONFIG_NAME); + // if (!File.Exists(configPath)) + // { + // Log.Error($"Failed to load dedicated config at {path}"); + // return; + // } - var config = new MyConfigDedicated(configPath); - config.Load(configPath); + + // var config = new MyConfigDedicated(configPath); + // config.Load(configPath); - DedicatedConfig = new ConfigDedicatedViewModel(config); + DedicatedConfig = new ConfigDedicatedViewModel((MyConfigDedicated) MySandboxGame.ConfigDedicated); var worldFolders = Directory.EnumerateDirectories(Path.Combine(Torch.Config.InstancePath, "Saves")); diff --git a/Torch/Session/TorchSessionManager.cs b/Torch/Session/TorchSessionManager.cs index de52707..05b415a 100644 --- a/Torch/Session/TorchSessionManager.cs +++ b/Torch/Session/TorchSessionManager.cs @@ -46,7 +46,8 @@ namespace Torch.Session public TorchSessionManager(ITorchBase torchInstance) : base(torchInstance) { _overrideMods = new Dictionary(); - _overrideMods.Add(TorchModCore.MOD_ID, ModItemUtils.Create(TorchModCore.MOD_ID)); + if (Torch.Config.UgcServiceType == UGCServiceType.Steam) + _overrideMods.Add(TorchModCore.MOD_ID, ModItemUtils.Create(TorchModCore.MOD_ID)); } /// diff --git a/Torch/VRageGame.cs b/Torch/VRageGame.cs index c5a1d53..73c32ae 100644 --- a/Torch/VRageGame.cs +++ b/Torch/VRageGame.cs @@ -159,6 +159,11 @@ namespace Torch MyFileSystem.Reset(); MyInitializer.InvokeBeforeRun(_appSteamId, _appName, _userDataPath); + + _log.Info("Loading Dedicated Config"); + // object created in SpaceEngineersGame.SetupPerGameSettings() + MySandboxGame.ConfigDedicated.Load(); + MyPlatformGameSettings.CONSOLE_COMPATIBLE = MySandboxGame.ConfigDedicated.ConsoleCompatibility; //Type.GetType("VRage.Steam.MySteamService, VRage.Steam").GetProperty("IsActive").GetSetMethod(true).Invoke(service, new object[] {SteamAPI.Init()}); _log.Info("Initializing network services"); @@ -192,7 +197,7 @@ namespace Torch MySandboxGame.ConfigDedicated.VerboseNetworkLogging, Enumerable.Empty(), aggregator, - Array.Empty()); + MyMultiplayer.Channels); var mockingInventory = new MyMockingInventory(service); MyServiceManager.Instance.AddService(mockingInventory);