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
This commit is contained in:
Patric Stout
2021-05-11 12:26:16 +02:00
committed by GitHub
parent 2e429ee485
commit 36e22f3a7b
6 changed files with 25 additions and 24 deletions

View File

@@ -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. */