diff options
author | rubidium <rubidium@openttd.org> | 2007-08-30 19:20:15 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-30 19:20:15 +0000 |
commit | 9833639b00ff84b671a3943e350ed195935e31ad (patch) | |
tree | 7e37f60da9e70804461da1bbda4f42917a627cf8 | |
parent | b284b5fa92adc5a5e8975e472511ab4e2e20f71e (diff) | |
download | openttd-9833639b00ff84b671a3943e350ed195935e31ad.tar.xz |
(svn r11006) -Fix: spectators are not allowed to issue commands. Issue spotted by SmatZ.
-rw-r--r-- | src/network/network_server.cpp | 5 |
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; } |