From 84d1c4e8c5e5853c57e582386c4846808b86c09b Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 30 Aug 2007 19:21:12 +0000 Subject: [PATCH] (svn r11007) [0.5] -Backport from trunk (r11006) - Fix: spectators are not allowed to issue commands (r11006) --- network_server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/network_server.c b/network_server.c index f652db7711..f4e04db869 100644 --- a/network_server.c +++ b/network_server.c @@ -823,6 +823,11 @@ static bool CheckCommandFlags(const CommandPacket *cp, const NetworkClientInfo * return false; } + if ((cp->cmd != CMD_PLAYER_CTRL && !IsValidPlayer(cp->player) && ci->client_index != NETWORK_SERVER_INDEX) { + IConsolePrintF(_icolour_err, "WARNING: spectator issueing command from client %d (IP: %s), kicking...", ci->client_index, GetPlayerIP(ci)); + return false; + } + return true; }