diff --git a/src/network/core/config.h b/src/network/core/config.h index e5b16547a2..09fa460129 100644 --- a/src/network/core/config.h +++ b/src/network/core/config.h @@ -96,4 +96,9 @@ static const uint NETWORK_GRF_NAME_LENGTH = 80; ///< Maxim */ static const uint NETWORK_MAX_GRF_COUNT = 255; +/** + * Maximum version supported in PACKET_SERVER_GAME_INFO_EXTENDED + */ +static const uint8 SERVER_GAME_INFO_EXTENDED_MAX_VERSION = 1; + #endif /* NETWORK_CORE_CONFIG_H */ diff --git a/src/network/core/game_info.cpp b/src/network/core/game_info.cpp index a1062bbc08..3962529249 100644 --- a/src/network/core/game_info.cpp +++ b/src/network/core/game_info.cpp @@ -434,7 +434,7 @@ void DeserializeNetworkGameInfoExtended(Packet *p, NetworkGameInfo *info) static const Date MAX_DATE = ConvertYMDToDate(MAX_YEAR, 11, 31); // December is month 11 const uint8 version = p->Recv_uint8(); - if (version > 1) return; // Unknown version + if (version > SERVER_GAME_INFO_EXTENDED_MAX_VERSION) return; // Unknown version NewGRFSerializationType newgrf_serialisation = NST_GRFID_MD5; diff --git a/src/network/network_query.cpp b/src/network/network_query.cpp index 9d8919ba89..4e420209af 100644 --- a/src/network/network_query.cpp +++ b/src/network/network_query.cpp @@ -73,9 +73,9 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::SendGameInfo() { Packet *p = new Packet(PACKET_CLIENT_GAME_INFO); p->Send_uint32(FIND_SERVER_EXTENDED_TOKEN); - p->Send_uint8(PACKET_SERVER_GAME_INFO_EXTENDED); // reply type - p->Send_uint16(0); // flags - p->Send_uint16(0); // version + p->Send_uint8(PACKET_SERVER_GAME_INFO_EXTENDED); // reply type + p->Send_uint16(0); // flags + p->Send_uint16(SERVER_GAME_INFO_EXTENDED_MAX_VERSION); // version this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY;