Fix that sometimes 64 player servers show up as 16 player

This commit is contained in:
def 2014-01-09 15:40:11 +01:00
parent ab2563c2b5
commit ba9a29c704

View file

@ -1008,6 +1008,11 @@ void CClient::ProcessConnlessPacket(CNetChunk *pPacket)
CUnpacker Up; CUnpacker Up;
CServerInfo Info = {0}; CServerInfo Info = {0};
CServerBrowser::CServerEntry *pEntry = m_ServerBrowser.Find(pPacket->m_Address);
// Don't add info if we already got info64
if(pEntry->m_Info.m_MaxClients > VANILLA_MAX_CLIENTS)
return;
Up.Reset((unsigned char*)pPacket->m_pData+sizeof(SERVERBROWSE_INFO), pPacket->m_DataSize-sizeof(SERVERBROWSE_INFO)); Up.Reset((unsigned char*)pPacket->m_pData+sizeof(SERVERBROWSE_INFO), pPacket->m_DataSize-sizeof(SERVERBROWSE_INFO));
int Token = str_toint(Up.GetString()); int Token = str_toint(Up.GetString());
str_copy(Info.m_aVersion, Up.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), sizeof(Info.m_aVersion)); str_copy(Info.m_aVersion, Up.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), sizeof(Info.m_aVersion));