mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-08-02 07:59:15 +07:00
Added search command
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user