xbox compat support
This commit is contained in:
@@ -9,6 +9,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Havok;
|
using Havok;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using Sandbox;
|
||||||
using Sandbox.Engine.Networking;
|
using Sandbox.Engine.Networking;
|
||||||
using Sandbox.Engine.Utils;
|
using Sandbox.Engine.Utils;
|
||||||
using Sandbox.Game;
|
using Sandbox.Game;
|
||||||
@@ -56,17 +57,19 @@ namespace Torch.Server.Managers
|
|||||||
//Initializes saves path. Why this isn't in Init() we may never know.
|
//Initializes saves path. Why this isn't in Init() we may never know.
|
||||||
MyFileSystem.InitUserSpecific(null);
|
MyFileSystem.InitUserSpecific(null);
|
||||||
|
|
||||||
var configPath = Path.Combine(path, CONFIG_NAME);
|
// why?....
|
||||||
if (!File.Exists(configPath))
|
// var configPath = Path.Combine(path, CONFIG_NAME);
|
||||||
{
|
// if (!File.Exists(configPath))
|
||||||
Log.Error($"Failed to load dedicated config at {path}");
|
// {
|
||||||
return;
|
// Log.Error($"Failed to load dedicated config at {path}");
|
||||||
}
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
var config = new MyConfigDedicated<MyObjectBuilder_SessionSettings>(configPath);
|
|
||||||
config.Load(configPath);
|
|
||||||
|
|
||||||
DedicatedConfig = new ConfigDedicatedViewModel(config);
|
// var config = new MyConfigDedicated<MyObjectBuilder_SessionSettings>(configPath);
|
||||||
|
// config.Load(configPath);
|
||||||
|
|
||||||
|
DedicatedConfig = new ConfigDedicatedViewModel((MyConfigDedicated<MyObjectBuilder_SessionSettings>) MySandboxGame.ConfigDedicated);
|
||||||
|
|
||||||
var worldFolders = Directory.EnumerateDirectories(Path.Combine(Torch.Config.InstancePath, "Saves"));
|
var worldFolders = Directory.EnumerateDirectories(Path.Combine(Torch.Config.InstancePath, "Saves"));
|
||||||
|
|
||||||
|
@@ -46,6 +46,7 @@ namespace Torch.Session
|
|||||||
public TorchSessionManager(ITorchBase torchInstance) : base(torchInstance)
|
public TorchSessionManager(ITorchBase torchInstance) : base(torchInstance)
|
||||||
{
|
{
|
||||||
_overrideMods = new Dictionary<ulong, MyObjectBuilder_Checkpoint.ModItem>();
|
_overrideMods = new Dictionary<ulong, MyObjectBuilder_Checkpoint.ModItem>();
|
||||||
|
if (Torch.Config.UgcServiceType == UGCServiceType.Steam)
|
||||||
_overrideMods.Add(TorchModCore.MOD_ID, ModItemUtils.Create(TorchModCore.MOD_ID));
|
_overrideMods.Add(TorchModCore.MOD_ID, ModItemUtils.Create(TorchModCore.MOD_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -160,6 +160,11 @@ namespace Torch
|
|||||||
MyFileSystem.Reset();
|
MyFileSystem.Reset();
|
||||||
MyInitializer.InvokeBeforeRun(_appSteamId, _appName, _userDataPath);
|
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()});
|
//Type.GetType("VRage.Steam.MySteamService, VRage.Steam").GetProperty("IsActive").GetSetMethod(true).Invoke(service, new object[] {SteamAPI.Init()});
|
||||||
_log.Info("Initializing network services");
|
_log.Info("Initializing network services");
|
||||||
|
|
||||||
@@ -192,7 +197,7 @@ namespace Torch
|
|||||||
MySandboxGame.ConfigDedicated.VerboseNetworkLogging,
|
MySandboxGame.ConfigDedicated.VerboseNetworkLogging,
|
||||||
Enumerable.Empty<string>(),
|
Enumerable.Empty<string>(),
|
||||||
aggregator,
|
aggregator,
|
||||||
Array.Empty<byte>());
|
MyMultiplayer.Channels);
|
||||||
|
|
||||||
var mockingInventory = new MyMockingInventory(service);
|
var mockingInventory = new MyMockingInventory(service);
|
||||||
MyServiceManager.Instance.AddService<IMyInventoryService>(mockingInventory);
|
MyServiceManager.Instance.AddService<IMyInventoryService>(mockingInventory);
|
||||||
|
Reference in New Issue
Block a user