diff options
-rw-r--r-- | src/network/network_server.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 9e4d0d88f..86885d598 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -456,7 +456,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendError(NetworkErrorCode err } for (NetworkClientSocket *new_cs : NetworkClientSocket::Iterate()) { - if (new_cs->status > STATUS_AUTHORIZED && new_cs != this) { + if (new_cs->status >= STATUS_AUTHORIZED && new_cs != this) { /* Some errors we filter to a more general error. Clients don't have to know the real * reason a joining failed. */ if (error == NETWORK_ERROR_NOT_AUTHORIZED || error == NETWORK_ERROR_NOT_EXPECTED || error == NETWORK_ERROR_WRONG_REVISION) { @@ -549,7 +549,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendWelcome() /* Transmit info about all the active clients */ for (NetworkClientSocket *new_cs : NetworkClientSocket::Iterate()) { - if (new_cs != this && new_cs->status > STATUS_AUTHORIZED) { + if (new_cs != this && new_cs->status >= STATUS_AUTHORIZED) { this->SendClientInfo(new_cs->GetInfo()); } } @@ -1068,7 +1068,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_MAP_OK(Packet * this->last_frame_server = _frame_counter; for (NetworkClientSocket *new_cs : NetworkClientSocket::Iterate()) { - if (new_cs->status > STATUS_AUTHORIZED) { + if (new_cs->status >= STATUS_AUTHORIZED) { new_cs->SendClientInfo(this->GetInfo()); new_cs->SendJoin(this->client_id); } @@ -1178,7 +1178,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_ERROR(Packet *p NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, nullptr, strid); for (NetworkClientSocket *new_cs : NetworkClientSocket::Iterate()) { - if (new_cs->status > STATUS_AUTHORIZED) { + if (new_cs->status >= STATUS_AUTHORIZED) { new_cs->SendErrorQuit(this->client_id, errorno); } } @@ -1204,7 +1204,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_QUIT(Packet *p) NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, nullptr, STR_NETWORK_MESSAGE_CLIENT_LEAVING); for (NetworkClientSocket *new_cs : NetworkClientSocket::Iterate()) { - if (new_cs->status > STATUS_AUTHORIZED && new_cs != this) { + if (new_cs->status >= STATUS_AUTHORIZED && new_cs != this) { new_cs->SendQuit(this->client_id); } } @@ -1607,7 +1607,9 @@ void NetworkUpdateClientInfo(ClientID client_id) DEBUG(desync, 1, "client: %08x; %02x; %02x; %04x", _date, _date_fract, (int)ci->client_playas, client_id); for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) { - cs->SendClientInfo(ci); + if (cs->status >= ServerNetworkGameSocketHandler::STATUS_AUTHORIZED) { + cs->SendClientInfo(ci); + } } NetworkAdminClientUpdate(ci); |