summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-30 19:20:15 +0000
committerrubidium <rubidium@openttd.org>2007-08-30 19:20:15 +0000
commitd4290086e800bfb66ac5a51ceabf57d058887559 (patch)
tree7e37f60da9e70804461da1bbda4f42917a627cf8
parentf4482907dabf064299c7ef50a3ff47589ccb54ff (diff)
downloadopenttd-d4290086e800bfb66ac5a51ceabf57d058887559.tar.xz
(svn r11006) -Fix: spectators are not allowed to issue commands. Issue spotted by SmatZ.
-rw-r--r--src/network/network_server.cpp5
1 files changed, 5 insertions, 0 deletions
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;
}