diff --git a/CMakeLists.txt b/CMakeLists.txt index 07fe11c8e..6bbf6235e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,7 @@ SET(RYZOM_CLIENT_CREATE_ACCOUNT_URL "https://open.ryzom.dev/ams/" CACHE STRING SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Edit Account URL") SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Forget Password URL") SET(RYZOM_CLIENT_PATCH_URL "https://cdn.ryzom.dev/open/patch/" CACHE STRING "Ryzom Client Patch URL") +SET(RYZOM_CLIENT_APP_NAME "default") SET(RYZOM_WEBIG_MAIN_URL "https://open.ryzom.dev/" CACHE STRING "Ryzom Client WebIG Main URL") SET(RYZOM_WEBIG_TRUSTED_DOMAIN "open.ryzom.dev" CACHE STRING "Ryzom Client WebIG Trusted Domain") @@ -114,6 +115,7 @@ IF(WITH_RYZOM_LIVE) SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://account.ryzom.com/payment_profile/index.php") SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://account.ryzom.com/payment_profile/lost_secure_password.php") SET(RYZOM_CLIENT_PATCH_URL "http://dl.ryzom.com/patch_live") + SET(RYZOM_CLIENT_APP_NAME "ryzom_live") SET(RYZOM_WEBIG_MAIN_URL "https://app.ryzom.com/") SET(RYZOM_WEBIG_TRUSTED_DOMAIN "app.ryzom.com") diff --git a/config.h.cmake b/config.h.cmake index fa4749cb2..fa6c456b9 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -37,6 +37,7 @@ #cmakedefine RYZOM_CLIENT_EDIT_ACCOUNT_URL "${RYZOM_CLIENT_EDIT_ACCOUNT_URL}" #cmakedefine RYZOM_CLIENT_FORGET_PASSWORD_URL "${RYZOM_CLIENT_FORGET_PASSWORD_URL}" #cmakedefine RYZOM_CLIENT_PATCH_URL "${RYZOM_CLIENT_PATCH_URL}" +#cmakedefine RYZOM_CLIENT_APP_NAME "${RYZOM_CLIENT_APP_NAME}" #cmakedefine RYZOM_WEBIG_MAIN_URL "${RYZOM_WEBIG_MAIN_URL}" #cmakedefine RYZOM_WEBIG_TRUSTED_DOMAIN "${RYZOM_WEBIG_TRUSTED_DOMAIN}" diff --git a/ryzom/tools/client/client_patcher/main.cpp b/ryzom/tools/client/client_patcher/main.cpp index 26db547ac..6ab6d860b 100644 --- a/ryzom/tools/client/client_patcher/main.cpp +++ b/ryzom/tools/client/client_patcher/main.cpp @@ -191,7 +191,8 @@ struct CClientPatcherTranslations : public NLMISC::CI18N::ILoadProxy }; // hardcoded URL to not depend on external files -static const std::string PatchUrl = RYZOM_CLIENT_PATCH_URL; // "https://cdn.ryzom.dev/open/patch"; +static const std::string DefaultPatchUrl = RYZOM_CLIENT_PATCH_URL; // "https://cdn.ryzom.dev/open/patch"; +static const std::string DefaultAppName = RYZOM_CLIENT_APP_NAME; // "default" int main(int argc, char *argv[]) { @@ -200,6 +201,8 @@ int main(int argc, char *argv[]) Args.setVersion(getDisplayVersion()); Args.setDescription("Ryzom client"); + Args.addArg("", "url", "PatchUrl", "Patch server url, ie 'https://dl.ryzom.com/patch_live'"); + Args.addArg("", "app", "Application", "Patch application name for version file, ie 'ryzom_live' requests ryzom_live.version from PatchUrl"); if (!Args.parse(argc, argv)) return 1; @@ -240,16 +243,35 @@ int main(int argc, char *argv[]) // now translations are read, we don't need it anymore delete trans; + // create minimal client.cfg file in memory for patcher + { + CConfigFile::CVar patchUrl; + patchUrl.forceAsString(DefaultPatchUrl); + if (Args.haveLongArg("url") && !Args.getLongArg("url").empty()) + patchUrl.forceAsString(Args.getLongArg("url").front()); + + CConfigFile::CVar appName; + appName.forceAsString(DefaultAppName); + if (Args.haveLongArg("app") && !Args.getLongArg("app").empty()) + appName.forceAsString(Args.getLongArg("app").front()); + + ClientCfg.ConfigFile.insertVar("PatchUrl", patchUrl); + ClientCfg.ConfigFile.insertVar("Application", appName); + } + + // Args.displayVersion(); printf("\n"); printf("Checking %s files to patch...\n", convert(CI18N::get("TheSagaOfRyzom")).c_str()); + printf("Using '%s/%s.version'\n", ClientCfg.ConfigFile.getVar("PatchUrl").asString().c_str(), + ClientCfg.ConfigFile.getVar("Application").asString().c_str()); // initialize patch manager and set the ryzom full path, before it's used CPatchManager *pPM = CPatchManager::getInstance(); // use PatchUrl vector patchURLs; - pPM->init(patchURLs, PatchUrl, ""); + pPM->init(patchURLs, ClientCfg.ConfigFile.getVar("PatchUrl").asString(), ""); pPM->startCheckThread(true /* include background patchs */); string state;