From d068d61f3c412b4e146d5665c17bcbc01acffa1e Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 27 Feb 2021 00:32:51 +0100 Subject: Fix bddfcaef: don't tell twice that a client left because of a timeout etc (#8746) SendError() notifies all clients of the disconnect. This calls CloseConnection() at the end, which also notified the clients of the disconnect. Really no need to do it twice. The status NETWORK_RECV_STATUS_SERVER_ERROR is only set by SendError(), so in case that is the status, don't let ClientConnection() send another notification. --- src/network/network_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 6ae8e7cdc..e03a60465 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -265,7 +265,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta */ if (this->sock == INVALID_SOCKET) return status; - if (status != NETWORK_RECV_STATUS_CONN_LOST && !this->HasClientQuit() && this->status >= STATUS_AUTHORIZED) { + if (status != NETWORK_RECV_STATUS_CONN_LOST && status != NETWORK_RECV_STATUS_SERVER_ERROR && !this->HasClientQuit() && this->status >= STATUS_AUTHORIZED) { /* We did not receive a leave message from this client... */ char client_name[NETWORK_CLIENT_NAME_LENGTH]; -- cgit v1.2.3-54-g00ecf