From 4011c6c70cb0e58b6836c4412ea7689c8e0f5d78 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 22 Mar 2014 16:23:17 +0100 Subject: [PATCH] Changed: Improvements in patch system --- code/CMakeModules/nel.cmake | 4 ++-- code/ryzom/client/src/CMakeLists.txt | 6 +++++- code/ryzom/client/src/client_cfg.cpp | 20 ++++++++++---------- code/ryzom/client/src/login_patch.cpp | 23 ++++++++++++----------- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index c7184d57e..e88465ae2 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -236,8 +236,6 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_COVERAGE "With Code Coverage Support" OFF) OPTION(WITH_PCH "With Precompiled Headers" ON ) OPTION(FINAL_VERSION "Build in Final Version mode" ON ) - OPTION(WITH_PERFHUD "Build with NVIDIA PerfHUD support" OFF ) - OPTION(WITH_PATCH_SUPPORT "Build with in-game Patch Support" OFF ) # Default to static building on Windows. IF(WIN32) @@ -325,6 +323,7 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) OPTION(WITH_LIBOVR "With LibOVR support" OFF) OPTION(WITH_LIBVR "With LibVR support" OFF) + OPTION(WITH_PERFHUD "With NVIDIA PerfHUD support" OFF) ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) MACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS) @@ -343,6 +342,7 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) OPTION(WITH_RYZOM_TOOLS "Build Ryzom Core Tools" ON ) OPTION(WITH_RYZOM_SERVER "Build Ryzom Core Services" ON ) OPTION(WITH_RYZOM_SOUND "Enable Ryzom Core Sound" ON ) + OPTION(WITH_RYZOM_PATCH "Enable Ryzom in-game patch support" OFF) ### # Optional support diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index fb9bfcaa9..4ffe21c24 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -4,8 +4,12 @@ ADD_SUBDIRECTORY(client_sheets) IF(WITH_RYZOM_CLIENT) +IF(WITH_RYZOM_PATCH) + ADD_DEFINITIONS(-DRZ_USE_PATCH) +ENDIF(WITH_RYZOM_PATCH) + # These are Windows/MFC apps - SET(SEVENZIP_LIBRARY "ryzom_sevenzip") +SET(SEVENZIP_LIBRARY "ryzom_sevenzip") ADD_SUBDIRECTORY(seven_zip) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index c45bf5d2d..c04974772 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -422,16 +422,16 @@ CClientConfig::CClientConfig() MouseOverFX = "sfx_selection_mouseover.ps"; SelectionFXSize = 0.8f; - // only force patching under Windows by default - #if WITH_PATCH_SUPPORT - PatchWanted = true; - #else - PatchWanted = false; - #endif - PatchUrl = ""; - PatchletUrl = ""; - PatchVersion = ""; - PatchServer = ""; +#if RZ_PATCH + PatchWanted = true; +#else + PatchWanted = false; +#endif + + PatchUrl.clear(); + PatchletUrl.clear(); + PatchVersion.clear(); + PatchServer.clear(); WebIgMainDomain = "atys.ryzom.com"; WebIgTrustedDomains.push_back(WebIgMainDomain); diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index ec01b3080..deffc0e3e 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -18,16 +18,14 @@ // Includes // +#include "stdpch.h" + #include -#ifdef NL_OS_WINDOWS - //windows doesnt have unistd.h -#else +#ifndef NL_OS_WINDOWS #include #endif -#include "stdpch.h" - #include #include @@ -46,10 +44,10 @@ #include "nel/misc/big_file.h" #include "nel/misc/i18n.h" -#define NL_USE_SEVENZIP 1 +#define RZ_USE_SEVENZIP 1 // 7 zip includes -#ifdef NL_USE_SEVENZIP +#ifdef RZ_USE_SEVENZIP #include "seven_zip/7zCrc.h" #include "seven_zip/7zIn.h" #include "seven_zip/7zExtract.h" @@ -746,7 +744,6 @@ void CPatchManager::deleteBatchFile() // **************************************************************************** void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool wantRyzomRestart, bool useBatchFile) { - uint nblab = 0; FILE *fp = NULL; @@ -920,7 +917,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool #ifdef NL_OS_WINDOWS fprintf(fp, "start %s %%1 %%2 %%3\n", RyzomFilename.c_str()); #else - fprintf(fp, "/opt/tita/%s $1 $2 $3\n", RyzomFilename.c_str()); + fprintf(fp, "%s $1 $2 $3\n", RyzomFilename.c_str()); #endif } @@ -1010,7 +1007,9 @@ void CPatchManager::executeBatchFile() { int errsv = errno; nlerror("Execl Error: %d %s", errsv, strCmdLine.c_str(), (char *) NULL); - } else { + } + else + { nlinfo("Ran batch file r2Mode Success"); } } @@ -1020,7 +1019,9 @@ void CPatchManager::executeBatchFile() { int errsv = errno; nlerror("Execl r2mode Error: %d %s", errsv, strCmdLine.c_str()); - } else { + } + else + { nlinfo("Ran batch file Success"); } }