(svn r11006) -Fix: spectators are not allowed to issue commands. Issue spotted by SmatZ.
authorrubidium
Thu, 30 Aug 2007 19:20:15 +0000
changeset 7991 05dd904bb306
parent 7990 70039e33e893
child 7992 8ac3fcd8d570
(svn r11006) -Fix: spectators are not allowed to issue commands. Issue spotted by SmatZ.
src/network/network_server.cpp
--- a/src/network/network_server.cpp	Thu Aug 30 17:17:04 2007 +0000
+++ b/src/network/network_server.cpp	Thu Aug 30 19:20:15 2007 +0000
@@ -822,6 +822,11 @@
 		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;
 }