Crash fix / Cleanup

This commit is contained in:
Anuken
2018-09-03 17:04:11 -04:00
parent e0a94f694b
commit 6c5eff1143
6 changed files with 6 additions and 88 deletions

View File

@@ -13,7 +13,6 @@ import io.anuke.mindustry.game.Version;
import io.anuke.mindustry.gen.Call;
import io.anuke.mindustry.io.SaveIO;
import io.anuke.mindustry.maps.Map;
import io.anuke.mindustry.net.Administration;
import io.anuke.mindustry.net.Administration.PlayerInfo;
import io.anuke.mindustry.net.EditLog;
import io.anuke.mindustry.net.Net;
@@ -337,36 +336,7 @@ public class ServerControl extends Module{
boolean value = arg[0].equalsIgnoreCase("on");
debug = value;
info("Debug mode is now {0}.", value ? "on" : "off");
});
handler.register("antigrief", "[on/off] [max-break] [cooldown-in-ms]", "Enable or disable anti-grief.", arg -> {
if(arg.length == 0){
info("Anti-grief is currently &lc{0}.", netServer.admins.isAntiGrief() ? "on" : "off");
return;
}
String s = arg[0];
if(s.equalsIgnoreCase("on")){
netServer.admins.setAntiGrief(true);
info("Anti-grief enabled.");
}else if(s.equalsIgnoreCase("off")){
netServer.admins.setAntiGrief(false);
info("Anti-grief disabled.");
}else{
err("Incorrect command usage.");
}
if(arg.length >= 2){
try{
int maxbreak = Integer.parseInt(arg[1]);
int cooldown = (arg.length >= 3 ? Integer.parseInt(arg[2]) : Administration.defaultBreakCooldown);
netServer.admins.setAntiGriefParams(maxbreak, cooldown);
info("Anti-grief parameters set.");
}catch(NumberFormatException e){
err("Invalid number format.");
}
}
});
});.0
handler.register("allow-custom-clients", "[on/off]", "Allow or disallow custom clients.", arg -> {
if(arg.length == 0){