From 9833639b00ff84b671a3943e350ed195935e31ad Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 30 Aug 2007 19:20:15 +0000 Subject: (svn r11006) -Fix: spectators are not allowed to issue commands. Issue spotted by SmatZ. --- src/network/network_server.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/network') diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 8de68e0aa..5cb176a62 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -822,6 +822,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; } -- cgit v1.2.3-70-g09d2