From adc89b3a82410bce94ed9525faf170b7aa076f27 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 18 Aug 2018 09:16:14 +0300 Subject: [PATCH 01/12] Fixed: style inheritance for underline, strikethrough --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 9a987d450..45398102b 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -6175,6 +6175,12 @@ namespace NLGUI { const CStyleParams current = _Style; + if (inherit) + { + style.Underlined = current.Underlined; + style.StrikeThrough = current.StrikeThrough; + } + float tmpf; TStyle styles = parseStyle(styleString); TStyle::iterator it; @@ -6396,11 +6402,6 @@ namespace NLGUI style.GlobalColor = b; } } - if (inherit) - { - style.Underlined = current.Underlined || style.Underlined; - style.StrikeThrough = current.StrikeThrough || style.StrikeThrough; - } } // *************************************************************************** From 40dc2188f268f71d9488c1efb42ce90079b195b6 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 10:53:04 +0200 Subject: [PATCH 02/12] Fixed: Check CURL backend on old CURL versions (tested with 7.22) --HG-- branch : develop --- code/nel/src/gui/curl_certificates.cpp | 51 +++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/curl_certificates.cpp b/code/nel/src/gui/curl_certificates.cpp index fa3cd10f0..11053545a 100644 --- a/code/nel/src/gui/curl_certificates.cpp +++ b/code/nel/src/gui/curl_certificates.cpp @@ -25,6 +25,14 @@ #include +// for compatibility with older versions +#ifndef CURL_AT_LEAST_VERSION +#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) +#define CURL_AT_LEAST_VERSION(x,y,z) \ + (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) +#endif + + using namespace std; using namespace NLMISC; @@ -81,6 +89,9 @@ namespace NLGUI // get information on CURL curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); + bool useOpenSSLBackend = false; + +#if CURL_AT_LEAST_VERSION(7, 34, 0) // get more information on CURL session curl_tlssessioninfo *sessionInfo; @@ -94,8 +105,30 @@ namespace NLGUI CURLcode res = curl_easy_getinfo(curl, info, &sessionInfo); + // CURL using OpenSSL backend + if ((res == CURLE_OK) && sessionInfo && sessionInfo->backend == CURLSSLBACKEND_OPENSSL) useOpenSSLBackend = true; +#elif CURL_AT_LEAST_VERSION(7, 12, 3) + // get a list of OpenSSL engines + struct curl_slist *engines; + + CURLcode res = curl_easy_getinfo(curl, CURLINFO_SSL_ENGINES, &engines); + + // CURL using OpenSSL backend + // With OpenSSL compiled without any engine, engines will too return NULL + // Fortunately, if OpenSSL isn't compiled with engines means we compiled it ourself and CURL is a recent version + if ((res == CURLE_OK) && engine) + { + // free engines + curl_slist_free_all(engines); + + useOpenSSLBackend = true; + } +#else + // TODO: implement an equivalent, but CURL 7.12 was released in 2004 +#endif + // only use OpenSSL callback if not using Windows SSPI and using OpenSSL backend - if (!res && sessionInfo && sessionInfo->backend == CURLSSLBACKEND_OPENSSL && !(data && data->features & CURL_VERSION_SSPI)) + if (useOpenSSLBackend && !(data && data->features & CURL_VERSION_SSPI)) { #ifdef NL_OS_WINDOWS // load native Windows CA Certs @@ -181,7 +214,21 @@ namespace NLGUI void addCertificatesFromFile(const std::string &cert) { - if (!isInitialized || !isUsingOpenSSLBackend) return; + if (!isInitialized) + { + nlwarning("CURL not initialized! Check if there are another errors"); + return; + } + + if (!isUsingOpenSSLBackend) + { + nlinfo("CURL not using OpenSSL backend! Unable to use custom certificates"); + return; + } + else + { + nlinfo("CURL using OpenSSL backend!"); + } // this file was already loaded if (std::find(CertList.begin(), CertList.end(), cert) != CertList.end()) return; From 58efd082c112c552660e33c43775acef872c6058 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 10:57:33 +0200 Subject: [PATCH 03/12] Changed: Don't include curl.h in headers to avoid dependencies on CURL for more files that required --HG-- branch : develop --- code/nel/include/nel/gui/group_html.h | 10 +- code/nel/include/nel/gui/libwww.h | 5 +- code/nel/src/gui/group_html.cpp | 91 ++++++++++--------- code/nel/src/gui/libwww.cpp | 2 + .../src/interface_v3/group_html_webig.cpp | 2 + 5 files changed, 57 insertions(+), 53 deletions(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index c96b67456..9c48149bf 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -17,8 +17,6 @@ #ifndef CL_GROUP_HTML_H #define CL_GROUP_HTML_H -#include - #include "nel/misc/types_nl.h" #include "nel/gui/interface_group.h" #include "nel/gui/group_scrolltext.h" @@ -27,6 +25,9 @@ #include "nel/gui/group_table.h" #include "nel/gui/libwww_types.h" +// forward declaration +typedef void CURLM; + typedef std::map TStyle; namespace NLGUI @@ -856,11 +857,6 @@ namespace NLGUI // HtmlType download finished void htmlDownloadFinished(const std::string &content, const std::string &type, long code); - - // cURL transfer callbacks - static size_t curlHeaderCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData); - static size_t curlDataCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData); - static size_t curlProgressCallback(void *pCCurlWWWData, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow); }; // adapter group that store y offset for inputs inside an html form diff --git a/code/nel/include/nel/gui/libwww.h b/code/nel/include/nel/gui/libwww.h index 892e07eb2..64258608e 100644 --- a/code/nel/include/nel/gui/libwww.h +++ b/code/nel/include/nel/gui/libwww.h @@ -20,11 +20,12 @@ #ifndef CL_LIB_WWW_H #define CL_LIB_WWW_H -#include - #include "nel/misc/rgba.h" #include "nel/gui/libwww_types.h" +// forward declaration to avoid curl.h inclusion everywhere +typedef void CURL; + namespace NLGUI { class CCtrlBaseButton; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 45398102b..fdf32f44c 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -49,6 +49,8 @@ #include "nel/gui/http_hsts.h" #include "nel/gui/curl_certificates.h" +#include + using namespace std; using namespace NLMISC; @@ -205,6 +207,47 @@ namespace NLGUI std::map HeadersRecv; }; + // cURL transfer callbacks + // *************************************************************************** + static size_t curlHeaderCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData) + { + CCurlWWWData * me = static_cast(pCCurlWWWData); + if (me) + { + std::string header; + header.append(buffer, size * nmemb); + me->setRecvHeader(header.substr(0, header.find_first_of("\n\r"))); + } + + return size * nmemb; + } + + // *************************************************************************** + static size_t curlDataCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData) + { + CCurlWWWData * me = static_cast(pCCurlWWWData); + if (me) + me->Content.append(buffer, size * nmemb); + + return size * nmemb; + } + + // *************************************************************************** + static size_t curlProgressCallback(void *pCCurlWWWData, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) + { + CCurlWWWData * me = static_cast(pCCurlWWWData); + if (me) + { + if (dltotal > 0 || dlnow > 0 || ultotal > 0 || ulnow > 0) + { + nlwarning("> dltotal %d, dlnow %d, ultotal %d, ulnow %d, url '%s'", dltotal, dlnow, ultotal, ulnow, me->Url.c_str()); + } + } + + // return 1 to cancel download + return 0; + } + // Check if domain is on TrustedDomain bool CGroupHTML::isTrustedDomain(const string &domain) { @@ -423,7 +466,7 @@ namespace NLGUI download.data->sendHeaders(headers); // catch headers - curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curlHeaderCallback); + curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, NLGUI::curlHeaderCallback); curl_easy_setopt(curl, CURLOPT_WRITEHEADER, download.data); std::string userAgent = options.appName + "/" + options.appVersion; @@ -5476,17 +5519,17 @@ namespace NLGUI _CurlWWW->sendHeaders(headers); // catch headers for redirect - curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curlHeaderCallback); + curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, NLGUI::curlHeaderCallback); curl_easy_setopt(curl, CURLOPT_WRITEHEADER, _CurlWWW); // catch body - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlDataCallback); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NLGUI::curlDataCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, _CurlWWW); #if LOG_DL // progress callback curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, curlProgressCallback); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, NLGUI::curlProgressCallback); curl_easy_setopt(curl, CURLOPT_XFERINFODATA, _CurlWWW); #else // progress off @@ -6472,46 +6515,6 @@ namespace NLGUI } } - // *************************************************************************** - size_t CGroupHTML::curlHeaderCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData) - { - CCurlWWWData * me = static_cast(pCCurlWWWData); - if (me) - { - std::string header; - header.append(buffer, size * nmemb); - me->setRecvHeader(header.substr(0, header.find_first_of("\n\r"))); - } - - return size * nmemb; - } - - // *************************************************************************** - size_t CGroupHTML::curlDataCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData) - { - CCurlWWWData * me = static_cast(pCCurlWWWData); - if (me) - me->Content.append(buffer, size * nmemb); - - return size * nmemb; - } - - // *************************************************************************** - size_t CGroupHTML::curlProgressCallback(void *pCCurlWWWData, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) - { - CCurlWWWData * me = static_cast(pCCurlWWWData); - if (me) - { - if (dltotal > 0 || dlnow > 0 || ultotal > 0 || ulnow > 0) - { - nlwarning("> dltotal %d, dlnow %d, ultotal %d, ulnow %d, url '%s'", dltotal, dlnow, ultotal, ulnow, me->Url.c_str()); - } - } - - // return 1 to cancel download - return 0; - } - // *************************************************************************** std::string CGroupHTML::HTMLOListElement::getListMarkerText() const { diff --git a/code/nel/src/gui/libwww.cpp b/code/nel/src/gui/libwww.cpp index fef3d788e..2e9b4451a 100644 --- a/code/nel/src/gui/libwww.cpp +++ b/code/nel/src/gui/libwww.cpp @@ -19,6 +19,8 @@ #include "nel/gui/libwww.h" #include "nel/gui/group_html.h" +#include + using namespace NLMISC; #ifdef DEBUG_NEW diff --git a/code/ryzom/client/src/interface_v3/group_html_webig.cpp b/code/ryzom/client/src/interface_v3/group_html_webig.cpp index 58d27c851..fe2fa5229 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -28,6 +28,8 @@ #include "../net_manager.h" #include "../connection.h" +#include + using namespace std; using namespace NLMISC; From 1380a94f5d9db9ac70e265010736662bc2f9282f Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 11:12:26 +0200 Subject: [PATCH 04/12] Changed: Use LIST(APPEND instead of SET --HG-- branch : develop --- code/CMakeModules/FindHelpers.cmake | 36 +++++++++++++-------------- code/CMakeModules/FindSteam.cmake | 2 +- code/ryzom/client/src/login_patch.cpp | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/code/CMakeModules/FindHelpers.cmake b/code/CMakeModules/FindHelpers.cmake index a4af37229..874555820 100644 --- a/code/CMakeModules/FindHelpers.cmake +++ b/code/CMakeModules/FindHelpers.cmake @@ -692,11 +692,11 @@ MACRO(ADD_QT_LIBRARY _NAME) ENDIF() SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}") IF(EXISTS ${_LIB}) - SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB}) + LIST(APPEND QT_LIBRARIES optimized ${_LIB}) ENDIF() SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}") IF(EXISTS ${_LIB}) - SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB}) + LIST(APPEND QT_LIBRARIES debug ${_LIB}) ENDIF() ENDMACRO() @@ -710,11 +710,11 @@ MACRO(ADD_QT_PLUGIN _TYPE _NAME) ENDIF() SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}") IF(EXISTS ${_LIB}) - SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB}) + LIST(APPEND QT_LIBRARIES optimized ${_LIB}) ENDIF() SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}") IF(EXISTS ${_LIB}) - SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB}) + LIST(APPEND QT_LIBRARIES debug ${_LIB}) ENDIF() ENDMACRO() @@ -789,12 +789,12 @@ MACRO(FIND_QT5) SET(QT_LIBRARIES Qt5::Widgets) # Gui - SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Gui Qt5::OpenGL) + LIST(APPEND QT_LIBRARIES Qt5::Gui Qt5::OpenGL) ADD_QT_LIBRARY(PrintSupport) IF(WIN32) - SET(QT_LIBRARIES ${QT_LIBRARIES} + LIST(APPEND QT_LIBRARIES ${WINSDK_LIBRARY_DIR}/Imm32.lib ${WINSDK_LIBRARY_DIR}/OpenGL32.lib ${WINSDK_LIBRARY_DIR}/WinMM.Lib) @@ -812,7 +812,7 @@ MACRO(FIND_QT5) FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration) FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL) - SET(QT_LIBRARIES ${QT_LIBRARIES} + LIST(APPEND QT_LIBRARIES ${CUPS_LIBRARY} ${COCOA_FRAMEWORK} ${SYSTEMCONFIGURATION_FRAMEWORK} @@ -839,7 +839,7 @@ MACRO(FIND_QT5) ADD_QT_LIBRARY(DBus) IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a") - SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_LIBRARY_DIR}/libxcb-static.a") + LIST(APPEND QT_LIBRARIES "${QT_LIBRARY_DIR}/libxcb-static.a") ENDIF() # always link these in dynamic, API never changes @@ -871,14 +871,14 @@ MACRO(FIND_QT5) SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib") ENDIF() IF(EXISTS ${HB_LIB}) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${HB_LIB}) + LIST(APPEND QT_LIBRARIES ${HB_LIB}) ENDIF() # freetype is needed since Qt 5.5 FIND_PACKAGE(Freetype) IF(FREETYPE_FOUND) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIBRARIES}) + LIST(APPEND QT_LIBRARIES ${FREETYPE_LIBRARIES}) ELSE() IF(UNIX) SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a") @@ -886,27 +886,27 @@ MACRO(FIND_QT5) SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib") ENDIF() IF(EXISTS ${FREETYPE_LIB}) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIB}) + LIST(APPEND QT_LIBRARIES ${FREETYPE_LIB}) ENDIF() ENDIF() ADD_QT_PLUGIN(accessible qtaccessiblewidgets) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARY}) + LIST(APPEND QT_LIBRARIES ${PNG_LIBRARIES} ${JPEG_LIBRARY}) # Network - SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Network Qt5::Xml) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES}) + LIST(APPEND QT_LIBRARIES Qt5::Network Qt5::Xml) + LIST(APPEND QT_LIBRARIES ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES}) IF(WIN32) - SET(QT_LIBRARIES ${QT_LIBRARIES} + LIST(APPEND QT_LIBRARIES ${WINSDK_LIBRARY_DIR}/Crypt32.lib ${WINSDK_LIBRARY_DIR}/WS2_32.Lib ${WINSDK_LIBRARY_DIR}/IPHlpApi.Lib) ENDIF() # Core - SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Core) + LIST(APPEND QT_LIBRARIES Qt5::Core) # pcre is needed since Qt 5.5 IF(UNIX) @@ -918,7 +918,7 @@ MACRO(FIND_QT5) SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib") ENDIF() IF(EXISTS ${PCRE_LIB}) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${PCRE_LIB}) + LIST(APPEND QT_LIBRARIES ${PCRE_LIB}) ENDIF() IF(APPLE) @@ -926,7 +926,7 @@ MACRO(FIND_QT5) FIND_LIBRARY(SECURITY_FRAMEWORK Security) - SET(QT_LIBRARIES ${QT_LIBRARIES} + LIST(APPEND QT_LIBRARIES ${PCRE_LIBRARY} ${FOUNDATION_FRAMEWORK} ${CARBON_FRAMEWORK} diff --git a/code/CMakeModules/FindSteam.cmake b/code/CMakeModules/FindSteam.cmake index 5657312eb..8d9b12372 100644 --- a/code/CMakeModules/FindSteam.cmake +++ b/code/CMakeModules/FindSteam.cmake @@ -2,7 +2,7 @@ # This module defines # STEAM_LIBRARY, the library to link against # STEAM_FOUND, if false, do not try to link to STEAM -# STEA%_INCLUDE_DIR, where to find headers. +# STEAM_INCLUDE_DIR, where to find headers. IF(STEAM_LIBRARY AND STEAM_INCLUDE_DIR) # in cache already diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 6a3500ae0..f4e7e237f 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -101,7 +101,7 @@ struct EPatchDownloadException : public Exception { EPatchDownloadException() : Exception( "Download Error" ) {} EPatchDownloadException( const std::string& str ) : Exception( str ) {} - virtual ~EPatchDownloadException() {} + virtual ~EPatchDownloadException() throw(){} }; From 6da051e1a82832b791c843a6b8187de6539500b4 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 11:12:47 +0200 Subject: [PATCH 05/12] Changed: New macro FIX_PACKAGE_OPTIONS --HG-- branch : develop --- code/CMakeModules/FindHelpers.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/code/CMakeModules/FindHelpers.cmake b/code/CMakeModules/FindHelpers.cmake index 874555820..ab8df32a6 100644 --- a/code/CMakeModules/FindHelpers.cmake +++ b/code/CMakeModules/FindHelpers.cmake @@ -38,6 +38,21 @@ MACRO(PARSE_VERSION_OTHER FILENAME) ENDIF() ENDMACRO() +# macro to define FIND_PACKAGE options with a different package name +MACRO(FIX_PACKAGE_OPTIONS OLDNAME NEWNAME) + # append other options if needed + SET(_OPTIONS COMPONENTS REQUIRED QUIETLY) + + # process each options + FOREACH(_OPTION ${_OPTIONS}) + SET(OLD_OPTION ${OLDNAME}_FIND_${_OPTION}) + IF(DEFINED ) + SET(NEW_OPTION ${NEWNAME}_FIND_${_OPTION}) + SET(${NEW_OPTION} ${OLD_OPTION}) + ENDIF() + ENDFOREACH() +ENDMACRO() + MACRO(FIND_PACKAGE_HELPER NAME INCLUDE) # Looks for a directory containing NAME. # From 964e32cd93b5e44d90e6154617999b14303a1a6d Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 11:13:10 +0200 Subject: [PATCH 06/12] Changed: Use Threads CMake module and CMAKE_DL_LIBS --HG-- branch : develop --- code/CMakeModules/FindHelpers.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/CMakeModules/FindHelpers.cmake b/code/CMakeModules/FindHelpers.cmake index ab8df32a6..bc38354f4 100644 --- a/code/CMakeModules/FindHelpers.cmake +++ b/code/CMakeModules/FindHelpers.cmake @@ -947,7 +947,8 @@ MACRO(FIND_QT5) ${CARBON_FRAMEWORK} ${SECURITY_FRAMEWORK}) ELSEIF(UNIX) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -ldl -lrt) + FIND_PACKAGE(Threads) + LIST(APPEND QT_LIBRARIES ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} -lrt) ENDIF() ELSE() SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core) From 06a4244df36c1d6ac8af63f86f3d4db60436287a Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 11:14:14 +0200 Subject: [PATCH 07/12] Changed: Include NeL in RyzomGameShare CMake module --HG-- branch : develop --- code/CMakeModules/FindRyzomGameShare.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/CMakeModules/FindRyzomGameShare.cmake b/code/CMakeModules/FindRyzomGameShare.cmake index 56eb94569..f76e4dd93 100644 --- a/code/CMakeModules/FindRyzomGameShare.cmake +++ b/code/CMakeModules/FindRyzomGameShare.cmake @@ -3,6 +3,10 @@ INCLUDE(FindHelpers) FIND_PACKAGE_HELPER(RyzomGameShare game_share/continent.h RELEASE ryzom_gameshare_r ryzom_gameshare DEBUG ryzom_gameshare_d DIR ${NEL_DIR} ${RYZOM_DIR} SUFFIXES ryzom) IF(RYZOMGAMESHARE_FOUND) + FIND_PACKAGE(NeL REQUIRED) + LIST(APPEND RYZOMGAMESHARE_INCLUDE_DIRS ${NEL_INCLUDE_DIRS}) + LIST(APPEND RYZOMGAMESHARE_LIBRARIES ${NELMISC_LIBRARIES} ${NELLIGO_LIBRARIES} ${NELNET_LIBRARIES} ${NELGEORGES_LIBRARIES}) + SET(RYZOM_GAMESHARE_LIBRARIES ${RYZOMGAMESHARE_LIBRARIES}) SET(RYZOM_GAMESHARE_FOUND ${RYZOMGAMESHARE_FOUND}) SET(RYZOM_GAMESHARE_INCLUDE_DIR ${RYZOMGAMESHARE_INCLUDE_DIR}) From 6097ada1fa52c347561c4cf7bce52972741aff0e Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 11:20:37 +0200 Subject: [PATCH 08/12] Changed: Removed other throws --HG-- branch : develop --- code/nel/include/nel/net/module_gateway.h | 7 ++----- code/nel/src/net/module_gateway.cpp | 3 --- code/nel/src/net/module_local_gateway.cpp | 4 ---- .../object_viewer/particle_system/particle_node.cpp | 2 +- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/code/nel/include/nel/net/module_gateway.h b/code/nel/include/nel/net/module_gateway.h index 75d386162..40da736a3 100644 --- a/code/nel/include/nel/net/module_gateway.h +++ b/code/nel/include/nel/net/module_gateway.h @@ -171,8 +171,7 @@ namespace NLNET virtual void setTransportPeerInvisible(const std::string &transportInstanceName, bool peerInvisible) =0; /// Activate/stop firewalling mode on a transport - virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled) - throw (EGatewayFirewallBreak) =0; + virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled) =0; /// Send a command to a transport virtual void transportCommand(const TParsedCommandLine &commandLine) =0; @@ -233,9 +232,7 @@ namespace NLNET /** Disclose module information to a connected gateway. * This can also be this gateway itself. */ - virtual void discloseModule(IModuleProxy *moduleProxy) - throw (EGatewayNotConnected) - =0; + virtual void discloseModule(IModuleProxy *moduleProxy) =0; /** Retrieve the proxy for a locally plugged module. * Each local module plugged in a gateway has an associated diff --git a/code/nel/src/net/module_gateway.cpp b/code/nel/src/net/module_gateway.cpp index 0acb4375d..d4d07ea61 100644 --- a/code/nel/src/net/module_gateway.cpp +++ b/code/nel/src/net/module_gateway.cpp @@ -448,7 +448,6 @@ namespace NLNET /// Activate/stop firewalling mode on a transport virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled) - throw (EGatewayFirewallBreak) { TTransportList::iterator it(_Transports.find(transportInstanceName)); if (it == _Transports.end()) @@ -1246,7 +1245,6 @@ namespace NLNET } virtual void discloseModule(IModuleProxy *moduleProxy) - throw (EGatewayNotConnected) { nlassert(moduleProxy->getModuleGateway() == this); @@ -1584,7 +1582,6 @@ namespace NLNET } virtual void _broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message) - throw (EModuleNotPluggedHere) { H_AUTO(CModuleGetaway__broadcastModuleMessage); // send the message to all proxies (except the sender module) diff --git a/code/nel/src/net/module_local_gateway.cpp b/code/nel/src/net/module_local_gateway.cpp index 292a6cafe..0782c2d2c 100644 --- a/code/nel/src/net/module_local_gateway.cpp +++ b/code/nel/src/net/module_local_gateway.cpp @@ -102,7 +102,6 @@ namespace NLNET /// Activate/stop firewalling mode on a transport virtual void setTransportFirewallMode(const std::string &/* transportInstanceName */, bool /* firewalled */) - throw (EGatewayFirewallBreak) { // unsupported nlstop; @@ -174,12 +173,10 @@ namespace NLNET // return; // } // virtual void openGatewayServer(uint16 listeningPort) -// throw (EGatewayAlreadyOpen, EGatewayPortInUse) // { // nlstop; // } // virtual void closeGatewayServer() -// throw (EGatewayNotOpen) // { // nlstop; // } @@ -233,7 +230,6 @@ namespace NLNET { } virtual void discloseModule(IModuleProxy *moduleProxy) - throw (EGatewayNotConnected) { // check that the module is plugged here nlassert(_ModuleProxies.getB(moduleProxy) != NULL); diff --git a/code/studio/src/plugins/object_viewer/particle_system/particle_node.cpp b/code/studio/src/plugins/object_viewer/particle_system/particle_node.cpp index 7bffe2fa3..d8a7573ec 100644 --- a/code/studio/src/plugins/object_viewer/particle_system/particle_node.cpp +++ b/code/studio/src/plugins/object_viewer/particle_system/particle_node.cpp @@ -340,7 +340,7 @@ std::string CParticleWorkspace::getFilename() const return CFile::getFilename(_Filename); } -CWorkspaceNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath) throw( NLMISC::Exception) +CWorkspaceNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath) { // Check that file is not already inserted std::string fileName = NLMISC::CFile::getFilename(filenameWithFullPath); From 2f3a5f26065cea23d6e757f1008f53bf0bbb7f84 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 11:24:49 +0200 Subject: [PATCH 09/12] Changed: Minor changes --HG-- branch : compatibility-develop --- code/nel/src/gui/curl_certificates.cpp | 2 +- code/nel/src/gui/group_html.cpp | 2 +- code/ryzom/common/src/game_share/inventories.h | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/nel/src/gui/curl_certificates.cpp b/code/nel/src/gui/curl_certificates.cpp index 71e4084b3..11053545a 100644 --- a/code/nel/src/gui/curl_certificates.cpp +++ b/code/nel/src/gui/curl_certificates.cpp @@ -97,7 +97,7 @@ namespace NLGUI CURLINFO info; -#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 48, 0) +#if CURL_AT_LEAST_VERSION(7, 48, 0) info = CURLINFO_TLS_SSL_PTR; #else info = CURLINFO_TLS_SESSION; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index b0ecd6ec4..c6e387889 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4448,7 +4448,7 @@ namespace NLGUI string buttonTemplate = DefaultButtonGroup; // Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name" string param = "name=" + this->_Id + "|url=" + getLink(); - string name = ""; + string name; if (!_AnchorName.empty()) name = _AnchorName.back(); typedef pair TTmplParam; diff --git a/code/ryzom/common/src/game_share/inventories.h b/code/ryzom/common/src/game_share/inventories.h index 297b97656..7b9782c9d 100644 --- a/code/ryzom/common/src/game_share/inventories.h +++ b/code/ryzom/common/src/game_share/inventories.h @@ -167,17 +167,17 @@ namespace INVENTORIES pet_animal5, pet_animal6, pet_animal7, - max_pet_animal, // 10 - NUM_INVENTORY = max_pet_animal, // 10 - UNDEFINED = NUM_INVENTORY, // 10 + max_pet_animal, // 11 + NUM_INVENTORY = max_pet_animal, // 11 + UNDEFINED = NUM_INVENTORY, // 11 - exchange, // 11 This is not a bug : exchange is a fake inventory - exchange_proposition, // 12 and should not count in the number of inventory + exchange, // 12 This is not a bug : exchange is a fake inventory + exchange_proposition, // 13 and should not count in the number of inventory // same for botChat trading. - trading, // 13 - reward_sharing, // 14 fake inventory, not in database.xml. Used by the item info protocol only - guild, // 15 (warning: number stored in guild saved file) - player_room, // 16 + trading, // 14 + reward_sharing, // 15 fake inventory, not in database.xml. Used by the item info protocol only + guild, // 16 (warning: number stored in guild saved file) + player_room, // 17 NUM_ALL_INVENTORY // warning: distinct from NUM_INVENTORY }; From 729ba2ebbda876f58079632a87c53c4e5d6eaf64 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 18 Aug 2018 11:51:55 +0200 Subject: [PATCH 10/12] Fixed: Typo --HG-- branch : develop --- code/nel/src/gui/curl_certificates.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/gui/curl_certificates.cpp b/code/nel/src/gui/curl_certificates.cpp index 11053545a..6d1bc86ee 100644 --- a/code/nel/src/gui/curl_certificates.cpp +++ b/code/nel/src/gui/curl_certificates.cpp @@ -116,7 +116,7 @@ namespace NLGUI // CURL using OpenSSL backend // With OpenSSL compiled without any engine, engines will too return NULL // Fortunately, if OpenSSL isn't compiled with engines means we compiled it ourself and CURL is a recent version - if ((res == CURLE_OK) && engine) + if ((res == CURLE_OK) && engines) { // free engines curl_slist_free_all(engines); From dd03e1f0b1130fbc570d0e71563b8c5408ac927b Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 18 Aug 2018 14:15:32 +0300 Subject: [PATCH 11/12] Fixed: Remove onenter callback from html textarea --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index fdf32f44c..b606a093d 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4627,6 +4627,7 @@ namespace NLGUI if (multiLine) templateParams.push_back (std::pair ("multi_min_line", toString(rows))); templateParams.push_back (std::pair ("want_return", multiLine?"true":"false")); + templateParams.push_back (std::pair ("onenter", "")); templateParams.push_back (std::pair ("enter_recover_focus", "false")); if (maxlength > 0) templateParams.push_back (std::pair ("max_num_chars", toString(maxlength))); From 1dc01cf2ffddc7505aa1accc2936a0736c8c399b Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 19 Aug 2018 19:43:44 +0300 Subject: [PATCH 12/12] Fixed: trimSeparators function --HG-- branch : compatibility-develop --- code/nel/include/nel/misc/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index e2a7e69a4..3ae20285a 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -281,10 +281,10 @@ template T trimSeparators (const T &str) { typename T::size_type start = 0; typename T::size_type size = str.size(); - while (start < size && str[start] == ' ' && str[start] == '\t') + while (start < size && (str[start] == ' ' || str[start] == '\t')) start++; typename T::size_type end = size; - while (end > start && str[end-1] == ' ' && str[end-1] == '\t') + while (end > start && (str[end-1] == ' ' || str[end-1] == '\t')) end--; return str.substr (start, end-start); }