From c09d7e6884d4c542ee45f64156ab2cba3d1dba44 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 21 Dec 2015 17:39:49 +0100 Subject: [PATCH] Merge with develop --- code/CMakeModules/nel.cmake | 117 +++++++++--------- code/ryzom/client/client_default.cfg | 14 +-- code/ryzom/client/src/CMakeLists.txt | 6 +- code/ryzom/client/src/client_cfg.cpp | 12 +- code/ryzom/client/src/client_cfg.h | 1 - code/ryzom/client/src/login.cpp | 13 +- code/ryzom/client/src/login_patch.cpp | 7 +- .../tools/client/client_patcher/main.cpp | 10 +- 8 files changed, 100 insertions(+), 80 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index bb19183b8..c51752c72 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -218,6 +218,11 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_EXTERNAL "With provided external." OFF) ENDIF(WIN32) OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF) + IF(UNIX AND NOT APPLE) + OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON ) + ELSE() + OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" OFF) + ENDIF() OPTION(WITH_INSTALL_LIBRARIES "Install development files." ON ) OPTION(WITH_ASSIMP "Use assimp exporter" OFF) @@ -315,7 +320,6 @@ 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 @@ -324,6 +328,8 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) OPTION(WITH_LUA52 "Build Ryzom Core using Lua 5.2" OFF) OPTION(WITH_LUA53 "Build Ryzom Core using Lua 5.3" OFF) OPTION(WITH_RYZOM_CLIENT_UAC "Ask to run as Administrator" OFF) + OPTION(WITH_RYZOM_PATCH "Enable Ryzom in-game patch support" OFF) + OPTION(WITH_RYZOM_CUSTOM_PATCH_SERVER "Only use patch server from CFG file" OFF) ENDMACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS) @@ -908,121 +914,120 @@ ENDMACRO(NL_SETUP_BUILD_FLAGS) MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE) IF(IS_ABSOLUTE "${${NAME_RELATIVE}}") SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) - ELSE(IS_ABSOLUTE "${${NAME_RELATIVE}}") - IF(WIN32) - SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) - ELSE(WIN32) + ELSE() + IF(WITH_UNIX_STRUCTURE) SET(${NAME_ABSOLUTE} ${CMAKE_INSTALL_PREFIX}/${${NAME_RELATIVE}}) - ENDIF(WIN32) + ELSE() + SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) + ENDIF() ENDIF(IS_ABSOLUTE "${${NAME_RELATIVE}}") ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX) MACRO(NL_SETUP_PREFIX_PATHS) ## Allow override of install_prefix/etc path. IF(NOT NL_ETC_PREFIX) - IF(WIN32) - SET(NL_ETC_PREFIX "." CACHE PATH "Installation path for configurations") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(NL_ETC_PREFIX "etc/nel" CACHE PATH "Installation path for configurations") - ENDIF(WIN32) - ENDIF(NOT NL_ETC_PREFIX) + ELSE() + SET(NL_ETC_PREFIX "." CACHE PATH "Installation path for configurations") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_ETC_PREFIX NL_ETC_ABSOLUTE_PREFIX) ## Allow override of install_prefix/share path. IF(NOT NL_SHARE_PREFIX) - IF(WIN32) - SET(NL_SHARE_PREFIX "." CACHE PATH "Installation path for data.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(NL_SHARE_PREFIX "share/nel" CACHE PATH "Installation path for data.") - ENDIF(WIN32) - ENDIF(NOT NL_SHARE_PREFIX) + ELSE() + SET(NL_SHARE_PREFIX "." CACHE PATH "Installation path for data.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_SHARE_PREFIX NL_SHARE_ABSOLUTE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT NL_SBIN_PREFIX) - IF(WIN32) - SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.") - ENDIF(WIN32) - ENDIF(NOT NL_SBIN_PREFIX) + ELSE() + SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_SBIN_PREFIX NL_SBIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT NL_BIN_PREFIX) - IF(WIN32) - SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.") - ENDIF(WIN32) - ENDIF(NOT NL_BIN_PREFIX) + ELSE() + SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_BIN_PREFIX NL_BIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/lib path. IF(NOT NL_LIB_PREFIX) IF(LIBRARY_ARCHITECTURE) SET(NL_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.") - ELSE(LIBRARY_ARCHITECTURE) + ELSE() SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.") - ENDIF(LIBRARY_ARCHITECTURE) - ENDIF(NOT NL_LIB_PREFIX) + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX) ## Allow override of install_prefix/lib path. IF(NOT NL_DRIVER_PREFIX) - IF(WIN32) - SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) IF(LIBRARY_ARCHITECTURE) SET(NL_DRIVER_PREFIX "lib/${LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.") - ELSE(LIBRARY_ARCHITECTURE) + ELSE() SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.") - ENDIF(LIBRARY_ARCHITECTURE) - ENDIF(WIN32) - ENDIF(NOT NL_DRIVER_PREFIX) + ENDIF() + ELSE() + SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_DRIVER_PREFIX NL_DRIVER_ABSOLUTE_PREFIX) - ENDMACRO(NL_SETUP_PREFIX_PATHS) MACRO(RYZOM_SETUP_PREFIX_PATHS) ## Allow override of install_prefix/etc path. IF(NOT RYZOM_ETC_PREFIX) - IF(WIN32) - SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(RYZOM_ETC_PREFIX "etc/ryzom" CACHE PATH "Installation path for configurations") - ENDIF(WIN32) + ELSE() + SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations") + ENDIF() ENDIF(NOT RYZOM_ETC_PREFIX) NL_MAKE_ABSOLUTE_PREFIX(RYZOM_ETC_PREFIX RYZOM_ETC_ABSOLUTE_PREFIX) ## Allow override of install_prefix/share path. IF(NOT RYZOM_SHARE_PREFIX) - IF(WIN32) - SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(RYZOM_SHARE_PREFIX "share/ryzom" CACHE PATH "Installation path for data.") - ENDIF(WIN32) - ENDIF(NOT RYZOM_SHARE_PREFIX) + ELSE() + SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SHARE_PREFIX RYZOM_SHARE_ABSOLUTE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT RYZOM_SBIN_PREFIX) - IF(WIN32) - SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.") - ENDIF(WIN32) - ENDIF(NOT RYZOM_SBIN_PREFIX) + ELSE() + SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SBIN_PREFIX RYZOM_SBIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT RYZOM_BIN_PREFIX) - IF(WIN32) - SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.") - ENDIF(WIN32) - ENDIF(NOT RYZOM_BIN_PREFIX) + ELSE() + SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_BIN_PREFIX RYZOM_BIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/lib path. diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index 3f6f7e182..4b0e70e76 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -417,18 +417,18 @@ LoadingStringCount = 54; // Some R2 parameters ... -R2Mode = 1; +R2Mode = 1; R2EDEnabled = 1; R2EDExtendedDebug = 0; R2EDLightPalette = 0; R2ClientGw = "r2linux01"; -LoadLuaDebugger = 0; -CheckR2ScenarioMD5 = 1; -LevelDesignEnabled = 0; +LoadLuaDebugger = 0; +CheckR2ScenarioMD5 = 1; +LevelDesignEnabled = 0; -DmCameraDistMax = 25; -DmRun = 20; -DmWalk = 6; +DmCameraDistMax = 25; +DmRun = 20; +DmWalk = 6; R2EDReloadFiles = { "r2ed.xml", diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index d5b37d048..7707e0d0e 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -10,6 +10,10 @@ ADD_SUBDIRECTORY(seven_zip) IF(WITH_RYZOM_PATCH) ADD_DEFINITIONS(-DRZ_USE_PATCH) + + IF(WITH_RYZOM_CUSTOM_PATCH_SERVER) + ADD_DEFINITIONS(-DRZ_USE_CUSTOM_PATCH_SERVER) + ENDIF() ENDIF() FILE(GLOB CFG ../*.cfg) @@ -98,8 +102,6 @@ IF(APPLE) ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign -fs "${APPLE_CERTIFICATE}" "${RYZOM_OUTPUT_DIR}" COMMENT "Signing bundle...") ENDIF() ENDIF() - - ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/installscript_osx.vdf ${RYZOM_OUTPUT_DIR}) ENDIF() INCLUDE_DIRECTORIES( diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index c94cf4a72..f7fc56b5e 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -416,7 +416,6 @@ CClientConfig::CClientConfig() PatchUrl.clear(); PatchletUrl.clear(); PatchVersion.clear(); - PatchServer.clear(); WebIgMainDomain = "atys.ryzom.com"; WebIgTrustedDomains.push_back(WebIgMainDomain); @@ -1039,12 +1038,19 @@ void CClientConfig::setValues() ///////////////////////// // NEW PATCHING SYSTEM // - READ_BOOL_FV(PatchWanted) + READ_BOOL_DEV(PatchWanted) + +#ifdef RZ_USE_CUSTOM_PATCH_SERVER + READ_STRING_FV(PatchUrl) + READ_STRING_FV(PatchVersion) + READ_STRING_FV(RingReleaseNotePath) + READ_STRING_FV(ReleaseNotePath) +#else READ_STRING_DEV(PatchUrl) READ_STRING_DEV(PatchVersion) READ_STRING_DEV(RingReleaseNotePath) READ_STRING_DEV(ReleaseNotePath) - READ_STRING_FV(PatchServer) +#endif ///////////////////////// // NEW PATCHLET SYSTEM // diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index 8f96b4244..5b9c9099e 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -296,7 +296,6 @@ struct CClientConfig std::string PatchUrl; std::string PatchletUrl; std::string PatchVersion; - std::string PatchServer; std::string RingReleaseNotePath; std::string ReleaseNotePath; diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 4830ae8d5..5065dcf4d 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -992,9 +992,16 @@ static void getPatchParameters(std::string &url, std::string &ver, std::vector& patchURIs, const std::s { uint i; PatchServers.clear(); + for (i=0; i vFileList; CPath::getPathContent ("patch", false, false, true, vFileList, NULL, false); @@ -2736,7 +2737,7 @@ void CPatchThread::run() for (i = 0; i < AllFilesToPatch.size(); ++i) { CPatchManager::SFileToPatch &rFTP = AllFilesToPatch[i]; - + string ext = NLMISC::CFile::getExtension(rFTP.FileName); if (ext == "bnp") { diff --git a/code/ryzom/tools/client/client_patcher/main.cpp b/code/ryzom/tools/client/client_patcher/main.cpp index cbd3ddc0b..1ee6c8c5e 100644 --- a/code/ryzom/tools/client/client_patcher/main.cpp +++ b/code/ryzom/tools/client/client_patcher/main.cpp @@ -202,10 +202,10 @@ int main(int argc, char *argv[]) // load client.cfg or client_default.cfg ClientCfg.init(config); - // check if PatchServer is defined - if (ClientCfg.PatchServer.empty()) + // check if PatchUrl is defined + if (ClientCfg.PatchUrl.empty()) { - printError("PatchServer not defined in " + config); + printError("PatchUrl not defined in " + config); return 1; } @@ -273,9 +273,9 @@ int main(int argc, char *argv[]) // set the correct root path pPM->setClientRootPath(rootPath); - // use PatchServer URL + // use PatchUrl vector patchURLs; - pPM->init(patchURLs, ClientCfg.PatchServer, ClientCfg.PatchVersion); + pPM->init(patchURLs, ClientCfg.PatchUrl, ClientCfg.PatchVersion); pPM->startCheckThread(true /* include background patchs */); ucstring state;