From 40a06200c5ea8173ae3e67cd2171b747dd58d229 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Mon, 23 Oct 2017 22:08:31 -0400 Subject: [PATCH 1/3] Fixes installer not being marked as public --- TGServerService/ProjectInstaller.Designer.cs | 2 +- TGServerService/ProjectInstaller.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TGServerService/ProjectInstaller.Designer.cs b/TGServerService/ProjectInstaller.Designer.cs index 30e5f127e4..82180bdcf6 100644 --- a/TGServerService/ProjectInstaller.Designer.cs +++ b/TGServerService/ProjectInstaller.Designer.cs @@ -1,6 +1,6 @@ namespace TGServerService { - partial class ProjectInstaller + public partial class ProjectInstaller { /// /// Required designer variable. diff --git a/TGServerService/ProjectInstaller.cs b/TGServerService/ProjectInstaller.cs index 1852d1797b..12a82fa238 100644 --- a/TGServerService/ProjectInstaller.cs +++ b/TGServerService/ProjectInstaller.cs @@ -7,7 +7,7 @@ namespace TGServerService /// This tells the .msi there is a Windows in this that needs installation /// [RunInstaller(true)] - partial class ProjectInstaller : Installer + public partial class ProjectInstaller : Installer { /// /// Construct a From 215561eec8f71de28cc1c5f7ccff6a68dc1901fe Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 24 Oct 2017 11:17:18 -0400 Subject: [PATCH 2/3] Fixes stopping the server causing endless exceptions --- TGServerService/ServerInstance/DreamDaemon.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/TGServerService/ServerInstance/DreamDaemon.cs b/TGServerService/ServerInstance/DreamDaemon.cs index 36a4e9c703..9cb410bf83 100644 --- a/TGServerService/ServerInstance/DreamDaemon.cs +++ b/TGServerService/ServerInstance/DreamDaemon.cs @@ -344,14 +344,20 @@ namespace TGServerService { CurrentDDLog = String.Format("{0} {1} Diagnostics.txt", Now.ToLongDateString(), Now.ToLongTimeString()).Replace(':', '-'); WriteCurrentDDLog("Starting monitoring..."); - pcpu = new PerformanceCounter("Process", "% Processor Time", Proc.ProcessName, true); } + pcpu = new PerformanceCounter("Process", "% Processor Time", Proc.ProcessName, true); MemTrackTimer.Start(); - Proc.WaitForExit(); - lock (watchdogLock) //synchronize + try { - MemTrackTimer.Stop(); - pcpu.Dispose(); + Proc.WaitForExit(); + } + finally + { + lock (watchdogLock) //synchronize + { + MemTrackTimer.Stop(); + pcpu.Dispose(); + } } WriteCurrentDDLog("Crash detected!"); From a6a8fdf16e3aa25ce4dddc45e24cb64f53248721 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 24 Oct 2017 12:16:53 -0400 Subject: [PATCH 3/3] Improves API version handling --- TGServerService/ServerInstance/Interop.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/TGServerService/ServerInstance/Interop.cs b/TGServerService/ServerInstance/Interop.cs index ff0d428bca..62bd60b49c 100644 --- a/TGServerService/ServerInstance/Interop.cs +++ b/TGServerService/ServerInstance/Interop.cs @@ -21,8 +21,7 @@ namespace TGServerService string serviceCommsKey; //regenerated every DD restart //range of supported api versions - readonly Version MinAPIVersion = new Version("3.1.0.0"); - readonly Version MaxAPIVersion = new Version("3.1.0.99"); + const int AllowedMajorAPIVersion = 1; Version GameAPIVersion; //See code/modules/server_tools/server_tools.dm for command switch @@ -118,7 +117,7 @@ namespace TGServerService } catch { - Service.WriteWarning(String.Format("API version of the game ({0}) is incompatible with the current supported API versions (Min: {1}. Max: {2}). Interop disabled.", splits.Count > 1 ? splits[1] : "NULL", MinAPIVersion, MaxAPIVersion), EventID.APIVersionMismatch); + Service.WriteWarning(String.Format("API version of the game ({0}) is incompatible with the current supported API versions (3.{2}.x.x). Interop disabled.", splits.Count > 1 ? splits[1] : "NULL", AllowedMajorAPIVersion), EventID.APIVersionMismatch); GameAPIVersion = null; break; } @@ -154,7 +153,9 @@ namespace TGServerService //requires topiclock bool CheckAPIVersionConstraints() { - return !(GameAPIVersion == null || GameAPIVersion < MinAPIVersion || GameAPIVersion > MaxAPIVersion); + //major will never change for all of TGS3 + //we treat minor as major, build as minor, and revision as patch + return !(GameAPIVersion == null || GameAPIVersion.Minor != AllowedMajorAPIVersion); } //Fuckery to diddle byond with the right packet to accept our girth