From f3ed8268b6ead737f9fe3c32f152743a47f9cd03 Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 6 Mar 2009 12:42:01 +0000 Subject: (svn r15628) -Fix [FS#2705]: kicking/banning a client from the Client list window crashed the server --- src/console_cmds.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/console_cmds.cpp') diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 7f4463c2b..cc205f690 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -411,18 +411,11 @@ DEF_CONSOLE_CMD(ConBan) if (ci != NULL) { IConsolePrint(CC_DEFAULT, "Client banned"); banip = GetClientIP(ci); - NetworkServerSendError(client_id, NETWORK_ERROR_KICKED); } else { IConsolePrint(CC_DEFAULT, "Client not online, banned IP"); } - /* Add user to ban-list */ - for (uint index = 0; index < lengthof(_network_ban_list); index++) { - if (_network_ban_list[index] == NULL) { - _network_ban_list[index] = strdup(banip); - break; - } - } + NetworkServerBanIP(banip); return true; } @@ -613,7 +606,7 @@ DEF_CONSOLE_CMD(ConKick) } if (ci != NULL) { - NetworkServerSendError(client_id, NETWORK_ERROR_KICKED); + NetworkServerKickClient(client_id); } else { IConsoleError("Client not found"); } -- cgit v1.2.3-54-g00ecf