1#ifndef ENGINE_CLIENT_UPDATER_H
2#define ENGINE_CLIENT_UPDATER_H
13#define CLIENT_EXEC "DDNet"
14#define SERVER_EXEC "DDNet-Server"
16#if defined(CONF_FAMILY_WINDOWS)
17#define PLAT_EXT ".exe"
18#define PLAT_NAME CONF_PLATFORM_STRING
19#elif defined(CONF_FAMILY_UNIX)
21#if defined(CONF_ARCH_IA32)
22#define PLAT_NAME CONF_PLATFORM_STRING "-x86"
23#elif defined(CONF_ARCH_AMD64)
24#define PLAT_NAME CONF_PLATFORM_STRING "-x86_64"
26#define PLAT_NAME CONF_PLATFORM_STRING "-unsupported"
29#if defined(AUTOUPDATE)
30#error Compiling with autoupdater on an unsupported platform
33#define PLAT_NAME "unsupported-unsupported"
36#define PLAT_CLIENT_DOWN CLIENT_EXEC "-" PLAT_NAME PLAT_EXT
37#define PLAT_SERVER_DOWN SERVER_EXEC "-" PLAT_NAME PLAT_EXT
39#define PLAT_CLIENT_EXEC CLIENT_EXEC PLAT_EXT
40#define PLAT_SERVER_EXEC SERVER_EXEC PLAT_EXT
61 std::forward_list<std::pair<std::string, bool>>
m_FileJobs;
std::atomic< EState > m_State
Definition: http.h:278
Definition: updater.cpp:18
void ParseUpdate() REQUIRES(!m_Lock)
Definition: updater.cpp:236
void InitiateUpdate() REQUIRES(!m_Lock) override
Definition: updater.cpp:277
void PerformUpdate() REQUIRES(!m_Lock)
Definition: updater.cpp:283
char m_aStatus[256] GUARDED_BY(m_Lock)
bool m_ClientFetched
Definition: updater.h:68
decltype(m_FileJobs) ::iterator m_CurrentJob
Definition: updater.h:63
void GetCurrentFile(char *pBuf, int BufSize) override REQUIRES(!m_Lock)
Definition: updater.cpp:113
class IClient * m_pClient
Definition: updater.h:48
void Init(CHttp *pHttp)
Definition: updater.cpp:93
void AddFileJob(const char *pFile, bool Job)
Definition: updater.cpp:183
bool MoveFile(const char *pFile)
Definition: updater.cpp:133
std::forward_list< std::pair< std::string, bool > > m_FileJobs
Definition: updater.h:61
int m_Percent GUARDED_BY(m_Lock)
bool ReplaceServer()
Definition: updater.cpp:212
bool ReplaceClient()
Definition: updater.cpp:188
EUpdaterState m_State GUARDED_BY(m_Lock)
std::shared_ptr< CUpdaterFetchTask > m_pCurrentTask
Definition: updater.h:62
EUpdaterState GetCurrentState() override REQUIRES(!m_Lock)
Definition: updater.cpp:107
bool m_ClientUpdate
Definition: updater.h:65
class IEngine * m_pEngine
Definition: updater.h:50
class CHttp * m_pHttp
Definition: updater.h:51
CLock m_Lock
Definition: updater.h:53
char m_aClientExecTmp[64]
Definition: updater.h:58
class IStorage * m_pStorage
Definition: updater.h:49
bool m_ServerFetched
Definition: updater.h:69
char m_aServerExecTmp[64]
Definition: updater.h:59
void SetCurrentState(EUpdaterState NewState) REQUIRES(!m_Lock)
Definition: updater.cpp:101
int GetCurrentPercent() override REQUIRES(!m_Lock)
Definition: updater.cpp:119
void CommitUpdate() REQUIRES(!m_Lock)
Definition: updater.cpp:367
void Update() REQUIRES(!m_Lock) override
Definition: updater.cpp:165
bool m_ServerUpdate
Definition: updater.h:66
void RunningUpdate() REQUIRES(!m_Lock)
Definition: updater.cpp:292
void FetchFile(const char *pFile, const char *pDestPath=nullptr) REQUIRES(!m_Lock)
Definition: updater.cpp:125
EUpdaterState
Definition: updater.h:11
#define REQUIRES(...)
Definition: lock.h:32