Ban needs a little bit of work, but almost functional.

This commit is contained in:
Deathsbreed 2014-11-17 16:57:37 -06:00
parent b6b6c07841
commit bf2c69bb32
2 changed files with 3 additions and 2 deletions

View File

@ -149,7 +149,7 @@ public class Server implements Runnable {
} else if(input.length() > 11 && input.substring(0, 4).equals("/ban")) {
if(clients.get(findClient(id)).isAdmin()) {
int bID = Integer.parseInt(input.substring(5, 10));
String reason = input.substring(12);
String reason = input.substring(11);
ban(bID, reason);
} else {
clients.get(findClient(id)).send("You are not admin.");

View File

@ -74,7 +74,8 @@ public class ServerThread extends Thread {
send("Admin commands:\n" +
" - /chgpasswd [newpasswd] -- Change the server admin password.\n" +
" - /giveadmin [id] -- Give another client admin as well.\n" +
" - /kick [id] [reason] -- Kick out a user and state a reason for the kick.\n");
" - /kick [id] [reason] -- Kick out a user and state a reason for the kick.\n" +
" - /ban [id] [reason] -- Ban a user from ever being able to connect to the server again.\n");
}
} else if(command.length() > 6 && command.substring(0, 6).equals("/admin")) {
if(command.substring(7).equals(server.getPasswd())) {