mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix client/server updates
This commit is contained in:
parent
d60852a020
commit
31b3ac71c2
|
@ -84,6 +84,8 @@ CUpdater::CUpdater()
|
|||
m_Percent = 0;
|
||||
m_pCurrentTask = nullptr;
|
||||
|
||||
m_ClientUpdate = m_ServerUpdate = m_ClientFetched = m_ServerFetched = false;
|
||||
|
||||
IStorage::FormatTmpPath(m_aClientExecTmp, sizeof(m_aClientExecTmp), CLIENT_EXEC);
|
||||
IStorage::FormatTmpPath(m_aServerExecTmp, sizeof(m_aServerExecTmp), SERVER_EXEC);
|
||||
}
|
||||
|
@ -345,17 +347,17 @@ void CUpdater::RunningUpdate()
|
|||
}
|
||||
else
|
||||
{
|
||||
if(m_ServerUpdate)
|
||||
if(m_ServerUpdate && !m_ServerFetched)
|
||||
{
|
||||
FetchFile(PLAT_SERVER_DOWN, m_aServerExecTmp);
|
||||
m_ServerUpdate = false;
|
||||
m_ServerFetched = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_ClientUpdate)
|
||||
if(m_ClientUpdate && !m_ClientFetched)
|
||||
{
|
||||
FetchFile(PLAT_SERVER_DOWN, m_aServerExecTmp);
|
||||
m_ClientUpdate = false;
|
||||
FetchFile(PLAT_CLIENT_DOWN, m_aClientExecTmp);
|
||||
m_ClientFetched = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,9 @@ class CUpdater : public IUpdater
|
|||
bool m_ClientUpdate;
|
||||
bool m_ServerUpdate;
|
||||
|
||||
bool m_ClientFetched;
|
||||
bool m_ServerFetched;
|
||||
|
||||
void AddFileJob(const char *pFile, bool Job);
|
||||
void FetchFile(const char *pFile, const char *pDestPath = nullptr) REQUIRES(!m_Lock);
|
||||
bool MoveFile(const char *pFile);
|
||||
|
|
Loading…
Reference in a new issue