mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Use old ddnet-ranks.json when new one can't be fetched currently
This commit is contained in:
parent
e36d7ce9a1
commit
8ebac31c03
|
@ -2274,6 +2274,7 @@ void CClient::ResetDDNetRanks()
|
||||||
void CClient::FinishDDNetRanks()
|
void CClient::FinishDDNetRanks()
|
||||||
{
|
{
|
||||||
ResetDDNetRanks();
|
ResetDDNetRanks();
|
||||||
|
m_pStorage->RenameFile("ddnet-ranks.json.tmp", "ddnet-ranks.json", IStorage::TYPE_SAVE);
|
||||||
m_ServerBrowser.LoadDDNetRanks();
|
m_ServerBrowser.LoadDDNetRanks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3780,7 +3781,7 @@ void CClient::RequestDDNetRanks()
|
||||||
str_format(aUrl, sizeof(aUrl), "https://ddnet.tw/players/?json=%s", aEscaped);
|
str_format(aUrl, sizeof(aUrl), "https://ddnet.tw/players/?json=%s", aEscaped);
|
||||||
|
|
||||||
m_pDDNetRanksTask = new CFetchTask(true, /*UseDDNetCA*/ true);
|
m_pDDNetRanksTask = new CFetchTask(true, /*UseDDNetCA*/ true);
|
||||||
Fetcher()->QueueAdd(m_pDDNetRanksTask, aUrl, "ddnet-ranks.json", IStorage::TYPE_SAVE);
|
Fetcher()->QueueAdd(m_pDDNetRanksTask, aUrl, "ddnet-ranks.json.tmp", IStorage::TYPE_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CClient::GetPredictionTime()
|
int CClient::GetPredictionTime()
|
||||||
|
|
|
@ -594,6 +594,7 @@ void CServerBrowser::Refresh(int Type)
|
||||||
else if(Type == IServerBrowser::TYPE_DDNET)
|
else if(Type == IServerBrowser::TYPE_DDNET)
|
||||||
{
|
{
|
||||||
LoadDDNetServers();
|
LoadDDNetServers();
|
||||||
|
LoadDDNetRanks();
|
||||||
|
|
||||||
// remove unknown elements of exclude list
|
// remove unknown elements of exclude list
|
||||||
DDNetCountryFilterClean();
|
DDNetCountryFilterClean();
|
||||||
|
|
Loading…
Reference in a new issue