Add "pardon" command for votekicks (#1570)

* Add "pardon" command

Allows players who have been incorrectly votekicked to join again

* isn't hasn't

* getInfoOptional & space

* pardon me

no pun intended

* Update ServerControl.java
This commit is contained in:
fuzzbuck 2020-03-02 19:37:04 +01:00 committed by GitHub
parent b512169d44
commit 8e9dabb350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -659,6 +659,17 @@ public class ServerControl implements ApplicationListener{
err("That IP/ID is not banned!"); err("That IP/ID is not banned!");
} }
}); });
handler.register("pardon", "<ID>", "Pardons a votekicked player by ID and allows them to join again.", arg -> {
PlayerInfo info = netServer.admins.getInfoOptional(arg[0]);
if(info != null){
info.lastKicked = 0;
info("Pardoned player: {0}", info.lastName);
}else{
err("That ID can't be found.");
}
});
handler.register("admin", "<add/remove> <username/ID...>", "Make an online user admin", arg -> { handler.register("admin", "<add/remove> <username/ID...>", "Make an online user admin", arg -> {
if(!state.is(State.playing)){ if(!state.is(State.playing)){