Codechange: use a scoped enum for NetworkErrorCode

This commit is contained in:
Rubidium
2026-03-07 16:39:22 +01:00
committed by rubidium42
parent 54aaae4ffd
commit 92dae45773
7 changed files with 176 additions and 174 deletions
+3 -3
View File
@@ -136,15 +136,15 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_GAME_INFO(Packet
NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_ERROR(Packet &p)
{
NetworkErrorCode error = (NetworkErrorCode)p.Recv_uint8();
NetworkErrorCode error = static_cast<NetworkErrorCode>(p.Recv_uint8());
Debug(net, 9, "Query::Receive_SERVER_ERROR(): error={}", error);
NetworkGame *item = NetworkGameListAddItem(this->connection_string);
if (error == NETWORK_ERROR_NOT_EXPECTED) {
if (error == NetworkErrorCode::NotExpected) {
/* If we query a server that is 1.11.1 or older, we get an
* NETWORK_ERROR_NOT_EXPECTED on requesting the game info. Show to the
* NetworkErrorCode::NotExpected on requesting the game info. Show to the
* user this server is too old to query.
*/
item->status = NGLS_TOO_OLD;