Add a constant for SERVER_GAME_INFO_EXTENDED max version

Set max version correctly in QueryNetworkGameSocketHandler::SendGameInfo
pull/332/head
Jonathan G Rennison 3 years ago
parent 3cff5e53e4
commit eaf5908a0b

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

@ -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;

@ -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;

Loading…
Cancel
Save