diff --git a/src/ARKServerManager/Lib/ServerApp.cs b/src/ARKServerManager/Lib/ServerApp.cs index 594cc7c2..b8b6cbb3 100644 --- a/src/ARKServerManager/Lib/ServerApp.cs +++ b/src/ARKServerManager/Lib/ServerApp.cs @@ -256,6 +256,8 @@ namespace ServerManagerTool.Lib return; } + ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped); + // make a backup of the current profile and config files. CreateProfileBackupArchiveFile(_profile); @@ -408,6 +410,7 @@ namespace ServerManagerTool.Lib } _serverRunning = true; + ServerStatusChangeCallback?.Invoke(ServerStatus.Stopping); LogProfileMessage($"Server process found PID {process.Id}."); QueryMaster.Server gameServer = null; @@ -1207,6 +1210,8 @@ namespace ServerManagerTool.Lib if (ExitCode != EXITCODE_NORMALEXIT) return; + ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped); + emailMessage.AppendLine("Update Summary:"); emailMessage.AppendLine(); emailMessage.AppendLine($"Server Manager version: {App.Instance.Version}"); @@ -2542,7 +2547,7 @@ namespace ServerManagerTool.Lib _loggerBranch?.Info(message); if (includeProgressCallback) - ProgressCallback?.Invoke(0, $"[INFO] {message}"); + ProgressCallback?.Invoke(0, $"{message}"); Debug.WriteLine($"[INFO] (Branch {GetBranchName(branchName) ?? "unknown"}) {message}"); } @@ -2567,7 +2572,7 @@ namespace ServerManagerTool.Lib _loggerProfile?.Info(message); if (includeProgressCallback) - ProgressCallback?.Invoke(0, $"[INFO] {message}"); + ProgressCallback?.Invoke(0, $"{message}"); Debug.WriteLine($"[INFO] (Profile {_profile?.ProfileName ?? "unknown"}) {message}"); } @@ -2816,6 +2821,8 @@ namespace ServerManagerTool.Lib } } + ServerStatusChangeCallback?.Invoke(ServerStatus.Unknown); + LogProfileMessage(""); LogProfileMessage($"Exitcode = {ExitCode}"); return ExitCode; @@ -2913,6 +2920,8 @@ namespace ServerManagerTool.Lib } } + ServerStatusChangeCallback?.Invoke(ServerStatus.Unknown); + LogProfileMessage(""); LogProfileMessage($"Exitcode = {ExitCode}"); return ExitCode; @@ -2993,6 +3002,8 @@ namespace ServerManagerTool.Lib } } + ServerStatusChangeCallback?.Invoke(ServerStatus.Unknown); + LogProfileMessage(""); LogProfileMessage($"Exitcode = {ExitCode}"); return ExitCode; diff --git a/src/ARKServerManager/Lib/ServerRuntime.cs b/src/ARKServerManager/Lib/ServerRuntime.cs index 6988b0e8..a124b216 100644 --- a/src/ARKServerManager/Lib/ServerRuntime.cs +++ b/src/ARKServerManager/Lib/ServerRuntime.cs @@ -275,20 +275,32 @@ namespace ServerManagerTool.Lib case WatcherServerStatus.RunningLocalCheck: if (oldStatus != ServerStatus.Stopping) + { UpdateServerStatus(ServerStatus.Running, this.Availability != AvailabilityStatus.Available ? AvailabilityStatus.Waiting : this.Availability, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown); - if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + } + else + if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Stop(); break; case WatcherServerStatus.RunningExternalCheck: if (oldStatus != ServerStatus.Stopping) + { UpdateServerStatus(ServerStatus.Running, AvailabilityStatus.Waiting, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown); - if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + } + else + if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Stop(); break; case WatcherServerStatus.Published: if (oldStatus != ServerStatus.Stopping) + { UpdateServerStatus(ServerStatus.Running, AvailabilityStatus.Available, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown); - if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + } + else + if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Stop(); break; default: @@ -977,7 +989,23 @@ namespace ServerManagerTool.Lib public void UpdateServerStatus(ServerStatus serverStatus, bool sendAlert) { - UpdateServerStatus(serverStatus, Availability, sendAlert); + var availability = Availability; + + switch (serverStatus) + { + case ServerStatus.Stopped: + case ServerStatus.Stopping: + case ServerStatus.Uninstalled: + case ServerStatus.Updating: + availability = AvailabilityStatus.Unavailable; + break; + case ServerStatus.Unknown: + availability = AvailabilityStatus.Unknown; + sendAlert = false; + break; + } + + UpdateServerStatus(serverStatus, availability, sendAlert); } public void UpdateServerStatus(ServerStatus serverStatus, AvailabilityStatus availabilityStatus, bool sendAlert) diff --git a/src/ARKServerManager/Utils/DiscordBotHelper.cs b/src/ARKServerManager/Utils/DiscordBotHelper.cs index ca15eca6..b5868596 100644 --- a/src/ARKServerManager/Utils/DiscordBotHelper.cs +++ b/src/ARKServerManager/Utils/DiscordBotHelper.cs @@ -110,8 +110,8 @@ namespace ServerManagerTool.Utils TaskUtils.RunOnUIThreadAsync(() => { - var serverList = ServerManager.Instance.Servers.Where(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) - && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) + var serverList = ServerManager.Instance.Servers.Where(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) + && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); if (serverList.IsEmpty()) @@ -307,7 +307,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -408,7 +408,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -509,7 +509,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -611,7 +611,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -713,7 +713,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -810,14 +810,14 @@ namespace ServerManagerTool.Utils SendAlerts = true, SendEmails = false, ServerProcess = ServerProcessType.Update, - ServerStatusChangeCallback = (ServerStatus serverStatus) => + ServerStatusChangeCallback = (ServerStatus serverStatus) => { TaskUtils.RunOnUIThreadAsync(() => { var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; diff --git a/src/ARKServerManager/VersionFeed.xml b/src/ARKServerManager/VersionFeed.xml index a68df048..9b310125 100644 --- a/src/ARKServerManager/VersionFeed.xml +++ b/src/ARKServerManager/VersionFeed.xml @@ -9,8 +9,8 @@ urn:uuid:3E33DCB2-ECFE-4489-B1A4-56F5D386F9DC - 1.1.413 (1.1.413.16) - 1.1.413.16 + 1.1.413 (1.1.413.17) + 1.1.413.17 2021-12-20T00:00:00Z diff --git a/src/ARKServerManager/VersionFeedBeta.xml b/src/ARKServerManager/VersionFeedBeta.xml index 7650098d..b2b46d59 100644 --- a/src/ARKServerManager/VersionFeedBeta.xml +++ b/src/ARKServerManager/VersionFeedBeta.xml @@ -7,6 +7,29 @@ 2021-12-20T00:00:00Z + + urn:uuid:B08AA2A8-9E9C-4CD2-8992-6848AA5F0757 + 1.1.413 (1.1.413.17) + 1.1.413.17 + + 2021-12-20T00:00:00Z + +
+

+ CHANGE +
+

    +
  • Added better status detection for stopping servers.
  • +
+

+
+
+ + bletch + bletch1971@hotmail.com + +
+ urn:uuid:D8C3D087-64DB-4FB8-829F-7FA665F77309 1.1.413 (1.1.413.16) diff --git a/src/ARKServerManager/Windows/MainWindow.xaml b/src/ARKServerManager/Windows/MainWindow.xaml index eff554de..a5312ad5 100644 --- a/src/ARKServerManager/Windows/MainWindow.xaml +++ b/src/ARKServerManager/Windows/MainWindow.xaml @@ -435,7 +435,7 @@ - + diff --git a/src/ARKServerManager/Windows/ShutdownWindow.xaml.cs b/src/ARKServerManager/Windows/ShutdownWindow.xaml.cs index 517b6486..2905be53 100644 --- a/src/ARKServerManager/Windows/ShutdownWindow.xaml.cs +++ b/src/ARKServerManager/Windows/ShutdownWindow.xaml.cs @@ -1,15 +1,15 @@ -using ServerManagerTool.Common; -using ServerManagerTool.Common.Utils; -using ServerManagerTool.Enums; -using ServerManagerTool.Lib; -using ServerManagerTool.Plugin.Common; -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; using System.Windows; +using ServerManagerTool.Common; +using ServerManagerTool.Common.Utils; +using ServerManagerTool.Enums; +using ServerManagerTool.Lib; +using ServerManagerTool.Plugin.Common; using WPFSharp.Globalizer; namespace ServerManagerTool @@ -230,6 +230,13 @@ namespace ServerManagerTool SendAlerts = true, ServerProcess = RestartServer ? ServerProcessType.Restart : ServerProcessType.Shutdown, ProgressCallback = (p, m, n) => { TaskUtils.RunOnUIThreadAsync(() => { this.AddMessage(m, n); }).DoNotWait(); }, + ServerStatusChangeCallback = (ServerStatus serverStatus) => + { + TaskUtils.RunOnUIThreadAsync(() => + { + Server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); + }).Wait(); + } }; // if restarting the serverm, then check and update the public IP address diff --git a/src/ConanServerManager/Lib/ServerApp.cs b/src/ConanServerManager/Lib/ServerApp.cs index 03a07056..30992f08 100644 --- a/src/ConanServerManager/Lib/ServerApp.cs +++ b/src/ConanServerManager/Lib/ServerApp.cs @@ -257,6 +257,8 @@ namespace ServerManagerTool.Lib return; } + ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped); + // make a backup of the current profile and config files. CreateProfileBackupArchiveFile(_profile); @@ -404,6 +406,7 @@ namespace ServerManagerTool.Lib } _serverRunning = true; + ServerStatusChangeCallback?.Invoke(ServerStatus.Stopping); LogProfileMessage($"Server process found PID {process.Id}."); QueryMaster.Server gameServer = null; @@ -1165,6 +1168,8 @@ namespace ServerManagerTool.Lib if (ExitCode != EXITCODE_NORMALEXIT) return; + ServerStatusChangeCallback?.Invoke(ServerStatus.Stopped); + emailMessage.AppendLine("Update Summary:"); emailMessage.AppendLine(); emailMessage.AppendLine($"Server Manager version: {App.Instance.Version}"); @@ -2435,7 +2440,7 @@ namespace ServerManagerTool.Lib _loggerBranch?.Info(message); if (includeProgressCallback) - ProgressCallback?.Invoke(0, $"[INFO] {message}"); + ProgressCallback?.Invoke(0, $"{message}"); Debug.WriteLine($"[INFO] (Branch {GetBranchName(branchName) ?? "unknown"}) {message}"); } @@ -2460,7 +2465,7 @@ namespace ServerManagerTool.Lib _loggerProfile?.Info(message); if (includeProgressCallback) - ProgressCallback?.Invoke(0, $"[INFO] {message}"); + ProgressCallback?.Invoke(0, $"{message}"); Debug.WriteLine($"[INFO] (Profile {_profile?.ProfileName ?? "unknown"}) {message}"); } @@ -2709,6 +2714,8 @@ namespace ServerManagerTool.Lib } } + ServerStatusChangeCallback?.Invoke(ServerStatus.Unknown); + LogProfileMessage(""); LogProfileMessage($"Exitcode = {ExitCode}"); return ExitCode; @@ -2806,6 +2813,8 @@ namespace ServerManagerTool.Lib } } + ServerStatusChangeCallback?.Invoke(ServerStatus.Unknown); + LogProfileMessage(""); LogProfileMessage($"Exitcode = {ExitCode}"); return ExitCode; @@ -2886,6 +2895,8 @@ namespace ServerManagerTool.Lib } } + ServerStatusChangeCallback?.Invoke(ServerStatus.Unknown); + LogProfileMessage(""); LogProfileMessage($"Exitcode = {ExitCode}"); return ExitCode; diff --git a/src/ConanServerManager/Lib/ServerRuntime.cs b/src/ConanServerManager/Lib/ServerRuntime.cs index a9c29187..1dcae6b3 100644 --- a/src/ConanServerManager/Lib/ServerRuntime.cs +++ b/src/ConanServerManager/Lib/ServerRuntime.cs @@ -274,20 +274,32 @@ namespace ServerManagerTool.Lib case WatcherServerStatus.RunningLocalCheck: if (oldStatus != ServerStatus.Stopping) + { UpdateServerStatus(ServerStatus.Running, this.Availability != AvailabilityStatus.Available ? AvailabilityStatus.Waiting : this.Availability, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown); - if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + } + else + if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Stop(); break; case WatcherServerStatus.RunningExternalCheck: if (oldStatus != ServerStatus.Stopping) + { UpdateServerStatus(ServerStatus.Running, AvailabilityStatus.Waiting, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown); - if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + } + else + if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Stop(); break; case WatcherServerStatus.Published: if (oldStatus != ServerStatus.Stopping) + { UpdateServerStatus(ServerStatus.Running, AvailabilityStatus.Available, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown); - if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Start(); + } + else + if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled) this.motdIntervalTimer.Stop(); break; default: @@ -965,7 +977,23 @@ namespace ServerManagerTool.Lib public void UpdateServerStatus(ServerStatus serverStatus, bool sendAlert) { - UpdateServerStatus(serverStatus, Availability, sendAlert); + var availability = Availability; + + switch (serverStatus) + { + case ServerStatus.Stopped: + case ServerStatus.Stopping: + case ServerStatus.Uninstalled: + case ServerStatus.Updating: + availability = AvailabilityStatus.Unavailable; + break; + case ServerStatus.Unknown: + availability = AvailabilityStatus.Unknown; + sendAlert = false; + break; + } + + UpdateServerStatus(serverStatus, availability, sendAlert); } public void UpdateServerStatus(ServerStatus serverStatus, AvailabilityStatus availabilityStatus, bool sendAlert) diff --git a/src/ConanServerManager/Utils/DiscordBotHelper.cs b/src/ConanServerManager/Utils/DiscordBotHelper.cs index 2908bd81..b5868596 100644 --- a/src/ConanServerManager/Utils/DiscordBotHelper.cs +++ b/src/ConanServerManager/Utils/DiscordBotHelper.cs @@ -307,7 +307,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -408,7 +408,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -509,7 +509,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -611,7 +611,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -713,7 +713,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; @@ -817,7 +817,7 @@ namespace ServerManagerTool.Utils var server = ServerManager.Instance.Servers.First(s => string.Equals(channelId, s.Profile.DiscordChannelId, StringComparison.OrdinalIgnoreCase) && (string.Equals(profileIdOrAlias, s.Profile.ProfileID, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(s.Profile.DiscordAlias) && string.Equals(profileIdOrAlias, s.Profile.DiscordAlias, StringComparison.OrdinalIgnoreCase))); - server.Runtime.UpdateServerStatus(serverStatus, true); + server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); }).Wait(); } }; diff --git a/src/ConanServerManager/VersionFeed.xml b/src/ConanServerManager/VersionFeed.xml index 3c12c408..003db384 100644 --- a/src/ConanServerManager/VersionFeed.xml +++ b/src/ConanServerManager/VersionFeed.xml @@ -9,8 +9,8 @@ urn:uuid:19B09A66-43F2-4D5F-AF33-5C77D7EA9A6B - 1.1.58 (1.1.58.16) - 1.1.58.16 + 1.1.58 (1.1.58.17) + 1.1.58.17 2021-12-20T00:00:00Z diff --git a/src/ConanServerManager/VersionFeedBeta.xml b/src/ConanServerManager/VersionFeedBeta.xml index 04bd90f2..2fe6b5fe 100644 --- a/src/ConanServerManager/VersionFeedBeta.xml +++ b/src/ConanServerManager/VersionFeedBeta.xml @@ -7,6 +7,29 @@ 2021-12-20T00:00:00Z + + urn:uuid:25F39F6F-E7FE-417D-9BC9-EC6EF7DEC1BC + 1.1.58 (1.1.58.17) + 1.1.58.17 + + 2021-12-20T00:00:00Z + +
+

+ CHANGE +
+

    +
  • Added better status detection for stopping servers.
  • +
+

+
+
+ + bletch + bletch1971@hotmail.com + +
+ urn:uuid:0C184A8F-803D-4AC6-B9CB-599810F9AD29 1.1.58 (1.1.58.16) diff --git a/src/ConanServerManager/Windows/MainWindow.xaml b/src/ConanServerManager/Windows/MainWindow.xaml index bf38ef5e..055423ff 100644 --- a/src/ConanServerManager/Windows/MainWindow.xaml +++ b/src/ConanServerManager/Windows/MainWindow.xaml @@ -433,7 +433,7 @@
- + diff --git a/src/ConanServerManager/Windows/ShutdownWindow.xaml.cs b/src/ConanServerManager/Windows/ShutdownWindow.xaml.cs index 302dd6b9..b815ed83 100644 --- a/src/ConanServerManager/Windows/ShutdownWindow.xaml.cs +++ b/src/ConanServerManager/Windows/ShutdownWindow.xaml.cs @@ -1,17 +1,16 @@ -using ServerManagerTool.Common; -using ServerManagerTool.Common.Utils; -using ServerManagerTool.Enums; -using ServerManagerTool.Lib; -using ServerManagerTool.Plugin.Common; -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; using System.Windows; +using ServerManagerTool.Common; +using ServerManagerTool.Common.Utils; +using ServerManagerTool.Enums; +using ServerManagerTool.Lib; +using ServerManagerTool.Plugin.Common; using WPFSharp.Globalizer; -using static ServerManagerTool.Lib.ServerApp; namespace ServerManagerTool { @@ -228,6 +227,13 @@ namespace ServerManagerTool SendAlerts = true, ServerProcess = RestartServer ? ServerProcessType.Restart : ServerProcessType.Shutdown, ProgressCallback = (p, m, n) => { TaskUtils.RunOnUIThreadAsync(() => { this.AddMessage(m, n); }).DoNotWait(); }, + ServerStatusChangeCallback = (ServerStatus serverStatus) => + { + TaskUtils.RunOnUIThreadAsync(() => + { + Server.Runtime.UpdateServerStatus(serverStatus, serverStatus != ServerStatus.Unknown); + }).Wait(); + } }; // if restarting the serverm, then check and update the public IP address