From ac5e8b52029413f27511403ffb626248c7cea9d4 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 7 Jun 2016 13:20:23 +0200 Subject: [PATCH 1/6] Fixed: Automatically determine UCRT version --HG-- branch : develop --- code/CMakeModules/FindWindowsSDK.cmake | 39 ++++++++++++++++++-------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index b91c932f8..43864c6a6 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -366,19 +366,34 @@ FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib ) IF(WINSDK_UCRT_DIR) - # directory where UCRT headers are found - FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h - HINTS - ${WINSDK_UCRT_DIR}/Include/10.0.10056.0/ucrt - ${WINSDK_UCRT_DIR}/Include/10.0.10150.0/ucrt - ) + # determine exact UCRT version + SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include) + SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib) - # directory where UCRT libraries are found - FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib - HINTS - ${WINSDK_UCRT_DIR}/Lib/10.0.10056.0/ucrt/${WINSDK8_SUFFIX} - ${WINSDK_UCRT_DIR}/Lib/10.0.10150.0/ucrt/${WINSDK8_SUFFIX} - ) + FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*) + SET(UCRT_VERSION) + + FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS}) + IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION) + SET(UCRT_VERSION ${UCRT_SUBDIR}) + ENDIF() + ENDFOREACH() + + IF(UCRT_VERSION) + MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}") + + # directory where UCRT headers are found + FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h + HINTS + ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}/ucrt + ) + + # directory where UCRT libraries are found + FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib + HINTS + ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}/ucrt/${WINSDK8_SUFFIX} + ) + ENDIF() ENDIF() # signtool is used to sign executables From e140951e563a12de0d4730e23f611a15415c40e6 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 7 Jun 2016 13:21:45 +0200 Subject: [PATCH 2/6] Changed: More details on OS and machine in client.log --HG-- branch : develop --- code/ryzom/client/src/init.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 321fb8f1e..666e86760 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -821,7 +821,10 @@ void initLog() AssertLog->addDisplayer (ClientLogDisplayer); // Display the client version. - nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str()); + nlinfo("RYZOM VERSION: %s", getDebugVersion().c_str()); + nlinfo("Memory: %s/%s", bytesToHumanReadable(CSystemInfo::availablePhysicalMemory()).c_str(), bytesToHumanReadable(CSystemInfo::totalPhysicalMemory()).c_str()); + nlinfo("OS: %s", CSystemInfo::getOS().c_str()); + nlinfo("Processor: %s", CSystemInfo::getProc().c_str()); #ifdef NL_OS_MAC struct rlimit rlp, rlp2, rlp3; From 70aad8085dc5666f4aaf9567c0a8de564043c98b Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 7 Jun 2016 13:22:34 +0200 Subject: [PATCH 3/6] Changed: LZMA updated to 16.02 --HG-- branch : develop --- code/ryzom/client/src/seven_zip/7zMain.cpp | 8 ++++---- code/ryzom/client/src/seven_zip/7zVersion.h | 8 ++++---- code/ryzom/client/src/seven_zip/Ppmd.h | 6 +++--- code/ryzom/client/src/seven_zip/Ppmd7.h | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/code/ryzom/client/src/seven_zip/7zMain.cpp b/code/ryzom/client/src/seven_zip/7zMain.cpp index 704cf6bb1..0e5417ad9 100644 --- a/code/ryzom/client/src/seven_zip/7zMain.cpp +++ b/code/ryzom/client/src/seven_zip/7zMain.cpp @@ -1,5 +1,5 @@ /* 7zMain.c - Test application for 7z Decoder -2015-08-02 : Igor Pavlov : Public domain */ +2016-05-16 : Igor Pavlov : Public domain */ #include "Precomp.h" @@ -310,10 +310,10 @@ static void ConvertFileTimeToString(const CNtfsFileTime *nt, char *s) ms[1] = 29; for (mon = 0;; mon++) { - unsigned s = ms[mon]; - if (v < s) + unsigned d = ms[mon]; + if (v < d) break; - v -= s; + v -= d; } s = UIntToStr(s, year, 4); *s++ = '-'; UIntToStr_2(s, mon + 1); s[2] = '-'; s += 3; diff --git a/code/ryzom/client/src/seven_zip/7zVersion.h b/code/ryzom/client/src/seven_zip/7zVersion.h index d4c603678..e884fc679 100644 --- a/code/ryzom/client/src/seven_zip/7zVersion.h +++ b/code/ryzom/client/src/seven_zip/7zVersion.h @@ -1,9 +1,9 @@ #define MY_VER_MAJOR 16 -#define MY_VER_MINOR 00 +#define MY_VER_MINOR 02 #define MY_VER_BUILD 0 -#define MY_VERSION_NUMBERS "16.00" -#define MY_VERSION "16.00" -#define MY_DATE "2016-05-10" +#define MY_VERSION_NUMBERS "16.02" +#define MY_VERSION "16.02" +#define MY_DATE "2016-05-21" #undef MY_COPYRIGHT #undef MY_VERSION_COPYRIGHT_DATE #define MY_AUTHOR_NAME "Igor Pavlov" diff --git a/code/ryzom/client/src/seven_zip/Ppmd.h b/code/ryzom/client/src/seven_zip/Ppmd.h index 4356dd1d8..5655b26d7 100644 --- a/code/ryzom/client/src/seven_zip/Ppmd.h +++ b/code/ryzom/client/src/seven_zip/Ppmd.h @@ -1,5 +1,5 @@ /* Ppmd.h -- PPMD codec common code -2013-01-18 : Igor Pavlov : Public domain +2016-05-16 : Igor Pavlov : Public domain This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ #ifndef __PPMD_H @@ -77,8 +77,8 @@ typedef CPpmd_Byte_Ref; #define PPMD_SetAllBitsIn256Bytes(p) \ - { unsigned i; for (i = 0; i < 256 / sizeof(p[0]); i += 8) { \ - p[i+7] = p[i+6] = p[i+5] = p[i+4] = p[i+3] = p[i+2] = p[i+1] = p[i+0] = ~(size_t)0; }} + { unsigned z; for (z = 0; z < 256 / sizeof(p[0]); z += 8) { \ + p[z+7] = p[z+6] = p[z+5] = p[z+4] = p[z+3] = p[z+2] = p[z+1] = p[z+0] = ~(size_t)0; }} EXTERN_C_END diff --git a/code/ryzom/client/src/seven_zip/Ppmd7.h b/code/ryzom/client/src/seven_zip/Ppmd7.h index 96521c31f..87eefde80 100644 --- a/code/ryzom/client/src/seven_zip/Ppmd7.h +++ b/code/ryzom/client/src/seven_zip/Ppmd7.h @@ -1,5 +1,5 @@ /* Ppmd7.h -- PPMdH compression codec -2010-03-12 : Igor Pavlov : Public domain +2016-05-21 : Igor Pavlov : Public domain This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ /* This code supports virtual RangeDecoder and includes the implementation @@ -86,10 +86,10 @@ void Ppmd7_Update2(CPpmd7 *p); void Ppmd7_UpdateBin(CPpmd7 *p); #define Ppmd7_GetBinSumm(p) \ - &p->BinSumm[Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \ + &p->BinSumm[(unsigned)Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \ p->NS2BSIndx[Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \ (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \ - 2 * p->HB2Flag[Ppmd7Context_OneState(p->MinContext)->Symbol] + \ + 2 * p->HB2Flag[(unsigned)Ppmd7Context_OneState(p->MinContext)->Symbol] + \ ((p->RunLength >> 26) & 0x20)] CPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *scale); From 1c03b41fabd3da412a89e812cbccd106c66e427c Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 7 Jun 2016 13:24:26 +0200 Subject: [PATCH 4/6] Changed: Delete clients and profiles operations --HG-- branch : develop --- .../ryzom_installer/src/operationdialog.cpp | 82 +++++++++++++++++-- .../ryzom_installer/src/operationdialog.h | 1 + 2 files changed, 74 insertions(+), 9 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index ef05f1ce8..81db90561 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -668,45 +668,109 @@ bool COperationDialog::createAddRemoveEntry() return true; } +bool COperationDialog::deleteAddRemoveEntry() +{ +#ifdef Q_OS_WIN + QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat); + settings.remove(""); +#endif + + emit done(); + + return true; +} + void COperationDialog::deleteComponentsServers() { m_currentOperation = QApplication::tr("Delete client files"); m_currentOperationProgressFormat = QApplication::tr("Deleting %1..."); -// connect(m_downloader, SIGNAL(downloadPrepare()), SLOT(onProgressPrepare())); -// connect(m_downloader, SIGNAL(downloadInit(qint64, qint64)), SLOT(onProgressInit(qint64, qint64))); -// connect(m_downloader, SIGNAL(downloadStart()), SLOT(onProgressStart())); -// connect(m_downloader, SIGNAL(downloadStop()), SLOT(onProgressStop())); -// connect(m_downloader, SIGNAL(downloadProgress(qint64, QString)), SLOT(onProgressProgress(qint64, QString))); - + emit prepare(); + emit init(0, m_components.servers.size()); + emit start(); CConfigFile *config = CConfigFile::getInstance(); + int i = 0; + foreach(int serverIndex, m_components.servers) { + if (operationShouldStop()) + { + emit stop(); + return; + } + const CServer &server = config->getServer(serverIndex); + emit progress(i++, server.name); + QString path = config->getInstallationDirectory() + "/" + server.id; QDir dir(path); - if (!dir.exists() || !dir.removeRecursively()) + if (dir.exists() && !dir.removeRecursively()) { - emit onProgressFail(tr("Uninstall to delete files for client %1").arg(server.name)); + emit fail(tr("Unable to delete files for client %1").arg(server.name)); + return; } } - emit onProgressSuccess(m_components.servers.size()); + emit success(m_components.servers.size()); emit done(); } void COperationDialog::deleteComponentsProfiles() { + m_currentOperation = QApplication::tr("Delete profiles"); + m_currentOperationProgressFormat = QApplication::tr("Deleting profile %1..."); + + emit prepare(); + emit init(0, m_components.servers.size()); + + CConfigFile *config = CConfigFile::getInstance(); + + int i = 0; + + foreach(int profileIndex, m_components.profiles) + { + if (operationShouldStop()) + { + emit stop(); + return; + } + + const CProfile &profile = config->getProfile(profileIndex); + + emit progress(i++, profile.name); + + QString path = config->getProfileDirectory() + "/" + profile.id; + + QDir dir(path); + + if (dir.exists() && !dir.removeRecursively()) + { + emit fail(tr("Unable to delete files for profile %1").arg(profile.name)); + return; + } + } + + emit success(m_components.servers.size()); emit done(); } void COperationDialog::deleteComponentsInstaller() { + m_currentOperation = QApplication::tr("Delete installer"); + m_currentOperationProgressFormat = QApplication::tr("Deleting %1..."); + + CConfigFile *config = CConfigFile::getInstance(); + + // TODO: delete installer + + deleteAddRemoveEntry(); + + emit onProgressSuccess(m_components.servers.size()); emit done(); } diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h index 61105742d..fe252ab6a 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h @@ -107,6 +107,7 @@ protected: bool createDefaultProfile(); bool createDefaultShortcuts(); bool createAddRemoveEntry(); + bool deleteAddRemoveEntry(); void deleteComponentsServers(); void deleteComponentsProfiles(); void deleteComponentsInstaller(); From 1588b4399871fdbaeac256b773178b32a4bab05d Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 7 Jun 2016 13:25:03 +0200 Subject: [PATCH 5/6] Changed: Minor changes --HG-- branch : develop --- code/ryzom/tools/client/ryzom_installer/src/main.cpp | 2 ++ code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 55388fa7e..53bdd623d 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -60,6 +60,8 @@ int main(int argc, char *argv[]) QApplication::setApplicationVersion(RYZOM_VERSION); QApplication::setWindowIcon(QIcon(":/icons/ryzom.ico")); + // TODO: if not launched from TEMP dir, copy files to TEMP, restart it and exit + QLocale locale = QLocale::system(); // load application translations diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp index 04937c485..d113ab2c2 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp @@ -18,6 +18,7 @@ #include "profilesdialog.h" #include "profilesmodel.h" #include "serversmodel.h" +#include "operationdialog.h" #ifdef DEBUG_NEW #define new DEBUG_NEW @@ -133,6 +134,8 @@ void CProfilesDialog::deleteProfile(int index) if (index < 0) return; m_model->removeRow(index); + + COperationDialog dialog; } void CProfilesDialog::addProfile() From 3ec485331ca634c2d27dd68f1bb600bbbc28c1ee Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 7 Jun 2016 13:31:21 +0200 Subject: [PATCH 6/6] Changed: Replace ~0 by std::numeric_limits --HG-- branch : develop --- code/ryzom/common/src/game_share/entity_types.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/ryzom/common/src/game_share/entity_types.h b/code/ryzom/common/src/game_share/entity_types.h index aad2d94e9..189e7c803 100644 --- a/code/ryzom/common/src/game_share/entity_types.h +++ b/code/ryzom/common/src/game_share/entity_types.h @@ -27,6 +27,8 @@ #include "nel/misc/common.h" +#include + namespace CLFECOMMON { @@ -230,7 +232,7 @@ const uint MAX_PROPERTIES_PER_ENTITY = NB_VISUAL_PROPERTIES; // Special constant for unassociating -const TPropIndex PROPERTY_DISASSOCIATION = (TPropIndex)(~0)-1; +const TPropIndex PROPERTY_DISASSOCIATION = std::numeric_limits::max()-1; // Names (debug info) @@ -399,13 +401,13 @@ public: bool BranchHasPayload; /// Constructor - TVPNodeBase() : VPParent(NULL), VPA(NULL), VPB(NULL), PropIndex(~0), BranchHasPayload(false) {} + TVPNodeBase() : VPParent(NULL), VPA(NULL), VPB(NULL), PropIndex(std::numeric_limits::max()), BranchHasPayload(false) {} virtual ~TVPNodeBase() {} /// Return true if the node is root of a tree bool isRoot() const { return VPParent == NULL; } /// Return true if the node is leaf of a tree - bool isLeaf() const { return PropIndex != (CLFECOMMON::TPropIndex)~0; } + bool isLeaf() const { return PropIndex != std::numeric_limits::max(); } /// Return the level of the node in a tree (root=1) uint getLevel() const