diff options
author | Patric Stout <truebrain@openttd.org> | 2021-05-11 12:26:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 12:26:16 +0200 |
commit | 36e22f3a7bc0f86c650a293e2f624ac5ddfffa84 (patch) | |
tree | 156871620c6199f7c7411288ccf0bfab4e7957f6 /src/network/network.cpp | |
parent | 2e429ee4853fb4baf78c864be6ba462bd5758096 (diff) | |
download | openttd-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.cpp')
-rw-r--r-- | src/network/network.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp index 4fdbdab73..2186cb8a1 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -585,13 +585,13 @@ void NetworkClose(bool close_admins) } for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) { - cs->CloseConnection(NETWORK_RECV_STATUS_CONN_LOST); + cs->CloseConnection(NETWORK_RECV_STATUS_CLIENT_QUIT); } ServerNetworkGameSocketHandler::CloseListeners(); ServerNetworkAdminSocketHandler::CloseListeners(); } else if (MyClient::my_client != nullptr) { MyClient::SendQuit(); - MyClient::my_client->CloseConnection(NETWORK_RECV_STATUS_CONN_LOST); + MyClient::my_client->CloseConnection(NETWORK_RECV_STATUS_CLIENT_QUIT); } TCPConnecter::KillAll(); |