1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-24 23:19:09 +00:00

Fix: inconsistent check for client authorized status

This commit is contained in:
Rubidium
2024-03-25 21:03:18 +01:00
committed by Michael Lutz
parent ffb795e52f
commit 3b614d0650

View File

@@ -248,7 +248,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta
/* Inform other clients of this... strange leaving ;) */
for (NetworkClientSocket *new_cs : NetworkClientSocket::Iterate()) {
if (new_cs->status > STATUS_AUTHORIZED && this != new_cs) {
if (new_cs->status >= STATUS_AUTHORIZED && this != new_cs) {
new_cs->SendErrorQuit(this->client_id, NETWORK_ERROR_CONNECTION_LOST);
}
}
@@ -366,7 +366,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendError(NetworkErrorCode err
StringID strid = GetNetworkErrorMsg(error);
/* Only send when the current client was in game */
if (this->status > STATUS_AUTHORIZED) {
if (this->status >= STATUS_AUTHORIZED) {
std::string client_name = this->GetClientName();
Debug(net, 1, "'{}' made an error and has been disconnected: {}", client_name, GetString(strid));