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;