From 09ce6492387be2ddd806420f0b2afb21d6caa709 Mon Sep 17 00:00:00 2001 From: Learath Date: Wed, 5 Nov 2014 19:15:38 +0200 Subject: [PATCH] First get rid of the old autoupdate Conflicts: src/engine/client/client.cpp src/engine/client/client.h Conflicts: src/engine/shared/config_variables.h --- src/engine/autoupdate.h | 22 - src/engine/client/autoupdate.cpp | 457 ------------------ src/engine/client/autoupdate.h | 40 -- src/engine/client/client.cpp | 26 +- src/engine/client/client.h | 9 - src/engine/shared/config_variables.h | 1 - src/game/client/component.h | 3 - src/game/client/components/menus.cpp | 31 -- src/game/client/components/menus.h | 1 - src/game/client/components/menus_settings.cpp | 26 +- src/game/client/gameclient.cpp | 5 - src/game/client/gameclient.h | 6 - 12 files changed, 10 insertions(+), 617 deletions(-) delete mode 100644 src/engine/autoupdate.h delete mode 100644 src/engine/client/autoupdate.cpp delete mode 100644 src/engine/client/autoupdate.h diff --git a/src/engine/autoupdate.h b/src/engine/autoupdate.h deleted file mode 100644 index 0f5fe078d..000000000 --- a/src/engine/autoupdate.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - unsigned char* -*/ -#ifndef ENGINE_AUTOUPDATE_H -#define ENGINE_AUTOUPDATE_H - -#include "kernel.h" -#include -#include - -class IAutoUpdate : public IInterface -{ - MACRO_INTERFACE("autoupdate", 0) -public: - virtual void CheckUpdates(CMenus *pMenus) = 0; - virtual void DoUpdates(CMenus *pMenus) = 0; - virtual bool Updated() = 0; - virtual bool NeedResetClient() = 0; - virtual void ExecuteExit() = 0; -}; - -#endif diff --git a/src/engine/client/autoupdate.cpp b/src/engine/client/autoupdate.cpp deleted file mode 100644 index afea70e0f..000000000 --- a/src/engine/client/autoupdate.cpp +++ /dev/null @@ -1,457 +0,0 @@ -#include -#include -#include - -#if defined(CONF_FAMILY_UNIX) - #include - #include - - /* unix net includes */ - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - #include - -#elif defined(CONF_FAMILY_WINDOWS) - #define WIN32_LEAN_AND_MEAN - #define _WIN32_WINNT 0x0501 /* required for mingw to get getaddrinfo to work */ - #include - #include - #include - #include - #include - #include - #include - #include -#else - #error NOT IMPLEMENTED -#endif -#include -#include //remove - -#include - -#include "autoupdate.h" - -static NETSOCKET invalid_socket = {NETTYPE_INVALID, -1, -1}; - -CAutoUpdate::CAutoUpdate() -{ - Reset(); -} - -void CAutoUpdate::Reset() -{ - m_NeedUpdate = false; - m_NeedUpdateBackground = false; - m_NeedUpdateClient = false; - m_NeedUpdateServer = false; - m_NeedResetClient = false; - m_Updated = false; - m_vFiles.clear(); -} - -bool CAutoUpdate::CanUpdate(const char *pFile) -{ - std::list::iterator it = m_vFiles.begin(); - while (it != m_vFiles.end()) - { - if ((*it).compare(pFile) == 0) - return false; - - it++; - } - - return true; -} - -void CAutoUpdate::ExecuteExit() -{ - if (!m_NeedResetClient) - return - - dbg_msg("autoupdate", "Executing pre-quiting..."); - - if (m_NeedUpdateClient) - { - SelfDelete(); - #if defined(CONF_FAMILY_WINDOWS) - ShellExecuteA(0,0,"du.bat",0,0,SW_HIDE); - #else - if (rename("DDNet_tmp","DDNet")) - dbg_msg("autoupdate", "Error renaming binary file"); - if (system("chmod +x DDNet")) - dbg_msg("autoupdate", "Error setting executable bit"); - #endif - } - - #if defined(CONF_FAMILY_WINDOWS) - if (!m_NeedUpdateClient) - ShellExecuteA(0,0,"DDNet.exe",0,0,SW_SHOW); - #else - pid_t pid; - pid=fork(); - if (pid==0) - { - char* argv[1]; - argv[0] = NULL; - execv("DDNet", argv); - } - else - return; - #endif -} - -void CAutoUpdate::CheckUpdates(CMenus *pMenus) -{ - char aReadBuf[512]; - dbg_msg("autoupdate", "Checking for updates"); - if (!GetFile("ddnet.upd", "ddnet.upd")) - { - dbg_msg("autoupdate", "Error downloading update list"); - return; - } - - dbg_msg("autoupdate", "Processing data"); - - Reset(); - IOHANDLE updFile = io_open("ddnet.upd", IOFLAG_READ); - if (!updFile) - return; - - //read data - std::string ReadData; - char last_version[15]; - char cmd; - while (io_read(updFile, aReadBuf, sizeof(aReadBuf)) > 0) - { - for (size_t i=0; i0 && aReadBuf[i-1] == '\r') - ReadData = ReadData.substr(0, -2); - - //Parse Command - cmd = ReadData[0]; - if (cmd == '#') - { - str_copy(last_version, ReadData.substr(1).c_str(), sizeof(last_version)); - - if (ReadData.substr(1).compare(GAME_RELEASE_VERSION) != 0) - pMenus->setPopup(CMenus::POPUP_AUTOUPDATE); - else - dbg_msg("autoupdate", "Version match"); - - io_close(updFile); - return; - } - ReadData.clear(); - } - - ReadData+=aReadBuf[i]; - } - } - - io_close(updFile); -} - -void CAutoUpdate::DoUpdates(CMenus *pMenus) -{ - char aReadBuf[512]; - char aBuf[512]; - - dbg_msg("autoupdate", "Processing data"); - - Reset(); - IOHANDLE updFile = io_open("ddnet.upd", IOFLAG_READ); - if (!updFile) - return; - - //read data - std::string ReadData; - char last_version[15], current_version[15]; - char cmd; - while (io_read(updFile, aReadBuf, sizeof(aReadBuf)) > 0) - { - for (size_t i=0; i0 && aReadBuf[i-1] == '\r') - ReadData = ReadData.substr(0, -2); - - //Parse Command - cmd = ReadData[0]; - if (cmd == '#') - { - if (!m_NeedUpdate) - str_copy(last_version, ReadData.substr(1).c_str(), sizeof(last_version)); - if (ReadData.substr(1).compare(GAME_RELEASE_VERSION) != 0) - m_NeedUpdate = true; - else - { - dbg_msg("autoupdate", "Version match"); - goto finish; - } - - str_copy(current_version, ReadData.substr(1).c_str(), sizeof(current_version)); - } - - if (m_NeedUpdate) - { - if (cmd == '@') - { - if (!m_NeedUpdateClient && ReadData.substr(2).compare("UPDATE_CLIENT") == 0) - { - str_format(aBuf, sizeof(aBuf), "Updating DDNet Client to %s", last_version); - pMenus->RenderUpdating(aBuf); - - m_NeedUpdateClient = true; - m_NeedResetClient = true; - dbg_msg("autoupdate", "Updating client"); - #if defined(CONF_FAMILY_WINDOWS) - if (!GetFile("DDNet.exe", "DDNet_tmp.exe")) - #elif defined(CONF_ARCH_AMD64) - if (!GetFile("DDNet64", "DDNet_tmp")) - #else - if (!GetFile("DDNet", "DDNet_tmp")) - #endif - dbg_msg("autoupdate", "Error downloading new version"); - } - if (!m_NeedUpdateServer && ReadData.substr(2).compare("UPDATE_SERVER") == 0) - { - str_format(aBuf, sizeof(aBuf), "Updating DDNet Server to %s", last_version); - pMenus->RenderUpdating(aBuf); - - m_NeedUpdateServer = true; - dbg_msg("autoupdate", "Updating server"); - #if defined(CONF_FAMILY_WINDOWS) - if (!GetFile("DDNet-Server.exe", "DDNet-Server.exe")) - #elif defined(CONF_ARCH_AMD64) - if (!GetFile("DDNet-Server64", "DDNet-Server")) - #else - if (!GetFile("DDNet-Server", "DDNet-Server")) - #endif - dbg_msg("autoupdate", "Error downloading new version"); - } - else if (!m_NeedUpdateClient && ReadData.substr(2).compare("RESET_CLIENT") == 0) - m_NeedResetClient = true; - } - else if (cmd == 'D') - { - int posDel=0; - ReadData = ReadData.substr(2); - posDel = ReadData.find_first_of(":"); - - if (CanUpdate(ReadData.substr(posDel+1).c_str())) - { - str_format(aBuf, sizeof(aBuf), "Downloading '%s'", ReadData.substr(posDel+1).c_str()); - pMenus->RenderUpdating(aBuf); - - dbg_msg("autoupdate", "Updating file '%s'", ReadData.substr(posDel+1).c_str()); - if (!GetFile(ReadData.substr(0, posDel).c_str(), ReadData.substr(posDel+1).c_str())) - dbg_msg("autoupdate", "Error downloading '%s'", ReadData.substr(0, posDel).c_str()); - else - m_vFiles.push_back(ReadData.substr(posDel+1)); - } - } - else if (cmd == 'R') - { - if (ReadData.substr(2).c_str()[0] == 0) - return; - - if (CanUpdate(ReadData.substr(2).c_str())) - { - str_format(aBuf, sizeof(aBuf), "Deleting '%s'", ReadData.substr(2).c_str()); - pMenus->RenderUpdating(aBuf); - - dbg_msg("autoupdate", "Deleting file '%s'", ReadData.substr(2).c_str()); - remove(ReadData.substr(2).c_str()); - - m_vFiles.push_back(ReadData.substr(2)); - } - } - } - - ReadData.clear(); - continue; - } - - ReadData+=aReadBuf[i]; - } - - if (!m_NeedUpdate) - break; - } - - finish: - if (m_NeedUpdate) - { - m_Updated = true; - m_NeedUpdate = false; - - if (!m_NeedUpdateClient) - dbg_msg("autoupdate", "Updated successfully"); - else - dbg_msg("autoupdate", "Restart necessary"); - } - else - dbg_msg("autoupdate", "No updates available"); - - io_close(updFile); - - if (m_Updated) - { - if (m_NeedUpdateClient) - { - pMenus->Client()->Quit(); - return; - } - - str_format(aBuf, sizeof(aBuf), "DDNet Client updated successfully"); - pMenus->RenderUpdating(aBuf); - thread_sleep(200); - } - else - { - str_format(aBuf, sizeof(aBuf), "No update available"); - pMenus->RenderUpdating(aBuf); - thread_sleep(200); - } -} - -bool CAutoUpdate::GetFile(const char *pFile, const char *dst) -{ - NETSOCKET Socket = invalid_socket; - NETADDR HostAddress; - char aNetBuff[1024]; - - //Lookup - if(net_host_lookup(g_Config.m_ClDDNetUpdateServer, &HostAddress, NETTYPE_IPV4) != 0) - { - dbg_msg("autoupdate", "Error running host lookup"); - return false; - } - - char aAddrStr[NETADDR_MAXSTRSIZE]; - net_addr_str(&HostAddress, aAddrStr, sizeof(aAddrStr), 80); - - //Connect - int socketID = socket(AF_INET, SOCK_STREAM, 0); - if(socketID < 0) - { - dbg_msg("autoupdate", "Error creating socket"); - return false; - } - - Socket.type = NETTYPE_IPV4; - Socket.ipv4sock = socketID; - HostAddress.port = 80; - - if(net_tcp_connect(Socket, &HostAddress) != 0) - { - net_tcp_close(Socket); - dbg_msg("autoupdate","Error connecting to host"); - return false; - } - - //Send request - str_format(aNetBuff, sizeof(aNetBuff), "GET /%s HTTP/1.0\nHOST: %s\n\n", pFile, g_Config.m_ClDDNetUpdateServer); - net_tcp_send(Socket, aNetBuff, strlen(aNetBuff)); - - //read data - IOHANDLE dstFile = io_open(dst, IOFLAG_WRITE); - if (!dstFile) - { - net_tcp_close(Socket); - dbg_msg("autoupdate","Error writing to disk"); - return false; - } - - std::string NetData; - int TotalRecv = 0; - int TotalBytes = 0; - int CurrentRecv = 0; - bool isHead = true; - int enterCtrl = 0; - while ((CurrentRecv = net_tcp_recv(Socket, aNetBuff, sizeof(aNetBuff))) > 0) - { - for (int i=0; i 0 && str_comp_nocase(NetData.substr(0, posDel).c_str(),"content-length") == 0) - TotalBytes = atoi(NetData.substr(posDel+2).c_str()); - - NetData.clear(); - continue; - } - else if (aNetBuff[i]!='\r') - enterCtrl=0; - - NetData+=aNetBuff[i]; - } - else - { - if (TotalBytes == 0) - { - io_close(dstFile); - net_tcp_close(Socket); - dbg_msg("autoupdate","Error receiving file"); - return false; - } - - io_write(dstFile, &aNetBuff[i], 1); - - TotalRecv++; - if (TotalRecv == TotalBytes) - break; - } - } - } - - //Finish - io_close(dstFile); - net_tcp_close(Socket); - - return true; -} - -bool CAutoUpdate::SelfDelete() -{ - #ifdef CONF_FAMILY_WINDOWS - IOHANDLE bhFile = io_open("du.bat", IOFLAG_WRITE); - if (!bhFile) - return false; - - char aFileData[512]; - str_format(aFileData, sizeof(aFileData), ":_R\r\ndel \"DDNet.exe\"\r\nif exist \"DDNet.exe\" goto _R\r\nrename \"DDNet_tmp.exe\" \"DDNet.exe\"\r\n:_T\r\nif not exist \"DDNet.exe\" goto _T\r\nstart DDNet.exe\r\ndel \"du.bat\"\r\n"); - io_write(bhFile, aFileData, str_length(aFileData)); - io_close(bhFile); - #else - remove("DDNet"); - return true; - #endif - - return false; -} diff --git a/src/engine/client/autoupdate.h b/src/engine/client/autoupdate.h deleted file mode 100644 index e2095ac45..000000000 --- a/src/engine/client/autoupdate.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - unsigned char* -*/ -#ifndef ENGINE_CLIENT_AUTOUPDATE_H -#define ENGINE_CLIENT_AUTOUPDATE_H - -#include -#include -#include -#include - -class CAutoUpdate : public IAutoUpdate -{ -public: - CAutoUpdate(); - - void Reset(); - - void CheckUpdates(CMenus *pMenus); - void DoUpdates(CMenus *pMenus); - bool Updated() { return m_Updated; } - bool NeedResetClient() { return m_NeedResetClient; } - void ExecuteExit(); - -private: - bool m_Updated; - bool m_NeedUpdate; - bool m_NeedUpdateBackground; - bool m_NeedUpdateClient; - bool m_NeedUpdateServer; - bool m_NeedResetClient; - std::list m_vFiles; - -protected: - bool SelfDelete(); - bool GetFile(const char *pFile, const char *dst); - bool CanUpdate(const char *pFile); -}; - -#endif diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 957a0b43d..b2667898f 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -60,13 +59,10 @@ #include "friends.h" #include "serverbrowser.h" #include "fetcher.h" -#include "autoupdate.h" #include "client.h" #include - - #include "SDL.h" #ifdef main #undef main @@ -1171,15 +1167,6 @@ void CClient::ProcessConnlessPacket(CNetChunk *pPacket) if(!VersionMatch) { str_copy(m_aVersionStr, aVersion, sizeof(m_aVersionStr)); - -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - if (g_Config.m_ClAutoUpdate) - { - str_format(aBuf, sizeof(aBuf), "Checking for updates"); - ((CGameClient *) GameClient())->m_pMenus->RenderUpdating(aBuf); - ((CGameClient *) GameClient())->AutoUpdate()->CheckUpdates(((CGameClient *) GameClient())->m_pMenus); - } -#endif } // request the news @@ -2487,9 +2474,6 @@ void CClient::RegisterInterfaces() Kernel()->RegisterInterface(static_cast(&m_DemoPlayer)); Kernel()->RegisterInterface(static_cast(&m_ServerBrowser)); Kernel()->RegisterInterface(static_cast(&m_Fetcher)); -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - Kernel()->RegisterInterface(static_cast(&m_AutoUpdate)); -#endif Kernel()->RegisterInterface(static_cast(&m_Friends)); } @@ -2505,12 +2489,8 @@ void CClient::InitInterfaces() m_pMap = Kernel()->RequestInterface(); m_pMasterServer = Kernel()->RequestInterface(); m_pFetcher = Kernel()->RequestInterface(); -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - m_pAutoUpdate = Kernel()->RequestInterface(); -#endif m_pStorage = Kernel()->RequestInterface(); - m_DemoEditor.Init(m_pGameClient->NetVersion(), &m_SnapshotDelta, m_pConsole, m_pStorage); m_ServerBrowser.SetBaseInfo(&m_NetClient[2], m_pGameClient->NetVersion()); @@ -3281,11 +3261,7 @@ int main(int argc, const char **argv) // ignore_convention // write down the config and quit pConfig->Save(); - -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - pClient->AutoUpdate()->ExecuteExit(); -#endif - + return 0; } diff --git a/src/engine/client/client.h b/src/engine/client/client.h index a2c80d932..5228b4ee7 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -64,9 +64,6 @@ class CClient : public IClient, public CDemoPlayer::IListner IConsole *m_pConsole; IStorage *m_pStorage; IFetcher *m_pFetcher; -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - IAutoUpdate *m_pAutoUpdate; -#endif IEngineMasterServer *m_pMasterServer; enum @@ -81,9 +78,6 @@ class CClient : public IClient, public CDemoPlayer::IListner class CDemoEditor m_DemoEditor; class CServerBrowser m_ServerBrowser; class CFetcher m_Fetcher; -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - class CAutoUpdate m_AutoUpdate; -#endif class CFriends m_Friends; class CMapChecker m_MapChecker; @@ -208,9 +202,6 @@ public: IEngineMasterServer *MasterServer() { return m_pMasterServer; } IStorage *Storage() { return m_pStorage; } IFetcher *Fetcher() { return m_pFetcher; } -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - IAutoUpdate *AutoUpdate() { return m_pAutoUpdate; } -#endif CClient(); diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 8407cc940..5428cded1 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -336,7 +336,6 @@ MACRO_CONFIG_INT(ClShowNinja, cl_show_ninja, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAV MACRO_CONFIG_INT(ClShowOtherHookColl, cl_show_other_hook_coll, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show other players' hook collision line") MACRO_CONFIG_INT(ClChatTeamColors, cl_chat_teamcolors, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show names in chat in team colors") MACRO_CONFIG_INT(ClShowDirection, cl_show_direction, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Show tee direction") -MACRO_CONFIG_INT(ClAutoUpdate, cl_auto_update, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Auto-Update") MACRO_CONFIG_INT(ClHttpMapDownload, cl_http_map_download, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Try fast HTTP map download first") MACRO_CONFIG_INT(ClOldGunPosition, cl_old_gun_position, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Tees hold gun a bit higher like in TW 0.6.1 and older") MACRO_CONFIG_INT(ClConfirmDisconnect, cl_confirm_disconnect, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Confirmation popup before disconnecting") diff --git a/src/game/client/component.h b/src/game/client/component.h index 030764292..211ecc6c1 100644 --- a/src/game/client/component.h +++ b/src/game/client/component.h @@ -26,9 +26,6 @@ protected: class IDemoPlayer *DemoPlayer() const { return m_pClient->DemoPlayer(); } class IDemoRecorder *DemoRecorder(int Recorder) const { return m_pClient->DemoRecorder(Recorder); } class IServerBrowser *ServerBrowser() const { return m_pClient->ServerBrowser(); } -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - class IAutoUpdate *AutoUpdate() const { return m_pClient->AutoUpdate(); } -#endif class CLayers *Layers() const { return m_pClient->Layers(); } class CCollision *Collision() const { return m_pClient->Collision(); } public: diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index e6e3c7392..5235f6583 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -1094,14 +1093,6 @@ int CMenus::Render() pButtonText = Localize("Ok"); ExtraAlign = -1; } -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - else if(m_Popup == POPUP_AUTOUPDATE) - { - pTitle = Localize("Auto-Update"); - pExtraText = Localize("An update to DDNet client is available. Do you want to update now? This will restart the client. If an update fails, make sure the client has permissions to modify files."); - ExtraAlign = -1; - } -#endif CUIRect Box, Part; Box = Screen; @@ -1185,28 +1176,6 @@ int CMenus::Render() if(DoButton_Menu(&s_ButtonTryAgain, Localize("Yes"), 0, &Yes) || m_EnterPressed) Client()->Disconnect(); } -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - else if(m_Popup == POPUP_AUTOUPDATE) - { - CUIRect Yes, No; - Box.HSplitBottom(20.f, &Box, &Part); - Box.HSplitBottom(24.f, &Box, &Part); - - // buttons - Part.VMargin(80.0f, &Part); - Part.VSplitMid(&No, &Yes); - Yes.VMargin(20.0f, &Yes); - No.VMargin(20.0f, &No); - - static int s_ButtonAbort = 0; - if(DoButton_Menu(&s_ButtonAbort, Localize("No"), 0, &No) || m_EscapePressed) - m_Popup = POPUP_NONE; - - static int s_ButtonTryAgain = 0; - if(DoButton_Menu(&s_ButtonTryAgain, Localize("Yes"), 0, &Yes) || m_EnterPressed) - m_pClient->AutoUpdate()->DoUpdates(this); - } -#endif else if(m_Popup == POPUP_PASSWORD) { CUIRect Label, TextBox, TryAgain, Abort; diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 5d168b368..f7e2f9047 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -332,7 +332,6 @@ public: POPUP_SOUNDERROR, POPUP_PASSWORD, POPUP_QUIT, - POPUP_AUTOUPDATE, POPUP_DISCONNECT, // demo player states diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index f46d916ce..68714846c 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -1784,24 +1783,17 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView) Miscellaneous.VSplitMid(&Left, &Right); Left.VSplitRight(5.0f, &Left, 0); Right.VMargin(5.0f, &Right); - - // Auto Update -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - CUIRect HUDItem; - Left.HSplitTop(20.0f, &HUDItem, &Left); - HUDItem.VSplitMid(&HUDItem, &Button); - if(DoButton_CheckBox(&g_Config.m_ClAutoUpdate, Localize("Auto-Update"), g_Config.m_ClAutoUpdate, &HUDItem)) - g_Config.m_ClAutoUpdate ^= 1; - Button.Margin(2.0f, &Button); - static int s_ButtonAutoUpdate = 0; - if (DoButton_Menu((void*)&s_ButtonAutoUpdate, Localize("Check now"), 0, &Button)) + Left.HSplitTop(20.0f, &Button, &Left); + if(DoButton_CheckBox(&g_Config.m_ClDDRaceBinds, Localize("Bind free keys with DDRace binds"), g_Config.m_ClDDRaceBinds, &Button)) { - char aBuf[128]; - str_format(aBuf, sizeof(aBuf), "Checking for an update"); - RenderUpdating(aBuf); - AutoUpdate()->CheckUpdates(this); + g_Config.m_ClDDRaceBinds ^= 1; + } + + Right.HSplitTop(20.0f, &Button, &Right); + if(DoButton_CheckBox(&g_Config.m_ClEditorUndo, Localize("Undo function in editor (could be buggy)"), g_Config.m_ClEditorUndo, &Button)) + { + g_Config.m_ClEditorUndo ^= 1; } -#endif Left.HSplitTop(20.0f, &Button, &Left); if(DoButton_CheckBox(&g_Config.m_ClHttpMapDownload, Localize("Try fast HTTP map download first"), g_Config.m_ClHttpMapDownload, &Button)) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index d8b111265..934f1c4f1 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -19,8 +19,6 @@ #include #include -#include - #include #include #include "render.h" @@ -123,9 +121,6 @@ void CGameClient::OnConsoleInit() m_pStorage = Kernel()->RequestInterface(); m_pDemoPlayer = Kernel()->RequestInterface(); m_pServerBrowser = Kernel()->RequestInterface(); -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - m_pAutoUpdate = Kernel()->RequestInterface(); -#endif m_pEditor = Kernel()->RequestInterface(); m_pFriends = Kernel()->RequestInterface(); diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index 8b715ebcc..1990503e6 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -93,9 +93,6 @@ class CGameClient : public IGameClient class IStorage *m_pStorage; class IDemoPlayer *m_pDemoPlayer; class IServerBrowser *m_pServerBrowser; -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - class IAutoUpdate *m_pAutoUpdate; -#endif class IEditor *m_pEditor; class IFriends *m_pFriends; @@ -133,9 +130,6 @@ public: class IDemoPlayer *DemoPlayer() const { return m_pDemoPlayer; } class IDemoRecorder *DemoRecorder(int Recorder) const { return Client()->DemoRecorder(Recorder); } class IServerBrowser *ServerBrowser() const { return m_pServerBrowser; } -#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__) - class IAutoUpdate *AutoUpdate() const { return m_pAutoUpdate; } -#endif class CRenderTools *RenderTools() { return &m_RenderTools; } class CLayers *Layers() { return &m_Layers; }; class CCollision *Collision() { return &m_Collision; };