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()
|
||||
{
|
||||
ResetDDNetRanks();
|
||||
m_pStorage->RenameFile("ddnet-ranks.json.tmp", "ddnet-ranks.json", IStorage::TYPE_SAVE);
|
||||
m_ServerBrowser.LoadDDNetRanks();
|
||||
}
|
||||
|
||||
|
@ -3780,7 +3781,7 @@ void CClient::RequestDDNetRanks()
|
|||
str_format(aUrl, sizeof(aUrl), "https://ddnet.tw/players/?json=%s", aEscaped);
|
||||
|
||||
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()
|
||||
|
|
|
@ -594,6 +594,7 @@ void CServerBrowser::Refresh(int Type)
|
|||
else if(Type == IServerBrowser::TYPE_DDNET)
|
||||
{
|
||||
LoadDDNetServers();
|
||||
LoadDDNetRanks();
|
||||
|
||||
// remove unknown elements of exclude list
|
||||
DDNetCountryFilterClean();
|
||||
|
|
Loading…
Reference in a new issue