mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
DDNET_INFO(_TMP)
This commit is contained in:
parent
29dd3e29f7
commit
e295a121e4
|
@ -2230,7 +2230,7 @@ void CClient::ResetDDNetInfo()
|
|||
void CClient::FinishDDNetInfo()
|
||||
{
|
||||
ResetDDNetInfo();
|
||||
m_pStorage->RenameFile("ddnet-info.json.tmp", "ddnet-info.json", IStorage::TYPE_SAVE);
|
||||
m_pStorage->RenameFile(DDNET_INFO_TMP, DDNET_INFO, IStorage::TYPE_SAVE);
|
||||
LoadDDNetInfo();
|
||||
}
|
||||
|
||||
|
@ -2775,7 +2775,7 @@ void CClient::Run()
|
|||
m_Fifo.Init(m_pConsole, g_Config.m_ClInputFifo, CFGFLAG_CLIENT);
|
||||
#endif
|
||||
|
||||
// loads the existing ddnet-info.json file if it exists
|
||||
// loads the existing ddnet info file if it exists
|
||||
LoadDDNetInfo();
|
||||
// but still request the new one from server
|
||||
if(g_Config.m_ClShowWelcome)
|
||||
|
@ -3769,7 +3769,7 @@ void CClient::RequestDDNetInfo()
|
|||
str_append(aUrl, aEscaped, sizeof(aUrl));
|
||||
}
|
||||
|
||||
m_pDDNetInfoTask = std::make_shared<CGetFile>(Storage(), aUrl, "ddnet-info.json.tmp", IStorage::TYPE_SAVE, true);
|
||||
m_pDDNetInfoTask = std::make_shared<CGetFile>(Storage(), aUrl, DDNET_INFO_TMP, IStorage::TYPE_SAVE, true);
|
||||
Engine()->AddJob(m_pDDNetInfoTask);
|
||||
}
|
||||
|
||||
|
|
|
@ -1105,7 +1105,7 @@ int CServerBrowser::HasRank(const char *pMap)
|
|||
void CServerBrowser::LoadDDNetInfoJson()
|
||||
{
|
||||
IStorage *pStorage = Kernel()->RequestInterface<IStorage>();
|
||||
IOHANDLE File = pStorage->OpenFile("ddnet-info.json", IOFLAG_READ, IStorage::TYPE_SAVE);
|
||||
IOHANDLE File = pStorage->OpenFile(DDNET_INFO, IOFLAG_READ, IStorage::TYPE_SAVE);
|
||||
|
||||
if(!File)
|
||||
return;
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
#include "kernel.h"
|
||||
|
||||
#define DDNET_INFO "ddnet-info.json"
|
||||
#define DDNET_INFO_TMP DDNET_INFO ".tmp"
|
||||
|
||||
/*
|
||||
Structure: CServerInfo
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue