diff --git a/src/consolechat/server/Server.java b/src/consolechat/server/Server.java index fc8b3cd..34cfc5c 100644 --- a/src/consolechat/server/Server.java +++ b/src/consolechat/server/Server.java @@ -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."); diff --git a/src/consolechat/server/ServerThread.java b/src/consolechat/server/ServerThread.java index 224081a..be31304 100644 --- a/src/consolechat/server/ServerThread.java +++ b/src/consolechat/server/ServerThread.java @@ -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())) {