From 4bcf9270eb0dd420abeb829b77b5e9d9cdc29964 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 15 Feb 2021 13:25:37 +0200 Subject: [PATCH 1/7] Show reload link when curl fails to open connection to website --- code/nel/include/nel/gui/group_html.h | 3 +++ code/nel/src/gui/group_html.cpp | 28 ++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 590c43a89..a78e203c0 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -115,6 +115,9 @@ namespace NLGUI // Browse error void browseError (const char *msg); + // Error message with html content + void browseErrorHtml(const std::string &html); + bool isBrowsing(); // Update coords diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 50b381a3c..f2aba9fa0 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -2642,6 +2642,17 @@ namespace NLGUI invalidateCoords(); } + void CGroupHTML::browseErrorHtml(const std::string &html) + { + releaseDownloads(); + removeContent(); + + renderHtmlString(html); + + updateRefreshButton(); + invalidateCoords(); + } + // *************************************************************************** bool CGroupHTML::isBrowsing() @@ -3964,11 +3975,22 @@ namespace NLGUI { if (!success) { + CUrlParser uri(_CurlWWW->Url); + + // potentially unwanted chars + std::string url = _CurlWWW->Url; + url = strFindReplaceAll(url, string("<"), string("%3C")); + url = strFindReplaceAll(url, string(">"), string("%3E")); + url = strFindReplaceAll(url, string("\""), string("%22")); + url = strFindReplaceAll(url, string("'"), string("%27")); + std::string err; - err = "Connection failed with cURL error: "; + err = "cURL error"; + err += "

Connection failed with cURL error

"; err += error; - err += "\nURL '" + _CurlWWW->Url + "'"; - browseError(err.c_str()); + err += "
(" + uri.scheme + "://" + uri.host + ") reload"; + err += ""; + browseErrorHtml(err); return; } From 8cd863ff443190b30f0173cb96c5a4a63e323cd6 Mon Sep 17 00:00:00 2001 From: Riasan Date: Mon, 22 Feb 2021 16:13:02 +0100 Subject: [PATCH 2/7] Added: new privs TESTER for teleport via Map / Command --- code/ryzom/client/src/connection.cpp | 1 + code/ryzom/client/src/connection.h | 1 + code/ryzom/client/src/game_context_menu.cpp | 2 +- code/ryzom/client/src/interface_v3/group_map.cpp | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 82564354e..b4d7b5296 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/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) diff --git a/code/ryzom/client/src/connection.h b/code/ryzom/client/src/connection.h index 79a72fb0e..72a44d31c 100644 --- a/code/ryzom/client/src/connection.h +++ b/code/ryzom/client/src/connection.h @@ -52,6 +52,7 @@ bool hasPrivilegeEM(); bool hasPrivilegeEG(); bool hasPrivilegeVG(); bool hasPrivilegeOBSERVER(); +bool hasPrivilegeTESTER(); // connection with the server. (login, shard list, etc.). diff --git a/code/ryzom/client/src/game_context_menu.cpp b/code/ryzom/client/src/game_context_menu.cpp index 78e58c4b5..1306c0704 100644 --- a/code/ryzom/client/src/game_context_menu.cpp +++ b/code/ryzom/client/src/game_context_menu.cpp @@ -267,7 +267,7 @@ void CGameContextMenu::update() setupContextMenuCantTalk(); // can't talk by default - bool showGMOptions = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER()); + bool showGMOptions = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER() || hasPrivilegeTESTER()); if (_TextInvisible) _TextInvisible->setActive(showGMOptions); diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 9bae00d6c..35a1fc4e6 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -2654,7 +2654,7 @@ void CGroupMap::createContinentLandMarks() static void hideTeleportButtonsInPopupMenuIfNotEnoughPriv() { - bool showTeleport = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER()); + bool showTeleport = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER()|| hasPrivilegeTESTER()); CInterfaceManager *im = CInterfaceManager::getInstance(); CInterfaceElement *ie = CWidgetManager::getInstance()->getElementFromId("ui:interface:map_menu:teleport"); From 719f178f70aa628be65713105df65fa23fd4784b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 25 Oct 2020 01:55:35 +0800 Subject: [PATCH 3/7] Disconnect if UDP Login fails, ryzom/ryzomcore#622 --- code/ryzom/client/src/network_connection.cpp | 12 ++++++++++++ code/ryzom/client/src/network_connection.h | 1 + 2 files changed, 13 insertions(+) diff --git a/code/ryzom/client/src/network_connection.cpp b/code/ryzom/client/src/network_connection.cpp index 731677043..c1e9d8975 100644 --- a/code/ryzom/client/src/network_connection.cpp +++ b/code/ryzom/client/src/network_connection.cpp @@ -680,6 +680,7 @@ bool CNetworkConnection::connect(string &result) _LatestLoginTime = ryzomGetLocalTime (); _LatestSyncTime = _LatestLoginTime; _LatestProbeTime = _LatestLoginTime; + m_LoginAttempts = 0; nlinfo("CNET[%p]: Client connected to shard, attempting login", this); return true; @@ -1091,6 +1092,17 @@ bool CNetworkConnection::stateLogin() { sendSystemLogin(); _LatestLoginTime = _UpdateTime; + if (m_LoginAttempts > 24) + { + m_LoginAttempts = 0; + disconnect(); // will send disconnection message + nlwarning("CNET[%p]: Too many LOGIN attempts, connection problem", this); + return false; // exit now from loop, don't expect a new state + } + else + { + ++m_LoginAttempts; + } } return false; diff --git a/code/ryzom/client/src/network_connection.h b/code/ryzom/client/src/network_connection.h index d11702682..84bb26d43 100644 --- a/code/ryzom/client/src/network_connection.h +++ b/code/ryzom/client/src/network_connection.h @@ -822,6 +822,7 @@ private: void sendSystemLogin(); bool stateLogin(); NLMISC::TTime _LatestLoginTime; + int m_LoginAttempts; // void receiveSystemSync(NLMISC::CBitMemStream &msgin); From 2528e542cbeb4b12a715e4c3a5c6db212c6e17f7 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 25 Oct 2020 01:56:10 +0800 Subject: [PATCH 4/7] Don't probe if normal received in probe state, otherwise server will not enter probe state, ryzom/ryzomcore#622, ryzom/ryzomcore#133 --- code/ryzom/client/src/network_connection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ryzom/client/src/network_connection.cpp b/code/ryzom/client/src/network_connection.cpp index c1e9d8975..4778641c0 100644 --- a/code/ryzom/client/src/network_connection.cpp +++ b/code/ryzom/client/src/network_connection.cpp @@ -2320,6 +2320,7 @@ bool CNetworkConnection::stateProbe() else { nlwarning("CNET[%p]: received normal in state Probe", this); + _LatestProbeTime = _UpdateTime; } } } From bf2f8e39a5a979e0144b5dd9dc4db2362161e825 Mon Sep 17 00:00:00 2001 From: Nuno Date: Fri, 2 Apr 2021 19:04:36 +0200 Subject: [PATCH 5/7] Added nopatch arg for use with Ryztart --- code/ryzom/client/src/client.cpp | 1 + code/ryzom/client/src/far_tp.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index e824f6529..4e933b6da 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -180,6 +180,7 @@ int main(int argc, char **argv) Args.setVersion(getDisplayVersion()); Args.setDescription("Ryzom client"); + Args.addArg("n", "nopatch", "value", "Use this to not use patch system"); Args.addArg("p", "profile", "id", "Use this profile to determine what directory to use by default"); Args.addAdditionalArg("login", "Login to use", true, false); Args.addAdditionalArg("password", "Password to use", true, false); diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index 0a594e540..1c2a6e612 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/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()) @@ -1517,4 +1520,3 @@ void CFarTP::farTPmainLoop() if(welcomeWindow) initWelcomeWindow(); } - From 6402a31e4e27fb6155a1c94c7a0c164b9ad85afe Mon Sep 17 00:00:00 2001 From: Nuno Date: Wed, 21 Apr 2021 18:47:13 +0200 Subject: [PATCH 6/7] Added boost allegories family --- code/ryzom/common/src/game_share/brick_families.cpp | 1 + code/ryzom/common/src/game_share/brick_families.h | 3 ++- code/ryzom/common/src/game_share/fame.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/ryzom/common/src/game_share/brick_families.cpp b/code/ryzom/common/src/game_share/brick_families.cpp index 684eb0d25..c36593da0 100644 --- a/code/ryzom/common/src/game_share/brick_families.cpp +++ b/code/ryzom/common/src/game_share/brick_families.cpp @@ -558,6 +558,7 @@ namespace BRICK_FAMILIES NL_STRING_CONVERSION_TABLE_ENTRY(BSCMC) NL_STRING_CONVERSION_TABLE_ENTRY(BSCMD) NL_STRING_CONVERSION_TABLE_ENTRY(BSGMC) + NL_STRING_CONVERSION_TABLE_ENTRY(BSGMCB) NL_STRING_CONVERSION_TABLE_ENTRY(BSXCA) diff --git a/code/ryzom/common/src/game_share/brick_families.h b/code/ryzom/common/src/game_share/brick_families.h index 49a73fbaa..7903f6e5e 100644 --- a/code/ryzom/common/src/game_share/brick_families.h +++ b/code/ryzom/common/src/game_share/brick_families.h @@ -675,7 +675,8 @@ namespace BRICK_FAMILIES BSCMD, // heal Focus EndPowerParameter = BSCMD, - BSGMC, // jewels s2e0 + BSGMC, // allegories + BSGMCB, // boost allegories BeginMagicPowerCredit, BSXCA = BeginMagicPowerCredit, // recast time diff --git a/code/ryzom/common/src/game_share/fame.cpp b/code/ryzom/common/src/game_share/fame.cpp index 19c3cbb80..03bf10e45 100644 --- a/code/ryzom/common/src/game_share/fame.cpp +++ b/code/ryzom/common/src/game_share/fame.cpp @@ -633,7 +633,7 @@ sint32 CStaticFames::getStaticFameIndexed(uint factionIndex1, uint factionIndex2 if (factionIndex1 >= _FameTableSize || factionIndex2 >= _FameTableSize) { - nlwarning("FAME: CStaticFames::getStaticFame invalid faction, return 0"); + //nlwarning("FAME: CStaticFames::getStaticFame invalid faction, return 0"); return 0; } From c09f82db16b23de92aff3164666a9203abbbb362 Mon Sep 17 00:00:00 2001 From: Nuno Date: Fri, 23 Apr 2021 18:29:31 +0200 Subject: [PATCH 7/7] Added boost icons --- .../client/src/interface_v3/dbctrl_sheet.cpp | 19 ++++++++++++++++++- .../client/src/interface_v3/dbctrl_sheet.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 7b188742c..9485cb2b7 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1086,6 +1086,7 @@ void CDBCtrlSheet::clearIconBuffs() { _EnchantIcons.clear(); _BuffIcons.clear(); + _BoostIcons.clear(); } // *************************************************************************** @@ -1118,8 +1119,15 @@ void CDBCtrlSheet::infoReceived() if (brick) { if (!brick->isRoot() && !brick->isCredit() && !brick->isParameter()) + if (brick->BrickFamily == BRICK_FAMILIES::BSGMCB) // Boost of Allegories, use it as boost icon { if (!haveRoot) + _BoostIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIcon()), brick->IconColor)); + rVR.getTextureSizeFromId(_BoostIcons.back().TextureId, _BoostIcons.back().IconW, _BoostIcons.back().IconH); + } + else if (!brick->isRoot() && !brick->isCredit() && !brick->isParameter()) + { + if (!haveRoot && !brick->getIconBack().empty()) { _EnchantIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIconBack()), brick->IconBackColor)); rVR.getTextureSizeFromId(_EnchantIcons.back().TextureId, _EnchantIcons.back().IconW, _EnchantIcons.back().IconH); @@ -2444,10 +2452,18 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti } yIcon -= hIcon; rVR.drawRotFlipBitmap(_RenderLayer + 1, xIcon, yIcon, wIcon, hIcon, 0, false, _EnchantIcons[0].TextureId, fastMulRGB(curSheetColor, _EnchantIcons[0].Color)); - rVR.drawRotFlipBitmap(_RenderLayer+1, xIcon, yIcon, wIcon, hIcon, 0, false, _EnchantIcons[i].TextureId, fastMulRGB(curSheetColor, _EnchantIcons[i].Color)); + rVR.drawRotFlipBitmap(_RenderLayer + 1, xIcon, yIcon, wIcon, hIcon, 0, false, _EnchantIcons[i].TextureId, fastMulRGB(curSheetColor, _EnchantIcons[i].Color)); + + + if ((i - 1) < _BoostIcons.size()) { + nlinfo("Boost icon = %s", rVR.getTextureNameFromId(_BoostIcons[i-1].TextureId).c_str()); + rVR.drawRotFlipBitmap(_RenderLayer + 2, xIcon+wIcon-_BoostIcons[i-1].IconW, yIcon, _BoostIcons[i-1].IconW, _BoostIcons[i-1].IconH, 0, false, _BoostIcons[i-1].TextureId, fastMulRGB(curSheetColor, _BoostIcons[i-1].Color)); + } } } + + // Draw Quality. -1 for lookandfeel. Draw it with global color if (_DispQuality != -1) { @@ -3804,6 +3820,7 @@ void CDBCtrlSheet::resetAllTexIDs() _ItemInfoChanged = true; _EnchantIcons.clear(); _BuffIcons.clear(); + _BoostIcons.clear(); } diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h index f9a85dd05..0052335fb 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h @@ -682,6 +682,7 @@ protected: }; std::vector _BuffIcons; std::vector _EnchantIcons; + std::vector _BoostIcons; // Level Brick or Quality union