summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Stupnikov <dp@dpointer.org>2021-02-27 22:26:51 +0300
committerGitHub <noreply@github.com>2021-02-27 20:26:51 +0100
commit4fd2eecb8b21f59b986b9738fd208bcd6f668448 (patch)
treea0067fc6461a2c72fbb3f772a3f527adecc65417
parentcd756e6f0126013184ffacf80a962dfc50352f94 (diff)
downloadopenttd-4fd2eecb8b21f59b986b9738fd208bcd6f668448.tar.xz
Change: Improve console warnings on invalid network commands (#8753)
-rw-r--r--src/network/network_server.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 19e7d70dc..5b6bc03f4 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -1100,12 +1100,12 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(Packet
if ((GetCommandFlags(cp.cmd) & CMD_SERVER) && ci->client_id != CLIENT_ID_SERVER) {
- IConsolePrintF(CC_ERROR, "WARNING: server only command from: client %d (IP: %s), kicking...", ci->client_id, this->GetClientIP());
+ IConsolePrintF(CC_ERROR, "WARNING: server only command %u from client %u (IP: %s), kicking...", cp.cmd & CMD_ID_MASK, ci->client_id, this->GetClientIP());
return this->SendError(NETWORK_ERROR_KICKED);
}
if ((GetCommandFlags(cp.cmd) & CMD_SPECTATOR) == 0 && !Company::IsValidID(cp.company) && ci->client_id != CLIENT_ID_SERVER) {
- IConsolePrintF(CC_ERROR, "WARNING: spectator issuing command from client %d (IP: %s), kicking...", ci->client_id, this->GetClientIP());
+ IConsolePrintF(CC_ERROR, "WARNING: spectator (client: %u, IP: %s) issued non-spectator command %u, kicking...", ci->client_id, this->GetClientIP(), cp.cmd & CMD_ID_MASK);
return this->SendError(NETWORK_ERROR_KICKED);
}