From ae9c9d52b46004b8cf5c8d77e8dcdd9551cd8894 Mon Sep 17 00:00:00 2001 From: Ty Conner Date: Sat, 8 Jun 2024 15:01:52 -0400 Subject: [PATCH] Match Shutdown pcap text --- Source/ACE.Server/Command/Handlers/AdminShardCommands.cs | 8 +++++++- Source/ACE.Server/Managers/ServerManager.cs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/ACE.Server/Command/Handlers/AdminShardCommands.cs b/Source/ACE.Server/Command/Handlers/AdminShardCommands.cs index a087e95350..71a0ee7ee7 100644 --- a/Source/ACE.Server/Command/Handlers/AdminShardCommands.cs +++ b/Source/ACE.Server/Command/Handlers/AdminShardCommands.cs @@ -97,6 +97,12 @@ public static void ShutdownServerNow(Session session, params string[] parameters "\tSet the shutdown delay in seconds with @set-shutdown-interval < 0-99999 >")] public static void ShutdownServer(Session session, params string[] parameters) { + if (ServerManager.ShutdownInitiated) + { + CommandHandlerHelper.WriteOutputInfo(session, "Shutdown is already in progress.", ChatMessageType.Broadcast); + return; + } + var adminText = ""; if (parameters.Length > 0) adminText = string.Join(" ", parameters); @@ -126,7 +132,7 @@ public static void ShutdownServer(Session session, params string[] parameters) if (adminName.Equals("CONSOLE")) adminName = "System"; - var genericMsgToPlayers = $"Broadcast from {(hideName ? "System": $"{adminName}")}> {(timeTillShutdown.TotalMinutes > 1.5 ? "ATTENTION" : "WARNING")} - This Asheron's Call Server is shutting down in {time}.{(timeTillShutdown.TotalMinutes <= 3 ? " Please log out." : "")}"; + var genericMsgToPlayers = $"Broadcast from {(hideName ? "System": $"{adminName}")}> {(timeTillShutdown.TotalMinutes > 1.5 ? "ATTENTION" : "WARNING")} - This Asheron's Call Server will be shutting down in {time}{(sdt.TotalMinutes <= 1 ? "!" : ".")}{(timeTillShutdown.TotalMinutes <= 3 ? $" Please log out{(sdt.TotalMinutes <= 1 ? "!" : ".")}" : "")}"; if (sdt.TotalMilliseconds == 0) genericMsgToPlayers = $"Broadcast from {(hideName ? "System" : $"{adminName}")}> ATTENTION - This Asheron's Call Server is shutting down NOW!!!!"; diff --git a/Source/ACE.Server/Managers/ServerManager.cs b/Source/ACE.Server/Managers/ServerManager.cs index 2297bb80de..17ac04f05e 100644 --- a/Source/ACE.Server/Managers/ServerManager.cs +++ b/Source/ACE.Server/Managers/ServerManager.cs @@ -273,7 +273,7 @@ private static DateTime NotifyPlayersOfPendingShutdown(DateTime lastNoticeTime, { foreach (var player in PlayerManager.GetAllOnline()) if (sdt.TotalSeconds > 10) - player.Session.WorldBroadcast($"Broadcast from System> {(sdt.TotalMinutes > 1.5 ? "ATTENTION" : "WARNING")} - This Asheron's Call Server is shutting down in {time}.{(sdt.TotalMinutes <= 3 ? " Please log out." : "")}"); + player.Session.WorldBroadcast($"Broadcast from System> {(sdt.TotalMinutes > 1.5 ? "ATTENTION" : "WARNING")} - This Asheron's Call Server will be shutting down in {time}{(sdt.TotalMinutes <= 1 ? "!" : ".")}{(sdt.TotalMinutes <= 3 ? $" Please log out{(sdt.TotalMinutes <= 1 ? "!" : ".")}" : "")}"); else player.Session.WorldBroadcast($"Broadcast from System> ATTENTION - This Asheron's Call Server is shutting down NOW!!!!"); @@ -297,7 +297,7 @@ public static string ShutdownNoticeText() timeToShutdown += $"{(timeToShutdown.Length > 0 ? " and " : "")}{(sdt.Seconds > 0 ? $"{sdt.Seconds} second{(sdt.Seconds > 1 ? "s" : "")}" : "")}"; if (sdt.TotalSeconds > 10) - return $"Broadcast from System> {(sdt.TotalMinutes > 1.5 ? "ATTENTION" : "WARNING")} - This Asheron's Call Server is shutting down in {timeToShutdown}.{(sdt.TotalMinutes <= 3 ? " Please log out." : "")}"; + return $"Broadcast from System> {(sdt.TotalMinutes > 1.5 ? "ATTENTION" : "WARNING")} - This Asheron's Call Server will be shutting down in {timeToShutdown}{(sdt.TotalMinutes <= 1 ? "!" : ".")}{(sdt.TotalMinutes <= 3 ? $" Please log out{(sdt.TotalMinutes <= 1 ? "!" : ".")}" : "")}"; else return $"Broadcast from System> ATTENTION - This Asheron's Call Server is shutting down NOW!!!!"; }