Added 'exit' command to shutdown ViaProxy

This commit is contained in:
RaphiMC 2023-08-09 20:24:38 +02:00
parent 3259ec150f
commit 2196ed5258
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -58,6 +58,8 @@ public class ConsoleHandler {
System.out.println("GC Done");
} else if (command.equalsIgnoreCase("via") || command.equalsIgnoreCase("viaversion")) {
Via.getManager().getCommandHandler().onCommand(new ConsoleCommandSender(), args.getAsArray());
} else if (command.equalsIgnoreCase("exit")) {
System.exit(0);
} else if (command.equalsIgnoreCase("threaddump")) {
System.out.println("Thread Dump:");
for (Thread thread : Thread.getAllStackTraces().keySet()) {
@ -67,8 +69,9 @@ public class ConsoleHandler {
} else {
if (PluginManager.EVENT_MANAGER.call(new ConsoleCommandEvent(command, args.getAsArray())).isCancelled()) continue;
System.out.println("Invalid Command!");
System.out.println(" via | Run a viaversion command");
System.out.println(" gc | Run the garbage collector");
System.out.println(" exit | Shutdown ViaProxy");
System.out.println(" via | Run a viaversion command");
System.out.println(" threaddump | Print the stacktrace of all running threads");
}
} catch (Throwable e) {