1
0
Fork 0

(svn r27914) -Fix/Feature: 'unban' console command - fix invalid help text and be more verbose

release/1.8
adf88 2017-09-10 14:03:29 +00:00
parent f3fbf6beb8
commit 56ffa35511
1 changed files with 6 additions and 4 deletions

View File

@ -553,9 +553,8 @@ DEF_CONSOLE_CMD(ConBan)
DEF_CONSOLE_CMD(ConUnBan) DEF_CONSOLE_CMD(ConUnBan)
{ {
if (argc == 0) { if (argc == 0) {
IConsoleHelp("Unban a client from a network game. Usage: 'unban <ip | client-id>'"); IConsoleHelp("Unban a client from a network game. Usage: 'unban <ip | banlist-index>'");
IConsoleHelp("For a list of banned IP's, see the command 'banlist'"); IConsoleHelp("For a list of banned IP's, see the command 'banlist'");
return true; return true;
} }
@ -574,11 +573,14 @@ DEF_CONSOLE_CMD(ConUnBan)
} }
if (index < _network_ban_list.Length()) { if (index < _network_ban_list.Length()) {
char msg[64];
seprintf(msg, lastof(msg), "Unbanned %s", _network_ban_list[index]);
IConsolePrint(CC_DEFAULT, msg);
free(_network_ban_list[index]); free(_network_ban_list[index]);
_network_ban_list.Erase(_network_ban_list.Get(index)); _network_ban_list.Erase(_network_ban_list.Get(index));
IConsolePrint(CC_DEFAULT, "IP unbanned.");
} else { } else {
IConsolePrint(CC_DEFAULT, "IP not in ban-list."); IConsolePrint(CC_DEFAULT, "Invalid list index or IP not in ban-list.");
IConsolePrint(CC_DEFAULT, "For a list of banned IP's, see the command 'banlist'");
} }
return true; return true;