mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Also recheck official server status when json gets loaded
This commit is contained in:
parent
4f515bf67e
commit
ed5b08e7dc
|
@ -1088,6 +1088,22 @@ void CServerBrowser::LoadDDNetServers()
|
|||
}
|
||||
}
|
||||
|
||||
void CServerBrowser::RecheckOfficial()
|
||||
{
|
||||
for(int i = 0; i < m_NumDDNetCountries; i++)
|
||||
{
|
||||
CDDNetCountry *pCntr = &m_aDDNetCountries[i];
|
||||
for(int j = 0; j < pCntr->m_NumServers; j++)
|
||||
{
|
||||
CServerEntry *pEntry = Find(pCntr->m_aServers[j]);
|
||||
if(pEntry)
|
||||
{
|
||||
pEntry->m_Info.m_Official = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CServerBrowser::LoadDDNetRanks()
|
||||
{
|
||||
for(int i = 0; i < m_NumServers; i++)
|
||||
|
@ -1163,9 +1179,14 @@ const json_value *CServerBrowser::LoadDDNetInfo()
|
|||
LoadDDNetServers();
|
||||
|
||||
if(m_NumServers == 0)
|
||||
{
|
||||
Refresh(m_ServerlistType);
|
||||
}
|
||||
else
|
||||
{
|
||||
RecheckOfficial();
|
||||
LoadDDNetRanks();
|
||||
}
|
||||
|
||||
return m_pDDNetInfo;
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ public:
|
|||
void RemoveFavorite(const NETADDR &Addr);
|
||||
|
||||
void LoadDDNetRanks();
|
||||
void RecheckOfficial();
|
||||
void LoadDDNetServers();
|
||||
void LoadDDNetInfoJson();
|
||||
const json_value *LoadDDNetInfo();
|
||||
|
|
Loading…
Reference in a new issue