From 230757e945d02c4259055dc9d1af410d99bb1f9d Mon Sep 17 00:00:00 2001 From: autumn <34-paradoxical_autumn@users.noreply.gitlab.1024cats.social> Date: Mon, 16 Feb 2026 22:50:32 +0000 Subject: [PATCH] add automatic shutdown after confirming a server stop --- mc-manager/Commands/RemoteServerSystem.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mc-manager/Commands/RemoteServerSystem.cs b/mc-manager/Commands/RemoteServerSystem.cs index 4f13d74..0c25823 100644 --- a/mc-manager/Commands/RemoteServerSystem.cs +++ b/mc-manager/Commands/RemoteServerSystem.cs @@ -80,6 +80,8 @@ public class RemoteServerSystem : Command AnsiConsole.MarkupLine("Enter QUIT or EXIT to exit."); List quitCmds = ["quit", "exit"]; + + bool shouldAutoQuit = false; while (true) { @@ -94,9 +96,19 @@ public class RemoteServerSystem : Command continue; } + if (request == "stop") + { + shouldAutoQuit = true; + } + AnsiConsole.MarkupLine(client.SendCommand(request, out resp) ? $"[royalblue1]{resp.Body.EscapeMarkup()}[/]" : "[red]Error sending command.[/]"); + + if (shouldAutoQuit) + { + break; + } } return 0;