From e39cd0a8d392cf8a276085c11c73e4f638df9400 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 7 Dec 2020 15:05:02 +0200 Subject: [PATCH 1/2] Add --url, --app options for client patcher --- code/CMakeLists.txt | 2 ++ code/config.h.cmake | 1 + .../tools/client/client_patcher/main.cpp | 27 ++++++++++++++++--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 3225dc1b8..af243a412 100644 --- a/code/CMakeLists.txt +++ b/code/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/code/config.h.cmake b/code/config.h.cmake index fa4749cb2..fa6c456b9 100644 --- a/code/config.h.cmake +++ b/code/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/code/ryzom/tools/client/client_patcher/main.cpp b/code/ryzom/tools/client/client_patcher/main.cpp index 62937dd59..275881c15 100644 --- a/code/ryzom/tools/client/client_patcher/main.cpp +++ b/code/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[]) { @@ -204,6 +205,8 @@ int main(int argc, char *argv[]) Args.addArg("s", "source", "source", "Name of source file to xdelta with patch file"); Args.addArg("d", "destination", "destination", "Name of destination operation (patch or unpack)"); Args.addArg("u", "unpack", "unpack", "Name of bnp file to unpack"); + 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; @@ -269,14 +272,32 @@ 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()); // use PatchUrl vector patchURLs; - pPM->init(patchURLs, PatchUrl, ""); + pPM->init(patchURLs, ClientCfg.ConfigFile.getVar("PatchUrl").asString(), ""); pPM->startCheckThread(true /* include background patchs */); ucstring state; From 184582cfc9643789670d2ed8d6c34eb340375edd Mon Sep 17 00:00:00 2001 From: Nuno Date: Mon, 7 Dec 2020 16:39:12 +0100 Subject: [PATCH 2/2] Removed uiBotChatPhrase --- .../client/src/interface_v3/dbgroup_list_sheet_trade.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp index 4a7ef5701..618507ff5 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp @@ -257,7 +257,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT case CDBCtrlSheet::Pact: text= CI18N::get("uiBotChatPact") + text; break; case CDBCtrlSheet::Skill: text= CI18N::get("uiBotChatSkill") + text; break; case CDBCtrlSheet::GuildFlag: text= CI18N::get("uiBotChatSkill") + text; break; - case CDBCtrlSheet::Phrase: text= CI18N::get("uiBotChatPhrase") + text; break; + case CDBCtrlSheet::Phrase: text= text; break; default: break; } @@ -536,12 +536,12 @@ bool CDBGroupListSheetTrade::CSheetChildTrade::isSheetValid(CDBGroupListSheetTex nlwarning("Brick %d has type %s", (int) k, BRICK_TYPE::toString(bs->getBrickType()).c_str()); } else - { + { nlwarning("Brick %d : not a brick sheet", (int) k); } } } - */ + */ if (phraseSheet) { @@ -563,7 +563,7 @@ bool CDBGroupListSheetTrade::CSheetChildTrade::isSheetValid(CDBGroupListSheetTex break; } } - + return true;