From a1f397f9bfef8efdb10894580236d82e5e6baddd Mon Sep 17 00:00:00 2001 From: John Gross Date: Sat, 21 Dec 2019 12:22:29 -0800 Subject: [PATCH] Keep config disabled after stopping server --- Torch.Server/TorchServer.cs | 7 ++++--- Torch.Server/Views/TorchUI.xaml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Torch.Server/TorchServer.cs b/Torch.Server/TorchServer.cs index 5cd83ce..76cd9b8 100644 --- a/Torch.Server/TorchServer.cs +++ b/Torch.Server/TorchServer.cs @@ -39,6 +39,7 @@ namespace Torch.Server { public class TorchServer : TorchBase, ITorchServer { + private bool _hasRun; private bool _canRun; private TimeSpan _elapsedPlayTime; private bool _isRunning; @@ -63,8 +64,8 @@ namespace Torch.Server var sessionManager = Managers.GetManager(); sessionManager.AddFactory(x => new MultiplayerManagerDedicated(this)); } - - public bool HasRun { get; private set; } + + public bool HasRun { get => _hasRun; set => SetValue(ref _hasRun, value); } /// public float SimulationRatio { get => _simRatio; set => SetValue(ref _simRatio, value); } @@ -129,6 +130,7 @@ namespace Torch.Server State = ServerState.Starting; IsRunning = true; + HasRun = true; CanRun = false; Log.Info("Starting server."); MySandboxGame.ConfigDedicated = DedicatedInstance.DedicatedConfig.Model; @@ -144,7 +146,6 @@ namespace Torch.Server Log.Error("Server is already stopped"); Log.Info("Stopping server."); base.Stop(); - HasRun = true; Log.Info("Server stopped."); State = ServerState.Stopped; diff --git a/Torch.Server/Views/TorchUI.xaml b/Torch.Server/Views/TorchUI.xaml index 5c7e34f..6a402d0 100644 --- a/Torch.Server/Views/TorchUI.xaml +++ b/Torch.Server/Views/TorchUI.xaml @@ -66,7 +66,7 @@ - +