mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Compare commits
5 commits
01daa919e8
...
acfe26e715
Author | SHA1 | Date | |
---|---|---|---|
acfe26e715 | |||
f3c246f622 | |||
b72d89b5cf | |||
28f052eaf2 | |||
03aab986fe |
Binary file not shown.
|
@ -400,21 +400,24 @@ void CServerBrowserHttp::Update()
|
|||
Success = Success && pJson;
|
||||
Success = Success && !Parse(pJson, &m_vServers, &m_vLegacyServers);
|
||||
json_value_free(pJson);
|
||||
int Age = SanitizeAge(pGetServers->ResultAgeSeconds());
|
||||
if(!Success)
|
||||
{
|
||||
log_error("serverbrowser_http", "failed getting serverlist, trying to find best URL");
|
||||
m_pChooseMaster->Reset();
|
||||
m_pChooseMaster->Refresh();
|
||||
}
|
||||
// Try to find new master if the current one returns results
|
||||
// that are 5 minutes old.
|
||||
else if(Age > 300)
|
||||
else
|
||||
{
|
||||
// Try to find new master if the current one returns
|
||||
// results that are 5 minutes old.
|
||||
int Age = SanitizeAge(pGetServers->ResultAgeSeconds());
|
||||
if(Age > 300)
|
||||
{
|
||||
log_info("serverbrowser_http", "got stale serverlist, age=%ds, trying to find best URL", Age);
|
||||
m_pChooseMaster->Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void CServerBrowserHttp::Refresh()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue