Changeset - r24950:fc13af95015e
[Not reviewed]
master
0 1 0
Patric Stout - 4 years ago 2021-02-26 23:32:51
truebrain@openttd.org
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.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/network/network_server.cpp
Show inline comments
 
@@ -265,7 +265,7 @@ NetworkRecvStatus ServerNetworkGameSocke
 
	 */
 
	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];
 

	
0 comments (0 inline, 0 general)