mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Merge pull request #7871 from Learath2/dd_pr_oopsie
Fix client/server updates
This commit is contained in:
commit
9a8541648c
|
@ -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