Added search command

This commit is contained in:
Anuken
2020-01-15 09:31:25 -05:00
parent ac66ac2c55
commit 4c0302bcb1
2 changed files with 31 additions and 1 deletions

View File

@ -805,6 +805,22 @@ public class ServerControl implements ApplicationListener{
}
});
handler.register("search", "<name...>", "Search players who have used part of a name.", arg -> {
ObjectSet<PlayerInfo> infos = netServer.admins.searchNames(arg[0]);
if(infos.size > 0){
info("&lgPlayers found: {0}", infos.size);
int i = 0;
for(PlayerInfo info : infos){
info("- &lc[{0}] &ly'{1}'&lc / &lm{2}", i++, info.lastName, info.id);
}
}else{
info("Nobody with that name could be found.");
}
});
handler.register("gc", "Trigger a grabage struct. Testing only.", arg -> {
int pre = (int)(Core.app.getJavaHeap() / 1024 / 1024);
System.gc();