mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2025-01-23 21:41:23 +01:00
Added threaddump command
This commit is contained in:
parent
3bbe0eea98
commit
e05013d54f
@ -47,11 +47,18 @@ public class ConsoleHandler {
|
||||
System.out.println("GC Done");
|
||||
} else if (command.equalsIgnoreCase("via")) {
|
||||
Via.getManager().getCommandHandler().onCommand(new UserCommandSender(new UserConnectionImpl(null, true)), args.getAsArray());
|
||||
} else if (command.equalsIgnoreCase("threaddump")) {
|
||||
System.out.println("Thread Dump:");
|
||||
for (Thread thread : Thread.getAllStackTraces().keySet()) {
|
||||
System.out.println("Thread: " + thread.getName() + " | State: " + thread.getState());
|
||||
for (StackTraceElement element : thread.getStackTrace()) System.out.println(" " + element.toString());
|
||||
}
|
||||
} 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(" threaddump | Print the stacktrace of all running threads");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user