mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-22 05:38:19 +07:00
Added utility griefer scan command
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Sun Apr 08 12:37:55 EDT 2018
|
#Wed Apr 11 13:05:01 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=505
|
androidBuildCode=506
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.5
|
code=3.5
|
||||||
build=custom build
|
build=custom build
|
||||||
|
@ -502,6 +502,37 @@ public class ServerControl extends Module {
|
|||||||
info("Saved to slot {0}.", slot);
|
info("Saved to slot {0}.", slot);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
handler.register("griefers", "[min-break:place-ratio] [min-breakage]", "Find possible griefers currently online.", arg -> {
|
||||||
|
if(!state.is(State.playing)) {
|
||||||
|
err("Open the server first.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
float ratio = arg.length > 0 ? Float.parseFloat(arg[0]) : 0.9f;
|
||||||
|
int minbreak = arg.length > 1 ? Integer.parseInt(arg[1]) : 100;
|
||||||
|
|
||||||
|
boolean found = false;
|
||||||
|
|
||||||
|
for (Player player : playerGroup.all()) {
|
||||||
|
TraceInfo info = netServer.admins.getTrace(Net.getConnection(player.clientid).address);
|
||||||
|
if(info.totalBlocksBroken >= minbreak && info.totalBlocksBroken / Math.max(info.totalBlocksPlaced, 1f) >= ratio){
|
||||||
|
info("&ly - Player '{0}' / UUID &lm{1}&ly found: &lc{2}&ly broken and &lc{3}&ly placed.",
|
||||||
|
player.name, info.uuid, info.totalBlocksBroken, info.totalBlocksPlaced);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
|
info("No griefers matching the criteria have been found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch (NumberFormatException e){
|
||||||
|
err("Invalid number format.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
handler.register("gameover", "Force a game over.", arg -> {
|
handler.register("gameover", "Force a game over.", arg -> {
|
||||||
if(state.is(State.menu)){
|
if(state.is(State.menu)){
|
||||||
info("Not playing a map.");
|
info("Not playing a map.");
|
||||||
|
Reference in New Issue
Block a user