From 557f5d3d6c20f4980d734f43471e41798c4f7b88 Mon Sep 17 00:00:00 2001 From: Nuno Date: Wed, 20 Oct 2021 15:03:17 +0200 Subject: [PATCH] Changes made after code-to-root-atys branch --- nel/src/3d/lod_character_manager.cpp | 3 +- ryzom/client/src/client_cfg.cpp | 78 ++++++++++++++++--- ryzom/client/src/connection.cpp | 3 +- ryzom/client/src/far_tp.cpp | 8 +- .../src/interface_v3/inventory_manager.cpp | 3 - ryzom/client/src/login.cpp | 52 +++++++------ ryzom/client/src/net_manager.cpp | 5 +- 7 files changed, 110 insertions(+), 42 deletions(-) diff --git a/nel/src/3d/lod_character_manager.cpp b/nel/src/3d/lod_character_manager.cpp index f5d6a23c5..fe129108d 100644 --- a/nel/src/3d/lod_character_manager.cpp +++ b/nel/src/3d/lod_character_manager.cpp @@ -978,9 +978,10 @@ void CLodCharacterManager::addTextureCompute(CLodCharacterInstance &instance, return; // get lookup ptr. - nlassert(lodTexture.Texture.size()==NL3D_CLOD_TEXT_SIZE); if (lodTexture.Texture.size() < NL3D_CLOD_TEXT_SIZE) return; + + nlassert(lodTexture.Texture.size()==NL3D_CLOD_TEXT_SIZE); const CLodCharacterTexture::CTUVQ *lookUpPtr= &lodTexture.Texture[0]; diff --git a/ryzom/client/src/client_cfg.cpp b/ryzom/client/src/client_cfg.cpp index 9d030cdca..532852bbe 100644 --- a/ryzom/client/src/client_cfg.cpp +++ b/ryzom/client/src/client_cfg.cpp @@ -326,8 +326,8 @@ CClientConfig::CClientConfig() Local = false; // Default is Net Mode. FSHost = ""; // Default Host. - TexturesInterface.push_back("texture_interfaces_v3"); - TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc"); + TexturesInterface.push_back("texture_interfaces_v3_2x"); + TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc_2x"); TexturesOutGameInterface.push_back("texture_interfaces_v3_outgame_ui"); @@ -788,8 +788,8 @@ void CClientConfig::setValues() READ_STRINGVECTOR_FV(TexturesOutGameInterfaceDXTC); // interface textures ingame and r2 - READ_STRINGVECTOR_FV(TexturesInterface); - READ_STRINGVECTOR_FV(TexturesInterfaceDXTC); + //READ_STRINGVECTOR_FV(TexturesInterface); + //READ_STRINGVECTOR_FV(TexturesInterfaceDXTC); // interface files login menus READ_STRINGVECTOR_FV(XMLLoginInterfaceFiles); @@ -909,16 +909,76 @@ void CClientConfig::setValues() READ_STRING_FV(FSHost) READ_BOOL_DEV(DisplayAccountButtons) - READ_STRING_DEV(CreateAccountURL) - READ_STRING_DEV(EditAccountURL) - READ_STRING_DEV(ForgetPwdURL) + + + READ_STRING_FV(CreateAccountURL) + READ_STRING_FV(EditAccountURL) + READ_STRING_FV(ForgetPwdURL) + READ_STRING_DEV(BetaAccountURL) READ_STRING_DEV(FreeTrialURL) // defined in client_default.cfg - READ_STRING_FV(ConditionsTermsURL) - READ_STRING_FV(NamingPolicyURL) READ_STRING_FV(LoginSupportURL) + + // read NamingPolicyURL from client_default.cfg + //READ_STRING_FV(NamingPolicyURL) + + std::string languageCo = "wk"; + CConfigFile::CVar *languageCodeVarPtr = ClientCfg.ConfigFile.getVarPtr("LanguageCode"); + + if (languageCodeVarPtr) + { + languageCo = languageCodeVarPtr->asString(); + } + + CConfigFile::CVar *policyurl = ClientCfg.ConfigFile.getVarPtr("NamingPolicyURL"); + + if (policyurl) + { + for (uint i = 0; i < policyurl->size(); ++i) + { + std::string entry = policyurl->asString(i); + if (entry.size() >= languageCo.size()) + { + if (nlstricmp(entry.substr(0, languageCo.size()), languageCo) == 0) + { + std::string::size_type pos = entry.find("="); + + if (pos != std::string::npos) + { + ClientCfg.NamingPolicyURL = entry.substr(pos + 1); + } + } + } + } + } + + // read NamingPolicyURL from client_default.cfg + //READ_STRING_FV(ConditionsTermsURL) + CConfigFile::CVar *coturl = ClientCfg.ConfigFile.getVarPtr("ConditionsTermsURL"); + + if (coturl) + { + for (uint i = 0; i < coturl->size(); ++i) + { + std::string entry = coturl->asString(i); + + if (entry.size() >= languageCo.size()) + { + if (nlstricmp(entry.substr(0, languageCo.size()), languageCo) == 0) + { + std::string::size_type pos = entry.find("="); + + if (pos != std::string::npos) + { + ClientCfg.ConditionsTermsURL = entry.substr(pos + 1); + } + } + } + } + } + #ifndef RZ_NO_CLIENT // if cookie is not empty, it means that the client was launch diff --git a/ryzom/client/src/connection.cpp b/ryzom/client/src/connection.cpp index ee1be3318..4352f456f 100644 --- a/ryzom/client/src/connection.cpp +++ b/ryzom/client/src/connection.cpp @@ -193,6 +193,7 @@ bool hasPrivilegeG() { return (UserPrivileges.find(":G:") != std::string::npos); bool hasPrivilegeEM() { return (UserPrivileges.find(":EM:") != std::string::npos); } bool hasPrivilegeEG() { return (UserPrivileges.find(":EG:") != std::string::npos); } bool hasPrivilegeOBSERVER() { return (UserPrivileges.find(":OBSERVER:") != std::string::npos); } +bool hasPrivilegeTESTER() { return (UserPrivileges.find(":TESTER:") != std::string::npos); } // Restore the video mode (fullscreen for example) after the connection (done in a window) @@ -1127,7 +1128,7 @@ TInterfaceState globalMenu() charSelect = LoginCharsel; WaitServerAnswer = false; - if (charSelect == -1) + if (charSelect == -1 || FarTP.isReselectingChar()) { CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp("UI:SERVER_RECEIVED_CHARS", false); if (pNL != NULL) diff --git a/ryzom/client/src/far_tp.cpp b/ryzom/client/src/far_tp.cpp index 80134f26b..6509b4d2a 100644 --- a/ryzom/client/src/far_tp.cpp +++ b/ryzom/client/src/far_tp.cpp @@ -49,12 +49,12 @@ #include "login_progress_post_thread.h" #include "interface_v3/action_handler_base.h" #include "item_group_manager.h" +#include "nel/misc/cmd_args.h" #ifdef DEBUG_NEW #define new DEBUG_NEW #endif - using namespace NLMISC; using namespace NLNET; using namespace NL3D; @@ -210,6 +210,7 @@ extern bool IsInRingSession; extern void selectTipsOfTheDay (uint tips); #define BAR_STEP_TP 2 +extern NLMISC::CCmdArgs Args; CLoginStateMachine::TEvent CLoginStateMachine::waitEvent() { @@ -462,12 +463,14 @@ void CLoginStateMachine::run() case st_check_patch: /// check the data to check if patch needed CLoginProgressPostThread::getInstance().step(CLoginStep(LoginStep_PostLogin, "login_step_post_login")); - if (!ClientCfg.PatchWanted) + + if (!ClientCfg.PatchWanted || (Args.haveArg("n") && Args.getLongArg("nopatch").front() == "1")) { // client don't want to be patched ! _CurrentState = st_display_eula; break; } + initPatchCheck(); SM_BEGIN_EVENT_TABLE if (isBGDownloadEnabled()) @@ -1523,4 +1526,3 @@ void CFarTP::farTPmainLoop() if(welcomeWindow) initWelcomeWindow(); } - diff --git a/ryzom/client/src/interface_v3/inventory_manager.cpp b/ryzom/client/src/interface_v3/inventory_manager.cpp index 5c4799fe4..99f18241c 100644 --- a/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -3658,9 +3658,6 @@ void CInventoryManager::updateItemInfoQueue() return; } - // CONNECTION:READY not yet sent, so we cannot send requests yet! - nlassert(ConnectionReadySent || !_ItemInfoWaiters.size()); - // For All waiters, look if one need update. TItemInfoWaiters::iterator it; for(it= _ItemInfoWaiters.begin();it!=_ItemInfoWaiters.end();it++) diff --git a/ryzom/client/src/login.cpp b/ryzom/client/src/login.cpp index 9eb9688ae..244bb593c 100644 --- a/ryzom/client/src/login.cpp +++ b/ryzom/client/src/login.cpp @@ -1932,8 +1932,11 @@ class CAHOpenURL : public IActionHandler #else // TODO: for Linux and Mac OS #endif - - if (sParams == "cfg_EditAccountURL") + if (sParams == "cfg_CreateAccountURL") + { + url = ClientCfg.CreateAccountURL; + } + else if (sParams == "cfg_EditAccountURL") { url = ClientCfg.EditAccountURL; } @@ -1971,32 +1974,35 @@ class CAHOpenURL : public IActionHandler nlwarning("no URL found"); return; } + + if(sParams != "cfg_ConditionsTermsURL" && sParams != "cfg_NamingPolicyURL") + { + // modify existing languages - // modify existing languages - - // old site - string::size_type pos_lang = url.find("/en/"); + // old site + string::size_type pos_lang = url.find("/en/"); - // or new forums - if (pos_lang == string::npos) - pos_lang = url.find("=en#"); + // or new forums + if (pos_lang == string::npos) + pos_lang = url.find("=en#"); - if (pos_lang != string::npos) - { - url.replace(pos_lang + 1, 2, ClientCfg.getHtmlLanguageCode()); - } - else - { - // append language - if (url.find('?') != string::npos) - url += "&"; + if (pos_lang != string::npos) + { + url.replace(pos_lang + 1, 2, ClientCfg.getHtmlLanguageCode()); + } else - url += "?"; + { + // append language + if (url.find('?') != string::npos) + url += "&"; + else + url += "?"; - url += "language=" + ClientCfg.LanguageCode; + url += "language=" + ClientCfg.LanguageCode; - if (!LoginCustomParameters.empty()) - url += LoginCustomParameters; + if (!LoginCustomParameters.empty()) + url += LoginCustomParameters; + } } openURL(url); @@ -3283,7 +3289,6 @@ bool loginIntroSkip; void loginIntro() { // Display of nevrax logo is done at init time (see init.cpp) just before addSearchPath (second one) -#if 0 for (uint i = 0; i < 1; i++) // previously display nevrax then nvidia { if (i != 0) @@ -3321,7 +3326,6 @@ void loginIntro() NLGUI::CDBManager::getInstance()->flushObserverCalls(); } } -#endif beginLoading(StartBackground); ProgressBar.finish(); } diff --git a/ryzom/client/src/net_manager.cpp b/ryzom/client/src/net_manager.cpp index c6da153bc..c7a24ae2a 100644 --- a/ryzom/client/src/net_manager.cpp +++ b/ryzom/client/src/net_manager.cpp @@ -33,6 +33,7 @@ #include "game_share/chat_group.h" #include "game_share/character_summary.h" #include "game_share/sphrase_com.h" +#include "game_share/outpost.h" #include "game_share/msg_client_server.h" #include "game_share/ryzom_database_banks.h" #include "game_share/msg_encyclopedia.h" @@ -3206,9 +3207,11 @@ void impulseUserBars(NLMISC::CBitMemStream &impulse) void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse) { // read message + uint8 type; bool outpostInFire; bool playerGuildInConflict; bool playerGuildIsAttacker; + impulse.serial(type); impulse.serial(outpostInFire); impulse.serial(playerGuildInConflict); impulse.serial(playerGuildIsAttacker); @@ -3220,7 +3223,7 @@ void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse) impulse.serial( declTimer ); // start - OutpostManager.startPvpJoinProposal(outpostInFire, playerGuildInConflict, playerGuildIsAttacker, + OutpostManager.startPvpJoinProposal((OUTPOSTENUMS::TPVPType)type, outpostInFire, playerGuildInConflict, playerGuildIsAttacker, ownerGuildNameId, attackerGuildNameId, declTimer); }