summaryrefslogtreecommitdiff
path: root/src/network/network_server.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-07 15:27:19 +0000
committerrubidium <rubidium@openttd.org>2009-01-07 15:27:19 +0000
commit4231c3ee82539e73808b5d35c4612b29a43d4884 (patch)
tree26ecdc3e2c01b662df452e9e13bbf21461754bc2 /src/network/network_server.cpp
parent505641833633f19b64080b652afe99328e726d42 (diff)
downloadopenttd-4231c3ee82539e73808b5d35c4612b29a43d4884.tar.xz
(svn r14897) -Codechange: don't allow a few command flags to be sent over the network as it's bogus information anyway; e.g. the "do not send over network" flag as it will be set whenever the command is received from the server/client.
-Codechange: test earlier whether the command (send from the server) is actually valid.
Diffstat (limited to 'src/network/network_server.cpp')
-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 2fc06f4a1..e496bb6a5 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -839,6 +839,11 @@ static bool CheckCommandFlags(const CommandPacket *cp, const NetworkClientInfo *
return false;
}
+ if ((cp->cmd & CMD_FLAGS_MASK) != 0) {
+ IConsolePrintF(CC_ERROR, "WARNING: invalid command flag from client %d (IP: %s), kicking...", ci->client_id, GetClientIP(ci));
+ return false;
+ }
+
return true;
}