diff options
author | adf88 <adf88@openttd.org> | 2017-09-10 14:03:29 +0000 |
---|---|---|
committer | adf88 <adf88@openttd.org> | 2017-09-10 14:03:29 +0000 |
commit | 56ffa35511f64e0f7a79e1e34aa10f317d310911 (patch) | |
tree | 77759c31f74d31b3ef3952a87b8adbc40f78f08f /src | |
parent | f3fbf6beb8b767e2e45591a7daa605c413e2832b (diff) | |
download | openttd-56ffa35511f64e0f7a79e1e34aa10f317d310911.tar.xz |
(svn r27914) -Fix/Feature: 'unban' console command - fix invalid help text and be more verbose
Diffstat (limited to 'src')
-rw-r--r-- | src/console_cmds.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index d9706f7bf..3b65224de 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -553,9 +553,8 @@ DEF_CONSOLE_CMD(ConBan) DEF_CONSOLE_CMD(ConUnBan) { - 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'"); return true; } @@ -574,11 +573,14 @@ DEF_CONSOLE_CMD(ConUnBan) } 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]); _network_ban_list.Erase(_network_ban_list.Get(index)); - IConsolePrint(CC_DEFAULT, "IP unbanned."); } 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; |