From 39d0c1fd6b839fcdb458a9fdaea5513b5a3d4d8a Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 28 Jun 2017 15:06:22 -0400 Subject: [PATCH] Fixes service updates not restoring the comms key --- TGServerService/App.config | 3 +++ TGServerService/DreamDaemon.cs | 2 ++ TGServerService/Properties/Settings.Designer.cs | 12 ++++++++++++ TGServerService/Properties/Settings.settings | 3 +++ 4 files changed, 20 insertions(+) diff --git a/TGServerService/App.config b/TGServerService/App.config index 4fb3840dc5..15f281ab77 100644 --- a/TGServerService/App.config +++ b/TGServerService/App.config @@ -61,6 +61,9 @@ 0 + + + diff --git a/TGServerService/DreamDaemon.cs b/TGServerService/DreamDaemon.cs index 47bbd4a645..28db4dd5ce 100644 --- a/TGServerService/DreamDaemon.cs +++ b/TGServerService/DreamDaemon.cs @@ -53,6 +53,7 @@ namespace TGServerService RestartInProgress = true; currentPort = Properties.Settings.Default.ReattachPort; + serviceCommsKey = Properties.Settings.Default.ReattachCommsKey; currentStatus = TGDreamDaemonStatus.Online; DDWatchdog = new Thread(new ThreadStart(Watchdog)); DDWatchdog.Start(); @@ -270,6 +271,7 @@ namespace TGServerService { Properties.Settings.Default.ReattachPID = Proc.Id; Properties.Settings.Default.ReattachPort = currentPort; + Properties.Settings.Default.ReattachCommsKey = serviceCommsKey; RestartInProgress = true; } Proc.Close(); diff --git a/TGServerService/Properties/Settings.Designer.cs b/TGServerService/Properties/Settings.Designer.cs index cd14ea9f18..98907f5fa1 100644 --- a/TGServerService/Properties/Settings.Designer.cs +++ b/TGServerService/Properties/Settings.Designer.cs @@ -226,5 +226,17 @@ namespace TGServerService.Properties { this["SettingsVersion"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ReattachCommsKey { + get { + return ((string)(this["ReattachCommsKey"])); + } + set { + this["ReattachCommsKey"] = value; + } + } } } diff --git a/TGServerService/Properties/Settings.settings b/TGServerService/Properties/Settings.settings index 2500ddda3c..f31d1de817 100644 --- a/TGServerService/Properties/Settings.settings +++ b/TGServerService/Properties/Settings.settings @@ -53,5 +53,8 @@ 0 + + + \ No newline at end of file