From 40859b4fbeefecdb687ebb34272722121e6953e9 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 1 Nov 2017 16:46:08 -0400 Subject: [PATCH] Fixes offlining an instance not changing the config --- TGServerService/ServerInstance/ServerInstance.cs | 7 +++++++ TGServerService/Service.cs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/TGServerService/ServerInstance/ServerInstance.cs b/TGServerService/ServerInstance/ServerInstance.cs index 8b23b62b8d..e11f6b8459 100644 --- a/TGServerService/ServerInstance/ServerInstance.cs +++ b/TGServerService/ServerInstance/ServerInstance.cs @@ -126,6 +126,13 @@ namespace TGServerService return Config.Directory; } + /// + /// Sets of to + /// + public void Offline() + { + Config.Enabled = false; + } //mostly generated code with a call to RunDisposals() //you don't need to open this diff --git a/TGServerService/Service.cs b/TGServerService/Service.cs index 6d6da959a6..06e85b7523 100644 --- a/TGServerService/Service.cs +++ b/TGServerService/Service.cs @@ -593,6 +593,7 @@ namespace TGServerService if (ic.Name == Name) { path = ic.Directory; + ic.Enabled = true; return SetupOneInstance(ic); } } @@ -612,6 +613,7 @@ namespace TGServerService var inst = (ServerInstance)host.SingletonInstance; host.Close(); path = inst.ServerDirectory(); + inst.Offline(); inst.Dispose(); return null; }