got it working on docker

fixed log closing exception
This commit is contained in:
z__
2022-02-03 17:03:49 +07:00
parent 8b862df6ea
commit 357e0446df
20 changed files with 202 additions and 333 deletions

View File

@@ -55,8 +55,10 @@ namespace Torch.Server
//Here to trigger rebuild
/// <inheritdoc />
public TorchServer(TorchConfig config) : base(config)
public TorchServer(ITorchConfig config, string instancePath, string instanceName) : base(config)
{
InstancePath = instancePath;
InstanceName = instanceName;
DedicatedInstance = new InstanceManager(this);
AddManager(DedicatedInstance);
if (config.EntityManagerEnabled)
@@ -116,7 +118,7 @@ namespace Torch.Server
public InstanceManager DedicatedInstance { get; }
/// <inheritdoc />
public string InstanceName => Config?.InstanceName;
public string InstanceName { get; }
/// <inheritdoc />
protected override uint SteamAppId => 244850;
@@ -130,7 +132,7 @@ namespace Torch.Server
public event Action<ITorchServer> Initialized;
/// <inheritdoc />
public string InstancePath => Config?.InstancePath;
public string InstancePath { get; }
public int OnlinePlayers { get => _players; private set => SetValue(ref _players, value); }
@@ -141,10 +143,10 @@ namespace Torch.Server
MySandboxGame.IsDedicated = true;
base.Init();
Managers.GetManager<ITorchSessionManager>().SessionStateChanged += OnSessionStateChanged;
GetManager<InstanceManager>().LoadInstance(Config.InstancePath);
GetManager<InstanceManager>().LoadInstance(InstancePath);
CanRun = true;
Initialized?.Invoke(this);
Log.Info($"Initialized server '{Config.InstanceName}' at '{Config.InstancePath}'");
Log.Info($"Initialized server '{InstanceName}' at '{InstancePath}'");
}
/// <inheritdoc />