summaryrefslogtreecommitdiff
path: root/src/network/network_client.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-11 12:26:16 +0200
committerGitHub <noreply@github.com>2021-05-11 12:26:16 +0200
commit36e22f3a7bc0f86c650a293e2f624ac5ddfffa84 (patch)
tree156871620c6199f7c7411288ccf0bfab4e7957f6 /src/network/network_client.cpp
parent2e429ee4853fb4baf78c864be6ba462bd5758096 (diff)
downloadopenttd-36e22f3a7bc0f86c650a293e2f624ac5ddfffa84.tar.xz
Fix: [Network] clients leaving because of broken connections was not broadcasted (#9238)
The code mixed up "client has quit but we already told everyone" with "client lost connection, handle this". Split up those two signals: - CLIENT_QUIT means we told everyone and the connection is now dead - CONNECTION_LIST means we should tell everyone we lost a client
Diffstat (limited to 'src/network/network_client.cpp')
-rw-r--r--src/network/network_client.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index f827c5735..501449705 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -656,7 +656,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CLIENT_INFO(Pac
p->Recv_string(name, sizeof(name));
if (this->status < STATUS_AUTHORIZED) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
- if (this->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST;
+ if (this->HasClientQuit()) return NETWORK_RECV_STATUS_CLIENT_QUIT;
/* The server validates the name when receiving it from clients, so when it is wrong
* here something went really wrong. In the best case the packet got malformed on its
* way too us, in the worst case the server is broken or compromised. */