From 10506765fbd85c511aa9a6cc14c1bbe440c7a723 Mon Sep 17 00:00:00 2001
From: Brett Hewitson
Date: Thu, 16 Jun 2022 00:43:53 +1000
Subject: [PATCH] Server Monitor Changes
- added shutdown reason to window.
---
src/ARKServerManager/Lib/ServerApp.cs | 23 +++++++++----
src/ARKServerManager/VersionFeed.xml | 1 +
src/ARKServerManager/VersionFeedBeta.xml | 1 +
.../Windows/ServerMonitorWindow.xaml | 19 ++++++++---
.../Windows/ServerMonitorWindow.xaml.cs | 33 ++++++++++++++-----
src/ConanServerManager/Lib/ServerApp.cs | 25 ++++++++++----
src/ConanServerManager/VersionFeed.xml | 5 +++
src/ConanServerManager/VersionFeedBeta.xml | 23 +++++++++++++
.../Windows/ServerMonitorWindow.xaml | 19 ++++++++---
.../Windows/ServerMonitorWindow.xaml.cs | 33 ++++++++++++++-----
10 files changed, 143 insertions(+), 39 deletions(-)
diff --git a/src/ARKServerManager/Lib/ServerApp.cs b/src/ARKServerManager/Lib/ServerApp.cs
index d2998ef5..0bc05388 100644
--- a/src/ARKServerManager/Lib/ServerApp.cs
+++ b/src/ARKServerManager/Lib/ServerApp.cs
@@ -98,6 +98,7 @@ namespace ServerManagerTool.Lib
private QueryMaster.Rcon _rconConsole = null;
private bool _serverRunning = false;
+ public bool AllMessagesShowShutdownReason { get; set; } = Config.Default.ServerShutdown_AllMessagesShowReason;
public bool BackupWorldFile { get; set; } = Config.Default.BackupWorldFile;
public bool CheckForOnlinePlayers { get; set; } = Config.Default.ServerShutdown_CheckForOnlinePlayers;
public bool DeleteOldBackupFiles { get; set; } = Config.Default.AutoBackup_DeleteOldFiles;
@@ -434,7 +435,7 @@ namespace ServerManagerTool.Lib
gameServer = QueryMaster.ServerQuery.GetServerInstance(QueryMaster.EngineType.Source, endPoint);
// check if there is a shutdown reason
- if (!string.IsNullOrWhiteSpace(ShutdownReason) && !Config.Default.ServerShutdown_AllMessagesShowReason)
+ if (!string.IsNullOrWhiteSpace(ShutdownReason) && !AllMessagesShowShutdownReason)
{
LogProfileMessage("Sending shutdown reason...");
@@ -542,7 +543,7 @@ namespace ServerManagerTool.Lib
ProcessAlert(AlertType.ShutdownMessage, message);
// check if there is a shutdown reason
- if (!string.IsNullOrWhiteSpace(ShutdownReason) && Config.Default.ServerShutdown_AllMessagesShowReason)
+ if (!string.IsNullOrWhiteSpace(ShutdownReason) && AllMessagesShowShutdownReason)
{
ProcessAlert(AlertType.ShutdownReason, ShutdownReason);
@@ -569,9 +570,19 @@ namespace ServerManagerTool.Lib
// perform a world save
if (!string.IsNullOrWhiteSpace(Config.Default.ServerShutdown_WorldSaveMessage))
{
- LogProfileMessage(Config.Default.ServerShutdown_WorldSaveMessage);
- ProcessAlert(AlertType.ShutdownMessage, Config.Default.ServerShutdown_WorldSaveMessage);
- SendMessage(Config.Default.ServerShutdown_WorldSaveMessage, cancellationToken);
+ var message = Config.Default.ServerShutdown_WorldSaveMessage;
+
+ LogProfileMessage(message);
+ ProcessAlert(AlertType.ShutdownMessage, message);
+
+ if (!string.IsNullOrWhiteSpace(ShutdownReason) && AllMessagesShowShutdownReason)
+ {
+ ProcessAlert(AlertType.ShutdownReason, ShutdownReason);
+
+ message = $"{message}\r\n{ShutdownReason}";
+ }
+
+ SendMessage(message, cancellationToken);
}
if (SendCommand(Config.Default.ServerSaveCommand, cancellationToken))
@@ -610,7 +621,7 @@ namespace ServerManagerTool.Lib
ProcessAlert(AlertType.ShutdownMessage, message);
// check if there is a shutdown reason
- if (!string.IsNullOrWhiteSpace(ShutdownReason) && Config.Default.ServerShutdown_AllMessagesShowReason)
+ if (!string.IsNullOrWhiteSpace(ShutdownReason) && AllMessagesShowShutdownReason)
{
ProcessAlert(AlertType.ShutdownReason, ShutdownReason);
diff --git a/src/ARKServerManager/VersionFeed.xml b/src/ARKServerManager/VersionFeed.xml
index 00785477..64466ecc 100644
--- a/src/ARKServerManager/VersionFeed.xml
+++ b/src/ARKServerManager/VersionFeed.xml
@@ -29,6 +29,7 @@
Prevent Transfer Grids - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for creatures not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing creatures.
Map Spawner Grids - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for spawners/creatures not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing spawners/creatures.
Stack Size Grid - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for items not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing items.
Prevent Transfer Grids - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for creatures not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing creatures.
Map Spawner Grids - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for spawners/creatures not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing spawners/creatures.
Stack Size Grid - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for items not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing items.