From 5239e9545b4bd16f5bfe1e8db536b105b7548f56 Mon Sep 17 00:00:00 2001 From: Gary Preston Date: Sun, 31 Jan 2016 13:35:27 +0000 Subject: [PATCH 01/61] Update BnpMake arguements to output bnp files to target folder/name using -o switch. Exclude first element from package[1] which was used to build the targetBnp file rather than a file to be included within the bnp. --- code/nel/tools/build_gamedata/d1_client_patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/tools/build_gamedata/d1_client_patch.py b/code/nel/tools/build_gamedata/d1_client_patch.py index 600347d0b..449d6e0b7 100755 --- a/code/nel/tools/build_gamedata/d1_client_patch.py +++ b/code/nel/tools/build_gamedata/d1_client_patch.py @@ -136,7 +136,7 @@ else: needUpdateBnp = needUpdateDirNoSubdirFile(log, sourcePath, targetBnp) if (needUpdateBnp): printLog(log, "BNP " + targetBnp) - subprocess.call([ BnpMake, "/p", sourcePath, targetPath ] + package[1]) + subprocess.call([ BnpMake, "-p", sourcePath, "-o", targetBnp ] + package[1][1:]) else: printLog(log, "SKIP " + targetBnp) printLog(log, "") From 388050a7fa6348104794224efe3d63538e6ab5cb Mon Sep 17 00:00:00 2001 From: Gary Preston Date: Sun, 31 Jan 2016 18:02:47 +0000 Subject: [PATCH 02/61] Allow bnp_make to process "if" and "ifnot" argumenets multiple times instead of accepting only one instance or each. --- code/nel/tools/misc/bnp_make/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/misc/bnp_make/main.cpp b/code/nel/tools/misc/bnp_make/main.cpp index 98ddf84d6..868f36f62 100644 --- a/code/nel/tools/misc/bnp_make/main.cpp +++ b/code/nel/tools/misc/bnp_make/main.cpp @@ -134,8 +134,8 @@ int main(int argc, char **argv) args.addArg("u", "unpack", "", "Unpack the BNP file to a directory"); args.addArg("l", "list", "", "List the files contained in the BNP file"); args.addArg("o", "output", "destination", "Output directory or file"); - args.addArg("i", "if", "wildcard", "Add the file if it matches the wilcard (at least one 'if' conditions must be met for a file to be adding)"); - args.addArg("n", "ifnot", "wildcard", "Add the file if it doesn't match the wilcard (all the 'ifnot' conditions must be met for a file to be adding)"); + args.addArg("i", "if", "wildcard", "Add the file if it matches the wilcard (at least one 'if' conditions must be met for a file to be adding)", false); + args.addArg("n", "ifnot", "wildcard", "Add the file if it doesn't match the wilcard (all the 'ifnot' conditions must be met for a file to be adding)", false); args.addAdditionalArg("input", "Input directory or BNP file depending on command"); if (!args.parse(argc, argv)) return 1; From 92c598c81e48d38303e7bc2e2ee15c25d97dd6a2 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 10:21:42 +0100 Subject: [PATCH 03/61] Changed: Moved LZMA and 7z functions/methods in seven_zip Changed: Removed old 7z/lzma code since the library has been updated Fixed: Implemented packLZMA function to compress a file with LZMA --- code/ryzom/client/src/login_patch.cpp | 7 +- code/ryzom/client/src/login_patch.h | 4 - .../client/src/login_patch_seven_zip.cpp | 468 ------------------ code/ryzom/client/src/seven_zip/seven_zip.cpp | 357 +++++++++++++ code/ryzom/client/src/seven_zip/seven_zip.h | 31 ++ 5 files changed, 392 insertions(+), 475 deletions(-) delete mode 100644 code/ryzom/client/src/login_patch_seven_zip.cpp create mode 100644 code/ryzom/client/src/seven_zip/seven_zip.cpp create mode 100644 code/ryzom/client/src/seven_zip/seven_zip.h diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index c942071d0..37cbddcbd 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -54,6 +54,7 @@ #include "login.h" #include "user_agent.h" +#include "seven_zip/seven_zip.h" #ifndef RY_BG_DOWNLOADER #include "client_cfg.h" @@ -2625,7 +2626,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) // try to unpack the file try { - if (!CPatchManager::unpackLZMA(pPM->ClientPatchPath+lzmaFile, OutFilename+".tmp")) + if (!unpackLZMA(pPM->ClientPatchPath+lzmaFile, OutFilename+".tmp")) { // fallback to standard patch method usePatchFile = true; @@ -3087,7 +3088,7 @@ bool CPatchManager::download(const std::string& patchFullname, const std::string && patchName.substr(patchName.size() - zsStrLength) == zsStr) { std::string outFilename = patchName.substr(0, patchName.size() - zsStrLength); - CPatchManager::unpack7Zip(patchName, outFilename); + unpack7Zip(patchName, outFilename); pPM->deleteFile(patchName); pPM->renameFile(outFilename, sourceFullname); } @@ -3449,7 +3450,7 @@ void CInstallThread::run() std::string outFilename = patchName.substr(0, patchName.size() - zsStrLength); std::string localOutFilename = CPath::standardizeDosPath(outFilename); - if ( CPatchManager::unpackLZMA(patchName, localOutFilename) ) + if ( unpackLZMA(patchName, localOutFilename) ) { pPM->deleteFile(patchName); pPM->renameFile(outFilename, sourceName); diff --git a/code/ryzom/client/src/login_patch.h b/code/ryzom/client/src/login_patch.h index 9fdf907e8..c7f0f4509 100644 --- a/code/ryzom/client/src/login_patch.h +++ b/code/ryzom/client/src/login_patch.h @@ -331,10 +331,6 @@ private: void clearDataScanLog(); static void getCorruptedFileInfo(const SFileToPatch &ftp, ucstring &sTranslate); - // utility func to decompress a monofile 7zip archive - static bool unpack7Zip(const std::string &sevenZipFile, const std::string &destFileName); - // utility func to decompress a single LZMA packed file - static bool unpackLZMA(const std::string &sevenZipFile, const std::string &destFileName); static bool downloadAndUnpack(const std::string& patchPath, const std::string& sourceFilename, const std::string& extractPath, const std::string& tmpDirectory, uint32 timestamp); // Forward message to Installation Software void onFileInstallFinished(); diff --git a/code/ryzom/client/src/login_patch_seven_zip.cpp b/code/ryzom/client/src/login_patch_seven_zip.cpp deleted file mode 100644 index 306c0607f..000000000 --- a/code/ryzom/client/src/login_patch_seven_zip.cpp +++ /dev/null @@ -1,468 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// -// Includes -// - -#include "stdpch.h" -#include "login_patch.h" - -#define RZ_USE_SEVENZIP 1 -#define RZ_USE_NEW_LZMA - -#ifdef RZ_USE_SEVENZIP - -#ifdef RZ_USE_NEW_LZMA - -#include "seven_zip/7z.h" -#include "seven_zip/7zAlloc.h" -#include "seven_zip/7zBuf.h" -#include "seven_zip/7zCrc.h" -#include "seven_zip/7zFile.h" -#include "seven_zip/7zVersion.h" -#include "seven_zip/LzmaDec.h" - -#else - -#include "seven_zip/7zCrc.h" -#include "seven_zip/7zIn.h" -#include "seven_zip/7zExtract.h" -#include "seven_zip/LzmaDecode.h" - -#endif - -// -// Namespaces -// - -using namespace std; -using namespace NLMISC; - - -#ifdef RZ_USE_NEW_LZMA - -/// Input stream class for 7zip archive -class CNel7ZipInStream : public ISeekInStream -{ - NLMISC::IStream *_Stream; - -public: - /// Constructor, only allow file stream because 7zip will 'seek' in the stream - CNel7ZipInStream(NLMISC::IStream *s) - : _Stream(s) - { - Read = readFunc; - Seek = seekFunc; - } - - // the read function called by 7zip to read data - static SRes readFunc(void *object, void *buffer, size_t *size) - { - try - { - CNel7ZipInStream *me = (CNel7ZipInStream*)object; - uint len = (uint)*size; - me->_Stream->serialBuffer((uint8*)buffer, len); - return SZ_OK; - } - catch (...) - { - return SZ_ERROR_READ; - } - } - - // the seek function called by seven zip to seek inside stream - static SRes seekFunc(void *object, Int64 *pos, ESzSeek origin) - { - try - { - CNel7ZipInStream *me = (CNel7ZipInStream*)object; - sint32 offset = (sint32)*pos; - bool ret = me->_Stream->seek(offset, (NLMISC::IStream::TSeekOrigin)origin); - - if (ret) - { - *pos = (Int64)me->_Stream->getPos(); - return SZ_OK; - } - } - catch (...) - { - } - - return SZ_ERROR_READ; - } -}; - -#else - -/// Input stream class for 7zip archive -class CNel7ZipInStream : public _ISzInStream -{ - NLMISC::IStream *_Stream; - -public: - /// Constructor, only allow file stream because 7zip will 'seek' in the stream - CNel7ZipInStream(NLMISC::IStream *s) - : _Stream(s) - { - Read = readFunc; - Seek = seekFunc; - } - - // the read function called by 7zip to read data - static SZ_RESULT readFunc(void *object, void *buffer, size_t size, size_t *processedSize) - { - try - { - CNel7ZipInStream *me = (CNel7ZipInStream*)object; - me->_Stream->serialBuffer((uint8*)buffer, (uint)size); - *processedSize = size; - return SZ_OK; - } - catch (...) - { - return SZE_FAIL; - } - } - - // the seek function called by seven zip to seek inside stream - static SZ_RESULT seekFunc(void *object, CFileSize pos) - { - try - { - CNel7ZipInStream *me = (CNel7ZipInStream*)object; - bool ret= me->_Stream->seek(pos, NLMISC::IStream::begin); - if (ret) - return SZ_OK; - else - return SZE_FAIL; - } - catch (...) - { - return SZE_FAIL; - } - } -}; - -#endif - -#endif - -bool CPatchManager::unpack7Zip(const std::string &sevenZipFile, const std::string &destFileName) -{ -#ifdef RZ_USE_SEVENZIP - nlinfo("Uncompressing 7zip archive '%s' to '%s'", sevenZipFile.c_str(), destFileName.c_str()); - - // init seven zip - ISzAlloc allocImp; - allocImp.Alloc = SzAlloc; - allocImp.Free = SzFree; - - ISzAlloc allocTempImp; - allocTempImp.Alloc = SzAllocTemp; - allocTempImp.Free = SzFreeTemp; - - // wrap file in a CIFile - CIFile input(sevenZipFile); - CNel7ZipInStream inStr(&input); - -#ifdef RZ_USE_NEW_LZMA - - CLookToRead lookStream; - lookStream.realStream = &inStr; - LookToRead_CreateVTable(&lookStream, False); - LookToRead_Init(&lookStream); - - CrcGenerateTable(); - - CSzArEx db; - SzArEx_Init(&db); - - // unpack the file using the 7zip API - SRes res = SzArEx_Open(&db, &lookStream.s, &allocImp, &allocTempImp); - - if (res != SZ_OK) - { - nlerror("Failed to open archive file %s", sevenZipFile.c_str()); - return false; - } - - if (db.NumFiles != 1) - { - nlerror("Seven zip archive with more than 1 file are unsupported"); - return false; - } - - UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */ - Byte *outBuffer = 0; /* it must be 0 before first call for each new archive. */ - size_t outBufferSize = 0; /* it can have any value before first call (if outBuffer = 0) */ - - size_t offset; - size_t outSizeProcessed = 0; - - // get the first file - res = SzArEx_Extract(&db, &lookStream.s, 0, - &blockIndex, &outBuffer, &outBufferSize, - &offset, &outSizeProcessed, - &allocImp, &allocTempImp); - - // get the length of first file - size_t nameLen = SzArEx_GetFileNameUtf16(&db, 0, NULL); - - ucstring filename; - filename.resize(nameLen); - - // write filename into ucstring - SzArEx_GetFileNameUtf16(&db, 0, &filename[0]); - - // write the extracted file - FILE *outputHandle = fopen(destFileName.c_str(), "wb+"); - - if (outputHandle == 0) - { - nlerror("Can not open output file '%s'", destFileName.c_str()); - return false; - } - - UInt32 processedSize = (UInt32)fwrite(outBuffer + offset, 1, outSizeProcessed, outputHandle); - - if (processedSize != outSizeProcessed) - { - nlerror("Failed to write %u char to output file '%s'", outSizeProcessed-processedSize, destFileName.c_str()); - return false; - } - - fclose(outputHandle); - - IAlloc_Free(&allocImp, outBuffer); - - // free 7z context - SzArEx_Free(&db, &allocImp); - -#else - - InitCrcTable(); - - CArchiveDatabaseEx db; - SzArDbExInit(&db); - - // unpack the file using the 7zip API - SZ_RESULT res = SzArchiveOpen(&inStr, &db, &allocImp, &allocTempImp); - - if (res != SZ_OK) - { - nlerror("Failed to open archive file %s", sevenZipFile.c_str()); - return false; - } - - if (db.Database.NumFiles != 1) - { - nlerror("Seven zip archive with more than 1 file are unsupported"); - return false; - } - - UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */ - Byte *outBuffer = 0; /* it must be 0 before first call for each new archive. */ - size_t outBufferSize = 0; /* it can have any value before first call (if outBuffer = 0) */ - - size_t offset = 0; - size_t outSizeProcessed = 0; - - // get the first file - res = SzExtract(&inStr, &db, 0, - &blockIndex, &outBuffer, &outBufferSize, - &offset, &outSizeProcessed, - &allocImp, &allocTempImp); - - // write the extracted file - FILE *outputHandle = fopen(destFileName.c_str(), "wb+"); - - if (outputHandle == 0) - { - nlerror("Can not open output file '%s'", destFileName.c_str()); - return false; - } - - UInt32 processedSize = (UInt32)fwrite(outBuffer + offset, 1, outSizeProcessed, outputHandle); - - if (processedSize != outSizeProcessed) - { - nlerror("Failed to write %u char to output file '%s'", outSizeProcessed-processedSize, destFileName.c_str()); - return false; - } - - fclose(outputHandle); - allocImp.Free(outBuffer); - - // free 7z context - SzArDbExFree(&db, allocImp.Free); - -#endif - - // ok, all is fine, file is unpacked - return true; -#else - return false; -#endif -} - -bool CPatchManager::unpackLZMA(const std::string &lzmaFile, const std::string &destFileName) -{ -#ifdef RZ_USE_SEVENZIP - nldebug("unpackLZMA : decompression the lzma file '%s' into output file '%s", lzmaFile.c_str(), destFileName.c_str()); - - CIFile inStream(lzmaFile); - uint32 inSize = inStream.getFileSize(); - -#ifdef RZ_USE_NEW_LZMA - - if (inSize < LZMA_PROPS_SIZE + 8) - { - nlwarning("Invalid file size, too small file '%s'", lzmaFile.c_str()); - return false; - } - - // read the compressed file in buffer - auto_ptr inBuffer = auto_ptr(new uint8[inSize]); - inStream.serialBuffer(inBuffer.get(), inSize); - - uint8 *pos = inBuffer.get(); - - pos += LZMA_PROPS_SIZE; - - // read the output file size - size_t fileSize = 0; - - for (int i = 0; i < 8; ++i) - { - if (pos >= inBuffer.get()+inSize) - { - nlassert(false); - return false; - } - - fileSize |= ((UInt64)*pos++) << (8 * i); - } - - // allocators - ISzAlloc allocImp; - allocImp.Alloc = SzAlloc; - allocImp.Free = SzFree; - - CLzmaDec state; - LzmaDec_Construct(&state); - - // allocate and decode props and probs - SRes res = LzmaDec_Allocate(&state, inBuffer.get(), LZMA_PROPS_SIZE, &allocImp); - - if (res != 0) - { - nlwarning("Failed to decode lzma properies in file '%s'!", lzmaFile.c_str()); - return false; - } - - // allocate the output buffer - auto_ptr outBuffer = auto_ptr(new uint8[fileSize]); - - // in and out file sizes - SizeT outProcessed = fileSize; - SizeT inProcessed = (SizeT)(inSize-(pos-inBuffer.get())); - - LzmaDec_Init(&state); - - // decompress the file in memory - ELzmaStatus status; - res = LzmaDec_DecodeToBuf(&state, (Byte*)outBuffer.get(), &outProcessed, (Byte*)pos, &inProcessed, LZMA_FINISH_ANY, &status); - - // free memory - LzmaDec_Free(&state, &allocImp); - - if (res != 0 || outProcessed != fileSize) - { - nlwarning("Failed to decode lzma file '%s' with status %d", lzmaFile.c_str(), (sint)status); - return false; - } - -#else - - auto_ptr inBuffer = auto_ptr(new uint8[inSize]); - inStream.serialBuffer(inBuffer.get(), inSize); - - CLzmaDecoderState state; - - uint8 *pos = inBuffer.get(); - - // read the lzma properties - int res = LzmaDecodeProperties(&state.Properties, (unsigned char*) pos, LZMA_PROPERTIES_SIZE); - if (res != 0) - { - nlwarning("Failed to decode lzma properies in file '%s'!", lzmaFile.c_str()); - return false; - } - - if (inSize < LZMA_PROPERTIES_SIZE + 8) - { - nlwarning("Invalid file size, too small file '%s'", lzmaFile.c_str()); - return false; - } - - // alloc the probs, making sure they are deleted in function exit - size_t nbProb = LzmaGetNumProbs(&state.Properties); - auto_ptr probs = auto_ptr(new CProb[nbProb]); - state.Probs = probs.get(); - - pos += LZMA_PROPERTIES_SIZE; - - // read the output file size - size_t fileSize = 0; - for (int i = 0; i < 8; i++) - { - if (pos >= inBuffer.get()+inSize) - { - nlassert(false); - return false; - } - fileSize |= ((UInt64)*pos++) << (8 * i); - } - - SizeT outProcessed = 0; - SizeT inProcessed = 0; - - // allocate the output buffer - auto_ptr outBuffer = auto_ptr(new uint8[fileSize]); - - // decompress the file in memory - res = LzmaDecode(&state, (unsigned char*) pos, (SizeT)(inSize-(pos-inBuffer.get())), &inProcessed, (unsigned char*)outBuffer.get(), (SizeT)fileSize, &outProcessed); - - if (res != 0 || outProcessed != fileSize) - { - nlwarning("Failed to decode lzma file '%s'", lzmaFile.c_str()); - return false; - } - -#endif - - // store on output buffer - COFile outStream(destFileName); - outStream.serialBuffer(outBuffer.get(), (uint)fileSize); - - return true; -#else - return false; -#endif -} diff --git a/code/ryzom/client/src/seven_zip/seven_zip.cpp b/code/ryzom/client/src/seven_zip/seven_zip.cpp new file mode 100644 index 000000000..84a7eaace --- /dev/null +++ b/code/ryzom/client/src/seven_zip/seven_zip.cpp @@ -0,0 +1,357 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "seven_zip.h" + +#include "nel/misc/types_nl.h" +#include "nel/misc/file.h" +#include "nel/misc/path.h" + +#include "7z.h" +#include "7zAlloc.h" +#include "7zCrc.h" +#include "7zVersion.h" +#include "LzmaLib.h" + +#include + +// +// Namespaces +// + +using namespace std; +using namespace NLMISC; + + +/// Input stream class for 7zip archive +class CNel7ZipInStream : public ISeekInStream +{ + NLMISC::IStream *_Stream; + +public: + /// Constructor, only allow file stream because 7zip will 'seek' in the stream + CNel7ZipInStream(NLMISC::IStream *s) + : _Stream(s) + { + Read = readFunc; + Seek = seekFunc; + } + + // the read function called by 7zip to read data + static SRes readFunc(void *object, void *buffer, size_t *size) + { + try + { + CNel7ZipInStream *me = (CNel7ZipInStream*)object; + uint len = (uint)*size; + me->_Stream->serialBuffer((uint8*)buffer, len); + return SZ_OK; + } + catch (...) + { + return SZ_ERROR_READ; + } + } + + // the seek function called by seven zip to seek inside stream + static SRes seekFunc(void *object, Int64 *pos, ESzSeek origin) + { + try + { + CNel7ZipInStream *me = (CNel7ZipInStream*)object; + sint32 offset = (sint32)*pos; + bool ret = me->_Stream->seek(offset, (NLMISC::IStream::TSeekOrigin)origin); + + if (ret) + { + *pos = (Int64)me->_Stream->getPos(); + return SZ_OK; + } + } + catch (...) + { + } + + return SZ_ERROR_READ; + } +}; + +bool unpack7Zip(const std::string &sevenZipFile, const std::string &destFileName) +{ + nlinfo("Uncompressing 7zip archive '%s' to '%s'", sevenZipFile.c_str(), destFileName.c_str()); + + // init seven zip + ISzAlloc allocImp; + allocImp.Alloc = SzAlloc; + allocImp.Free = SzFree; + + ISzAlloc allocTempImp; + allocTempImp.Alloc = SzAllocTemp; + allocTempImp.Free = SzFreeTemp; + + // wrap file in a CIFile + CIFile input(sevenZipFile); + CNel7ZipInStream inStr(&input); + + CLookToRead lookStream; + lookStream.realStream = &inStr; + LookToRead_CreateVTable(&lookStream, False); + LookToRead_Init(&lookStream); + + CrcGenerateTable(); + + CSzArEx db; + SzArEx_Init(&db); + + // unpack the file using the 7zip API + SRes res = SzArEx_Open(&db, &lookStream.s, &allocImp, &allocTempImp); + + if (res != SZ_OK) + { + nlerror("Failed to open archive file %s", sevenZipFile.c_str()); + return false; + } + + if (db.NumFiles != 1) + { + nlerror("Seven zip archive with more than 1 file are unsupported"); + return false; + } + + UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */ + Byte *outBuffer = 0; /* it must be 0 before first call for each new archive. */ + size_t outBufferSize = 0; /* it can have any value before first call (if outBuffer = 0) */ + + size_t offset; + size_t outSizeProcessed = 0; + + // get the first file + res = SzArEx_Extract(&db, &lookStream.s, 0, + &blockIndex, &outBuffer, &outBufferSize, + &offset, &outSizeProcessed, + &allocImp, &allocTempImp); + + // get the length of first file + size_t nameLen = SzArEx_GetFileNameUtf16(&db, 0, NULL); + + ucstring filename; + filename.resize(nameLen); + + // write filename into ucstring + SzArEx_GetFileNameUtf16(&db, 0, &filename[0]); + + // write the extracted file + FILE *outputHandle = fopen(destFileName.c_str(), "wb+"); + + if (outputHandle == 0) + { + nlerror("Can not open output file '%s'", destFileName.c_str()); + return false; + } + + UInt32 processedSize = (UInt32)fwrite(outBuffer + offset, 1, outSizeProcessed, outputHandle); + + if (processedSize != outSizeProcessed) + { + nlerror("Failed to write %u char to output file '%s'", outSizeProcessed-processedSize, destFileName.c_str()); + return false; + } + + fclose(outputHandle); + + IAlloc_Free(&allocImp, outBuffer); + + // free 7z context + SzArEx_Free(&db, &allocImp); + + // ok, all is fine, file is unpacked + return true; +} + +bool unpackLZMA(const std::string &lzmaFile, const std::string &destFileName) +{ + nldebug("unpackLZMA: decompress LZMA file '%s' to '%s", lzmaFile.c_str(), destFileName.c_str()); + + // open input file + CIFile inStream(lzmaFile); + uint32 inSize = inStream.getFileSize(); + + if (inSize < LZMA_PROPS_SIZE + 8) + { + nlwarning("unpackLZMA: Invalid file size, too small file '%s'", lzmaFile.c_str()); + return false; + } + + // allocate input buffer for props + auto_ptr propsBuffer = auto_ptr(new uint8[LZMA_PROPS_SIZE]); + + // size of LZMA content + inSize -= LZMA_PROPS_SIZE + 8; + + // allocate input buffer for lzma data + auto_ptr inBuffer = auto_ptr(new uint8[inSize]); + + uint64 fileSize = 0; + + try + { + // read props + inStream.serialBuffer(propsBuffer.get(), LZMA_PROPS_SIZE); + + // read uncompressed size + inStream.serial(fileSize); + + // read lzma content + inStream.serialBuffer(inBuffer.get(), inSize); + } + catch(const EReadError &e) + { + nlwarning("unpackLZMA: Error while reading '%s': %s", lzmaFile.c_str(), e.what()); + return false; + } + + // allocate the output buffer + auto_ptr outBuffer = auto_ptr(new uint8[fileSize]); + + // in and out file sizes + SizeT outProcessed = (SizeT)fileSize; + SizeT inProcessed = (SizeT)inSize; + + // decompress the file in memory + sint res = LzmaUncompress(outBuffer.get(), &outProcessed, inBuffer.get(), &inProcessed, propsBuffer.get(), LZMA_PROPS_SIZE); + + if (res != 0 || outProcessed != fileSize) + { + nlwarning("unpackLZMA: Failed to decode lzma file '%s' with status %d", lzmaFile.c_str(), res); + return false; + } + + // store on output buffer + COFile outStream(destFileName); + + try + { + // write content + outStream.serialBuffer(outBuffer.get(), (uint)fileSize); + } + catch(const EFile &e) + { + nlwarning("unpackLZMA: Error while writing '%s': %s", destFileName.c_str(), e.what()); + CFile::deleteFile(destFileName); + return false; + } + + return true; +} + +bool packLZMA(const std::string &srcFileName, const std::string &lzmaFileName) +{ + nldebug("unpackLZMA: compress '%s' to LZMA file '%s", srcFileName.c_str(), lzmaFileName.c_str()); + + // open file + CIFile inStream(srcFileName); + size_t inSize = inStream.getFileSize(); + + // file empty + if (!inSize) + { + nlwarning("packLZMA: File '%s' not found or empty", srcFileName.c_str()); + return false; + } + + // allocate input buffer + auto_ptr inBuffer = auto_ptr(new uint8[inSize]); + + try + { + // read file in buffer + inStream.serialBuffer(inBuffer.get(), inSize); + } + catch(const EReadError &e) + { + nlwarning("packLZMA: Error while reading '%s': %s", srcFileName.c_str(), e.what()); + return false; + } + + // allocate output buffer + size_t outSize = (11 * inSize / 10) + 65536; // worst case = 1.1 * size + 64K + auto_ptr outBuffer = auto_ptr(new uint8[outSize]); + + // allocate buffer for props + size_t outPropsSize = LZMA_PROPS_SIZE; + auto_ptr outProps = auto_ptr(new uint8[outPropsSize]); + + // compress with best compression and other default settings + sint res = LzmaCompress(outBuffer.get(), &outSize, inBuffer.get(), inSize, outProps.get(), &outPropsSize, 9, 1 << 24, 3, 0, 2, 32, 1); + + switch(res) + { + case SZ_OK: + { + // store on output buffer + COFile outStream(lzmaFileName); + + // unable to create file + if (!outStream.isOpen()) + { + nlwarning("packLZMA: Unable to create '%s'", srcFileName.c_str()); + return false; + } + + try + { + // write props + outStream.serialBuffer(outProps.get(), (uint)outPropsSize); + + // write uncompressed size + uint64 uncompressSize = inSize; + outStream.serial(uncompressSize); + + // write content + outStream.serialBuffer(outBuffer.get(), (uint)outSize); + } + catch(const EFile &e) + { + nlwarning("packLZMA: Error while writing '%s': %s", lzmaFileName.c_str(), e.what()); + CFile::deleteFile(lzmaFileName); + return false; + } + + return true; + } + + case SZ_ERROR_MEM: + nlwarning("packLZMA: Memory allocation error while compressing '%s' (input buffer size: %u, output buffer size: %u)", srcFileName.c_str(), (uint)inSize, (uint)outSize); + break; + + case SZ_ERROR_PARAM: + nlwarning("packLZMA: Incorrect parameter while compressing '%s'", srcFileName.c_str()); + break; + + case SZ_ERROR_OUTPUT_EOF: + nlwarning("packLZMA: Output buffer overflow while compressing '%s' (input buffer size: %u, output buffer size: %u)", srcFileName.c_str(), (uint)inSize, (uint)outSize); + break; + + case SZ_ERROR_THREAD: + nlwarning("packLZMA: Errors in multithreading functions (only for Mt version)"); + break; + + default: + nlwarning("packLZMA: Unknown error (%d) while compressing '%s'", res, srcFileName.c_str()); + } + + return false; +} diff --git a/code/ryzom/client/src/seven_zip/seven_zip.h b/code/ryzom/client/src/seven_zip/seven_zip.h new file mode 100644 index 000000000..e471a9ac0 --- /dev/null +++ b/code/ryzom/client/src/seven_zip/seven_zip.h @@ -0,0 +1,31 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef SEVEN_ZIP_H +#define SEVEN_ZIP_H + +#include + +// utility func to decompress a monofile 7zip archive +bool unpack7Zip(const std::string &sevenZipFileName, const std::string &destFileName); + +// utility func to decompress a single LZMA packed file +bool unpackLZMA(const std::string &lzmaFileName, const std::string &destFileName); + +// utility func to compress a single file to LZMA packed file +bool packLZMA(const std::string &srcFileName, const std::string &lzmaFileName); + +#endif From 54aaa51736c673d05557b5dfbbac2dcb273a1829 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 10:22:47 +0100 Subject: [PATCH 04/61] Fixed: patch_gen is now using packLZMA function to compress a file instead of using lzma executable --- code/ryzom/tools/patch_gen/CMakeLists.txt | 6 ++-- .../tools/patch_gen/patch_gen_common.cpp | 34 ++++--------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/code/ryzom/tools/patch_gen/CMakeLists.txt b/code/ryzom/tools/patch_gen/CMakeLists.txt index d7d864f9a..6cde9810b 100644 --- a/code/ryzom/tools/patch_gen/CMakeLists.txt +++ b/code/ryzom/tools/patch_gen/CMakeLists.txt @@ -1,13 +1,15 @@ +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ryzom/client/src/seven_zip) + SET(MAIN_SRC patch_gen_common.cpp patch_gen_main.cpp patch_gen_main.h) SET(SERVICE_SRC patch_gen_common.cpp patch_gen_service.cpp patch_gen_service.h) ADD_EXECUTABLE(patch_gen ${MAIN_SRC}) -TARGET_LINK_LIBRARIES(patch_gen ryzom_gameshare nelmisc nelnet nelligo nelgeorges) +TARGET_LINK_LIBRARIES(patch_gen ryzom_sevenzip ryzom_gameshare nelmisc nelnet nelligo nelgeorges) NL_DEFAULT_PROPS(patch_gen "Ryzom, Tools: Patch Generator") NL_ADD_RUNTIME_FLAGS(patch_gen) ADD_EXECUTABLE(patch_gen_service WIN32 ${SERVICE_SRC}) -TARGET_LINK_LIBRARIES(patch_gen_service ryzom_gameshare nelmisc nelnet nelligo nelgeorges) +TARGET_LINK_LIBRARIES(patch_gen_service ryzom_sevenzip ryzom_gameshare nelmisc nelnet nelligo nelgeorges) NL_DEFAULT_PROPS(patch_gen_service "Ryzom, Tools: Patch Generator Service") NL_ADD_RUNTIME_FLAGS(patch_gen_service) diff --git a/code/ryzom/tools/patch_gen/patch_gen_common.cpp b/code/ryzom/tools/patch_gen/patch_gen_common.cpp index dd4bf4211..c1290cfd5 100644 --- a/code/ryzom/tools/patch_gen/patch_gen_common.cpp +++ b/code/ryzom/tools/patch_gen/patch_gen_common.cpp @@ -27,6 +27,7 @@ #include "nel/misc/command.h" #include "nel/misc/sstring.h" #include "game_share/singleton_registry.h" +#include "seven_zip.h" using namespace std; using namespace NLMISC; @@ -74,37 +75,16 @@ void ApplyPatch(const std::string& srcFileName,const std::string& destFileName,c #endif // NL_OS_WINDOWS } -void GenerateLZMA(const std::string sourceFile, const std::string &outputFile) +void GenerateLZMA(const std::string &sourceFile, const std::string &outputFile) { { - // old syntax incompatible with new versions - std::string cmd = "lzma e"; - cmd += " " + sourceFile + " " + outputFile; - nlinfo("Executing system command: %s", cmd.c_str()); + nlinfo("Compressing %s to %s using LZMA...", sourceFile.c_str(), outputFile.c_str()); } -#ifdef NL_OS_WINDOWS - _spawnlp(_P_WAIT, "lzma.exe","lzma.exe", "e", sourceFile.c_str(), outputFile.c_str(), NULL); -#else // NL_OS_WINDOWS - // new lzma only supports one file name on command line, so make a copy - CFile::copyFile(outputFile, sourceFile); - // new lzma syntax, -z = compress, -9 = best compression - std::string cmd = NLMISC::toString("lzma -z -9 %s", outputFile.c_str()); - - sint error = system(cmd.c_str()); - - if (error) + if (!packLZMA(sourceFile, outputFile)) { - nlwarning("'%s' failed with error code %d", cmd.c_str(), error); - - CFile::deleteFile(outputFile); + nlwarning("LZMA compress failed"); } - else - { - // lzma always append a .lzma extension, so rename compressed file to wanted one - CFile::moveFile(outputFile, outputFile + ".lzma"); - } -#endif // NL_OS_WINDOWS } @@ -230,7 +210,7 @@ void CPackageDescription::storeToPdr(CPersistentDataRecord& pdr) const void CPackageDescription::readIndex(CBNPFileSet& packageIndex) const { std::string indexPath = _RootDirectory + _IndexFileName; - + nlinfo("Reading history file: %s ...", indexPath.c_str()); // clear out old contents before reading from input file @@ -294,7 +274,7 @@ void CPackageDescription::generateClientIndex(CProductDescriptionForClient& theC std::string patchNumber = toString("%05u", packageIndex.getVersionNumber()); std::string patchDirectory = _PatchDirectory + patchNumber; std::string patchFile = patchDirectory + "/" + _ClientIndexFileName; - + nlinfo("Generating client index: %s...", patchFile.c_str()); // make sure the version sub directory exist From 816d812ea26b72adc091b3ba819e1650351a4685 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 10:23:57 +0100 Subject: [PATCH 05/61] Fixed: Use absolute path of current directory instead of relative path (avoid to check more than once the same location) --- code/ryzom/client/src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 8daabdaa5..faa83b51c 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -659,7 +659,7 @@ static void addPaths(IProgressCallback &progress, const std::vector std::vector directoryPrefixes; // current directory has priority everywhere - directoryPrefixes.push_back(""); + directoryPrefixes.push_back(CPath::standardizePath(CPath::getCurrentPath())); #if defined(NL_OS_WINDOWS) // check in same directory as executable From a82b0baa72beb8b30d9b9a3738ade4d594f50e00 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 11:32:20 +0100 Subject: [PATCH 06/61] Changed: Support more values for fromString with a boolean --- code/nel/include/nel/misc/string_common.h | 29 ++++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/code/nel/include/nel/misc/string_common.h b/code/nel/include/nel/misc/string_common.h index e6d08bdeb..b8a12ad77 100644 --- a/code/nel/include/nel/misc/string_common.h +++ b/code/nel/include/nel/misc/string_common.h @@ -246,27 +246,38 @@ inline bool fromString(const std::string &str, bool &val) { if (str.length() == 1) { - if (str[0] == '1') + const char c = str[0]; + + switch(c) { + case '1': + case 't': + case 'T': + case 'y': + case 'Y': val = true; - } - else if (str[0] == '0') - { + break; + + case '0': + case 'f': + case 'F': + case 'n': + case 'N': val = false; - } - else - { + break; + + default: val = false; return false; } } else { - if (str == "true") + if (str == "true" || str == "yes") { val = true; } - else if (str == "false") + else if (str == "false" || str == "no") { val = false; } From 7ffc842ba464c140d4e43a093c6dab0580474216 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 11:33:44 +0100 Subject: [PATCH 07/61] Fixed: Support new ISO units (KiB, MiB, etc...) in humanReadableToBytes --- code/nel/src/misc/common.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 4c7d4fe02..5115547a5 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -394,7 +394,8 @@ uint32 humanReadableToBytes (const string &str) if(str[0]<'0' || str[0]>'9') return 0; - res = atoi (str.c_str()); + if (!fromString(str, res)) + return 0; if(str[str.size()-1] == 'B') { @@ -404,10 +405,28 @@ uint32 humanReadableToBytes (const string &str) // there's no break and it's **normal** switch (str[str.size()-2]) { - case 'G': res *= 1024; - case 'M': res *= 1024; - case 'K': res *= 1024; - default: ; + // kB/KB, MB, GB and TB are 1000 multiples + case 'T': res *= 1000; + case 'G': res *= 1000; + case 'M': res *= 1000; + case 'k': res *= 1000; break; // kilo symbol should be a lowercase K + case 'K': res *= 1000; break; + case 'i': + { + // KiB, MiB, GiB and TiB are 1024 multiples + if (str.size()<4) + return res; + + switch (str[str.size()-3]) + { + case 'T': res *= 1024; + case 'G': res *= 1024; + case 'M': res *= 1024; + case 'K': res *= 1024; + default: ; + } + } + default: ; } } From 1978cab02216756f315c8be63ed3580beb22d2a7 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 11:34:16 +0100 Subject: [PATCH 08/61] Fixed: Don't display logs in console for unit tests --- code/nel/tools/nel_unit_test/nel_unit_test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/nel/tools/nel_unit_test/nel_unit_test.cpp b/code/nel/tools/nel_unit_test/nel_unit_test.cpp index 8289ea490..753dfd46a 100644 --- a/code/nel/tools/nel_unit_test/nel_unit_test.cpp +++ b/code/nel/tools/nel_unit_test/nel_unit_test.cpp @@ -114,6 +114,20 @@ int main(int argc, char *argv[]) // init Nel context new NLMISC::CApplicationContext; + // disable nldebug messages in logs in Release +#ifdef NL_RELEASE + NLMISC::DisableNLDebug = true; +#endif + + NLMISC::createDebug(NULL); + +#ifndef NL_DEBUG + NLMISC::INelContext::getInstance().getDebugLog()->removeDisplayer("DEFAULT_SD"); + NLMISC::INelContext::getInstance().getInfoLog()->removeDisplayer("DEFAULT_SD"); + NLMISC::INelContext::getInstance().getWarningLog()->removeDisplayer("DEFAULT_SD"); + NLMISC::INelContext::getInstance().getErrorLog()->removeDisplayer("DEFAULT_SD"); +#endif // NL_DEBUG + bool noerrors = false; try From 54001f553d6076218c9f3f9ecc26f466f136c40b Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 11:37:46 +0100 Subject: [PATCH 09/61] Added: New unit tests for common.h --- code/nel/tools/nel_unit_test/ut_misc.h | 2 + code/nel/tools/nel_unit_test/ut_misc_common.h | 106 ++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 code/nel/tools/nel_unit_test/ut_misc_common.h diff --git a/code/nel/tools/nel_unit_test/ut_misc.h b/code/nel/tools/nel_unit_test/ut_misc.h index 8538d3f53..e7a3cc8c6 100644 --- a/code/nel/tools/nel_unit_test/ut_misc.h +++ b/code/nel/tools/nel_unit_test/ut_misc.h @@ -19,6 +19,7 @@ #include "ut_misc_co_task.h" #include "ut_misc_command.h" +#include "ut_misc_common.h" #include "ut_misc_config_file.h" #include "ut_misc_debug.h" #include "ut_misc_dynlibload.h" @@ -38,6 +39,7 @@ struct CUTMisc : public Test::Suite { add(auto_ptr(new CUTMiscCoTask)); add(auto_ptr(new CUTMiscCommand)); + add(auto_ptr(new CUTMiscCommon)); add(auto_ptr(new CUTMiscConfigFile)); add(auto_ptr(new CUTMiscDebug)); add(auto_ptr(new CUTMiscDynLibLoad)); diff --git a/code/nel/tools/nel_unit_test/ut_misc_common.h b/code/nel/tools/nel_unit_test/ut_misc_common.h new file mode 100644 index 000000000..e915a4225 --- /dev/null +++ b/code/nel/tools/nel_unit_test/ut_misc_common.h @@ -0,0 +1,106 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef UT_MISC_COMMON +#define UT_MISC_COMMON + +#include +#include + +struct CUTMiscCommon : public Test::Suite +{ + CUTMiscCommon() + { + TEST_ADD(CUTMiscCommon::humanReadableToBytes); + + // Add a line here when adding a new test METHOD + } + + void humanReadableToBytes() + { + uint64 bytes = 0; + + // kiB is a wrong unit + bytes = NLMISC::humanReadableToBytes("1kiB"); + TEST_ASSERT(bytes == 1); + + // 1 kibibyte + bytes = NLMISC::humanReadableToBytes("1KiB"); + TEST_ASSERT(bytes == 1024); + + // 1 mebibyte + bytes = NLMISC::humanReadableToBytes("1MiB"); + TEST_ASSERT(bytes == 1024*1024); + + // 1 kilobyte + bytes = NLMISC::humanReadableToBytes("1KB"); + TEST_ASSERT(bytes == 1000); + + // 1 kilobyte + bytes = NLMISC::humanReadableToBytes("1kB"); + TEST_ASSERT(bytes == 1000); + + // 1 megabyte + bytes = NLMISC::humanReadableToBytes("1MB"); + TEST_ASSERT(bytes == 1000*1000); + + // 1 byte + bytes = NLMISC::humanReadableToBytes("1B"); + TEST_ASSERT(bytes == 1); + + // 1 byte + bytes = NLMISC::humanReadableToBytes("1"); + TEST_ASSERT(bytes == 1); + + // kiB is a wrong unit + bytes = NLMISC::humanReadableToBytes("1 kiB"); + TEST_ASSERT(bytes == 1); + + // 1 kibibyte + bytes = NLMISC::humanReadableToBytes("1 KiB"); + TEST_ASSERT(bytes == 1024); + + // 1 mebibyte + bytes = NLMISC::humanReadableToBytes("1 MiB"); + TEST_ASSERT(bytes == 1024*1024); + + // 1 kilobyte + bytes = NLMISC::humanReadableToBytes("1 KB"); + TEST_ASSERT(bytes == 1000); + + // 1 kilobyte + bytes = NLMISC::humanReadableToBytes("1 kB"); + TEST_ASSERT(bytes == 1000); + + // 1 Megabyte + bytes = NLMISC::humanReadableToBytes("1 MB"); + TEST_ASSERT(bytes == 1000*1000); + + // 1 byte + bytes = NLMISC::humanReadableToBytes("1 B"); + TEST_ASSERT(bytes == 1); + + // not a number + bytes = NLMISC::humanReadableToBytes("AB"); + TEST_ASSERT(bytes == 0); + + // not a positive number + bytes = NLMISC::humanReadableToBytes("-1 B"); + TEST_ASSERT(bytes == 0); + } +}; + +#endif From e77a8b17b7d1003e63ffc0f02c0783c343622d74 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 11:38:08 +0100 Subject: [PATCH 10/61] Fixed: Tests for fromStringwith a boolean --- .../nel_unit_test/ut_misc_string_common.h | 81 +++++++++---------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/code/nel/tools/nel_unit_test/ut_misc_string_common.h b/code/nel/tools/nel_unit_test/ut_misc_string_common.h index 2fc646a36..33378a8ec 100644 --- a/code/nel/tools/nel_unit_test/ut_misc_string_common.h +++ b/code/nel/tools/nel_unit_test/ut_misc_string_common.h @@ -682,60 +682,59 @@ struct CUTMiscStringCommon : public Test::Suite // tests for bool bool val; - // true value - val = false; + // true values ret = NLMISC::fromString("1", val); - TEST_ASSERT(val); - TEST_ASSERT_MSG(ret, "should succeed"); + TEST_ASSERT(ret && val); - val = false; - NLMISC::fromString("t", val); - TEST_ASSERT(val); + ret = NLMISC::fromString("t", val); + TEST_ASSERT(ret && val); - val = false; - NLMISC::fromString("y", val); - TEST_ASSERT(val); + ret = NLMISC::fromString("y", val); + TEST_ASSERT(ret && val); - val = false; - NLMISC::fromString("T", val); - TEST_ASSERT(val); + ret = NLMISC::fromString("T", val); + TEST_ASSERT(ret && val); - val = false; - NLMISC::fromString("Y", val); - TEST_ASSERT(val); + ret = NLMISC::fromString("Y", val); + TEST_ASSERT(ret && val); - val = true; + ret = NLMISC::fromString("true", val); + TEST_ASSERT(ret && val); + + ret = NLMISC::fromString("yes", val); + TEST_ASSERT(ret && val); + + // false values ret = NLMISC::fromString("0", val); - TEST_ASSERT(!val); - TEST_ASSERT_MSG(ret, "should succeed"); + TEST_ASSERT(ret && !val); - val = true; - NLMISC::fromString("f", val); - TEST_ASSERT(!val); + ret = NLMISC::fromString("f", val); + TEST_ASSERT(ret && !val); - val = true; - NLMISC::fromString("n", val); - TEST_ASSERT(!val); + ret = NLMISC::fromString("n", val); + TEST_ASSERT(ret && !val); - val = true; - NLMISC::fromString("F", val); - TEST_ASSERT(!val); + ret = NLMISC::fromString("F", val); + TEST_ASSERT(ret && !val); - val = true; - NLMISC::fromString("N", val); - TEST_ASSERT(!val); + ret = NLMISC::fromString("N", val); + TEST_ASSERT(ret && !val); + + ret = NLMISC::fromString("false", val); + TEST_ASSERT(ret && !val); + + ret = NLMISC::fromString("no", val); + TEST_ASSERT(ret && !val); + + // wrong values + ret = NLMISC::fromString("YES", val); + TEST_ASSERT(!ret && !val); + + ret = NLMISC::fromString("foo", val); + TEST_ASSERT(!ret && !val); - // bad character ret = NLMISC::fromString("a", val); - TEST_ASSERT_MSG(!ret, "should not succeed"); - - val = true; - NLMISC::fromString("a", val); - TEST_ASSERT_MSG(val, "should not modify the value"); - - val = false; - NLMISC::fromString("a", val); - TEST_ASSERT_MSG(!val, "should not modify the value"); + TEST_ASSERT(!ret && !val); } }; From 6679aa762115df13470caa14b1d96b34538cf043 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 12:37:06 +0100 Subject: [PATCH 11/61] Changed: New function bytesToHumanReadableUnits to use specific strings for units --- code/nel/include/nel/misc/common.h | 4 ++++ code/nel/src/misc/common.cpp | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index 710a9e6df..3b5465eaa 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -336,6 +336,10 @@ void itoaInt64 (sint64 number, char *str, sint64 base = 10); std::string bytesToHumanReadable (const std::string &bytes); std::string bytesToHumanReadable (uint64 bytes); +/// Convert a number in bytes into a string that is easily readable by an human, for example 105123 -> "102kb" +/// Using units array as string: 0 => B, 1 => KiB, 2 => MiB, 3 => GiB, etc... +std::string bytesToHumanReadableUnits (uint64 bytes, const std::vector &units); + /// Convert a human readable into a bytes, for example "102kb" -> 105123 uint32 humanReadableToBytes (const std::string &str); diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 5115547a5..119323331 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -380,7 +380,26 @@ string bytesToHumanReadable (uint64 bytes) div++; res = newres; } - return toString ("%" NL_I64 "u%s", res, divTable[div]); + return toString ("%" NL_I64 "u %s", res, divTable[div]); +} + +std::string bytesToHumanReadableUnits (uint64 bytes, const std::vector &units) +{ + if (units.empty()) return ""; + + uint div = 0; + uint last = units.size()-1; + uint64 res = bytes; + uint64 newres = res; + for(;;) + { + newres /= 1024; + if(newres < 8 || div > 3 || div == last) + break; + ++div; + res = newres; + } + return toString ("%" NL_I64 "u %s", res, units[div].c_str()); } uint32 humanReadableToBytes (const string &str) From 3d285b1fc3dd6be853cb336be80fae8f5ccee778 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 12:37:20 +0100 Subject: [PATCH 12/61] Changed: Unit tests for bytesToHumanReadableUnits --- code/nel/tools/nel_unit_test/ut_misc_common.h | 67 ++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/code/nel/tools/nel_unit_test/ut_misc_common.h b/code/nel/tools/nel_unit_test/ut_misc_common.h index e915a4225..d33d65064 100644 --- a/code/nel/tools/nel_unit_test/ut_misc_common.h +++ b/code/nel/tools/nel_unit_test/ut_misc_common.h @@ -24,11 +24,76 @@ struct CUTMiscCommon : public Test::Suite { CUTMiscCommon() { + TEST_ADD(CUTMiscCommon::bytesToHumanReadableUnits); TEST_ADD(CUTMiscCommon::humanReadableToBytes); // Add a line here when adding a new test METHOD } + void bytesToHumanReadableUnits() + { + std::vector units; + + std::string res; + + // no unit, returns an empty string + res = NLMISC::bytesToHumanReadableUnits(0, units); + TEST_ASSERT(res.empty()); + + // support bytes + units.push_back("B"); + + // 0 bytes + res = NLMISC::bytesToHumanReadableUnits(0, units); + TEST_ASSERT(res == "0 B"); + + // 1000 bytes in B + res = NLMISC::bytesToHumanReadableUnits(1000, units); + TEST_ASSERT(res == "1000 B"); + + // 1024 bytes in B + res = NLMISC::bytesToHumanReadableUnits(1024, units); + TEST_ASSERT(res == "1024 B"); + + // support kibibytes + units.push_back("KiB"); + + // 1000 bytes in B or KiB + res = NLMISC::bytesToHumanReadableUnits(1000, units); + TEST_ASSERT(res == "1000 B"); + + // 1024 bytes in B or KiB + res = NLMISC::bytesToHumanReadableUnits(1024, units); + TEST_ASSERT(res == "1024 B"); + + // 1 MB in B or KiB + res = NLMISC::bytesToHumanReadableUnits(1000 * 1000, units); + TEST_ASSERT(res == "976 KiB"); + + // 1 MiB in B or KiB + res = NLMISC::bytesToHumanReadableUnits(1024 * 1024, units); + TEST_ASSERT(res == "1024 KiB"); + + // 1 GB in B or KiB + res = NLMISC::bytesToHumanReadableUnits(1000 * 1000 * 1000, units); + TEST_ASSERT(res == "976562 KiB"); + + // 1 GiB in B or KiB + res = NLMISC::bytesToHumanReadableUnits(1024 * 1024 * 1024, units); + TEST_ASSERT(res == "1048576 KiB"); + + // support mebibytes + units.push_back("MiB"); + + // 1 GB in B, KiB or MiB + res = NLMISC::bytesToHumanReadableUnits(1000 * 1000 * 1000, units); + TEST_ASSERT(res == "953 MiB"); + + // 1 GiB in B, KiB or MiB + res = NLMISC::bytesToHumanReadableUnits(1024 * 1024 * 1024, units); + TEST_ASSERT(res == "1024 MiB"); + } + void humanReadableToBytes() { uint64 bytes = 0; @@ -85,7 +150,7 @@ struct CUTMiscCommon : public Test::Suite bytes = NLMISC::humanReadableToBytes("1 kB"); TEST_ASSERT(bytes == 1000); - // 1 Megabyte + // 1 megabyte bytes = NLMISC::humanReadableToBytes("1 MB"); TEST_ASSERT(bytes == 1000*1000); From 78d17f478d6b37459fbf59585b7c3882c04ebfcc Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 14:31:57 +0100 Subject: [PATCH 13/61] Fixed: Compile seven_zip for tools --- code/ryzom/client/src/CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index e54b90737..d2f8f2bb2 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -1,12 +1,10 @@ # Need clientsheets lib for sheets packer tool ADD_SUBDIRECTORY(client_sheets) +# Need seven_zip lib for patch_gen tool +ADD_SUBDIRECTORY(seven_zip) + IF(WITH_RYZOM_CLIENT) - # These are Windows/MFC apps - SET(SEVENZIP_LIBRARY "ryzom_sevenzip") - - ADD_SUBDIRECTORY(seven_zip) - IF(WITH_RYZOM_PATCH) ADD_DEFINITIONS(-DRZ_USE_PATCH) @@ -136,13 +134,13 @@ IF(WITH_RYZOM_CLIENT) nel3d nelgui nelsound + ryzom_sevenzip ryzom_clientsheets ryzom_gameshare nelpacs ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${CURL_LIBRARIES} - ${SEVENZIP_LIBRARY} ) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) From a83862f4984a57378ece930a99d79e23ebe4a124 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 14:32:06 +0100 Subject: [PATCH 14/61] Removed: Files for patcher --- code/ryzom/client/CMakeLists.txt | 1 - code/ryzom/client/patcher/CMakeLists.txt | 3 - code/ryzom/client/patcher/de.uxt | 191 ----------------------- code/ryzom/client/patcher/en.uxt | 191 ----------------------- code/ryzom/client/patcher/fr.uxt | 191 ----------------------- code/ryzom/client/patcher/ru.uxt | 191 ----------------------- 6 files changed, 768 deletions(-) delete mode 100644 code/ryzom/client/patcher/CMakeLists.txt delete mode 100644 code/ryzom/client/patcher/de.uxt delete mode 100644 code/ryzom/client/patcher/en.uxt delete mode 100644 code/ryzom/client/patcher/fr.uxt delete mode 100644 code/ryzom/client/patcher/ru.uxt diff --git a/code/ryzom/client/CMakeLists.txt b/code/ryzom/client/CMakeLists.txt index e689b1676..106f553bd 100644 --- a/code/ryzom/client/CMakeLists.txt +++ b/code/ryzom/client/CMakeLists.txt @@ -3,7 +3,6 @@ ADD_SUBDIRECTORY(src) IF(WITH_RYZOM_CLIENT) #ADD_SUBDIRECTORY(data) - #ADD_SUBDIRECTORY(patcher) IF(UNIX AND NOT APPLE) ADD_SUBDIRECTORY(unix) diff --git a/code/ryzom/client/patcher/CMakeLists.txt b/code/ryzom/client/patcher/CMakeLists.txt deleted file mode 100644 index 3b8b89a3d..000000000 --- a/code/ryzom/client/patcher/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -FILE(GLOB SRC *.uxt) - -INSTALL(FILES ${SRC} DESTINATION "${RYZOM_SHARE_PREFIX}/patcher") diff --git a/code/ryzom/client/patcher/de.uxt b/code/ryzom/client/patcher/de.uxt deleted file mode 100644 index 6312cc39c..000000000 --- a/code/ryzom/client/patcher/de.uxt +++ /dev/null @@ -1,191 +0,0 @@ -// HASH_VALUE 6B09AC86E0363C89 -// INDEX 0 -LanguageName [Deutsch] - -// HASH_VALUE 3259CCA76B39A0A8 -// INDEX 1 -TheSagaOfRyzom [Ryzom] - -// HASH_VALUE C7CC3BE0464ED819 -// INDEX 333 -uiOnChecking [ÜBERPRÜFE DATEIEN FÜR DEN PATCH...] - -// HASH_VALUE 3DDF0D8BBD1D3C7A -// INDEX 348 -uiErrCantPatch [Fehler : Du kannst nicht patchen, da die PatchURL noch nicht in die Datenbank eingegeben wurde (Fehlercode 16).] - -// HASH_VALUE E1B933F053557A69 -// INDEX 349 -uiNeedToPatch [Information : Du musst patchen, um Zugang zu diesem Shard zu erlangen.] - -// HASH_VALUE 1CFD71DE1856F357 -// INDEX 350 -uiErrServerLost [Fehler : Die Verbindung zum Server wurde während des Patchens unterbrochen.] - -// HASH_VALUE 0781700FFA41B8F9 -// INDEX 351 -uiPatching [PATCHE, BITTE WARTEN] - -// HASH_VALUE B11FE4024EE3A1CB -// INDEX 352 -uiErrPatchApply [Fehler : Patchprozess beendet, aber der Patch konnte nicht erfolgreich eingesetzt werden.] - -// HASH_VALUE 428B3D2BDA3B2CD2 -// INDEX 353 -uiErrChecking [Fehler : Patchdateien versagen - Überprüfung.] - -// HASH_VALUE 40D0242C40D0242C -// INDEX 354 -uiKb [KB] - -// HASH_VALUE 4050243440502434 -// INDEX 355 -uiMb [MB] - -// HASH_VALUE 9FA5A06DD895B637 -// INDEX 356 -uiLoginGetFile [Lade Datei:] - -// HASH_VALUE 373988CC56A4B9DB -// INDEX 357 -uiDLFailed [Download vom Notfall-Server gescheitert, Login wurde abgebrochen] - -// HASH_VALUE 0DD314AEEB0A6833 -// INDEX 358 -uiDLURIFailed [Download vom URI gescheitert (neuer Versuch):] - -// HASH_VALUE 9FEF11F92FE58883 -// INDEX 359 -uiNoMoreURI [Keine Verbindung mehr zum URI, versuche den Notfall-Server] - -// HASH_VALUE D126843FEAF6BF89 -// INDEX 360 -uiDLWithCurl [Datei laden mit Curl:] - -// HASH_VALUE 5DF5B8902957A38B -// INDEX 361 -uiDecompressing [Dekomprimiere Datei:] - -// HASH_VALUE 5C24504228490833 -// INDEX 362 -uiCheckInt [Überprüfe Integrität:] - -// HASH_VALUE 4C08EC7AE63A3CA8 -// INDEX 363 -uiNoVersionFound [Keine Version gefunden] - -// HASH_VALUE EA9BF07087F0DE5C -// INDEX 364 -uiVersionFound [Version gefunden:] - -// HASH_VALUE 6CBAA4C2CED054DA -// INDEX 365 -uiApplyingDelta [Delta anlegen:] - -// HASH_VALUE 6BA9B484A5229440 -// INDEX 366 -uiClientVersion [Klientversion] - -// HASH_VALUE 2EAADC9D27B47047 -// INDEX 367 -uiServerVersion [Serverversion] - -// HASH_VALUE A8B6FC32E686BF9C -// INDEX 368 -uiCheckingFile [Überprüfe Datei] - -// HASH_VALUE 6618CC5E4408BC94 -// INDEX 369 -uiNeededPatches [Benötigte Patches :] - -// HASH_VALUE 57D72C08D558C375 -// INDEX 370 -uiCheckInBNP [Überprüfe innerhalb BNP :] - -// HASH_VALUE 8810F72436CBB610 -// INDEX 371 -uiSHA1Diff [BNP Zwangsentpackung : Checksumme stimmt nicht überein :] - -// HASH_VALUE 0328885969AA93AC -// INDEX 372 -uiCheckEndNoErr [Dateiüberprüfung ohne Fehler beendet] - -// HASH_VALUE 9759642196BA93B6 -// INDEX 373 -uiCheckEndWithErr [Dateiüberprüfung mit Fehler beendet:] - -// HASH_VALUE 03196C6669AA93A9 -// INDEX 374 -uiPatchEndNoErr [Dateipatch ohne Fehler beendet] - -// HASH_VALUE E2A45B80D6C8F35E -// INDEX 375 -uiPatchEndWithErr [Patch fehlgeschlagen!] - -// HASH_VALUE 97987345E8D46F43 -// INDEX 376 -uiPatchDiskFull [Ungenügender Festplattenspeicher!] - -// HASH_VALUE 67818F3F0F656F1B -// INDEX 377 -uiPatchWriteError [Fehler beim Schreiben auf die Festplatte! (Festplatte voll?)] - -// HASH_VALUE 54956061978AB897 -// INDEX 378 -uiProcessing [Bearbeite Datei:] - -// HASH_VALUE D183CC5E53E4E24A -// INDEX 379 -uiUnpack [BNP entpacken:] - -// HASH_VALUE 57282453CE0D24A5 -// INDEX 380 -uiUnpackErrHead [Bnp-Header unlesbar:] - -// HASH_VALUE 3EC17830B80D1B1D -// INDEX 381 -uiRebootConfirm [Klicke, um neu zu starten. Bitte warten, Ryzom startet dann automatisch.] - -// HASH_VALUE 809F582A06023625 -// INDEX 382 -uiRebootBut [HIER KLICKEN, UM NEU ZU STARTEN] - -// HASH_VALUE EA9888EBCAF59355 -// INDEX 383 -uiChangeDate [Das Mod-Datum ändern :] - -// HASH_VALUE 4589434CDD042E75 -// INDEX 384 -uiChgDateErr [File-Zeit unveränderbar :] - -// HASH_VALUE 5BCA0C0C45A99719 -// INDEX 385 -uiNowDate [Wir haben den :] - -// HASH_VALUE 485B4807F0581777 -// INDEX 386 -uiSetAttrib [File-Attribute einstellen :] - -// HASH_VALUE 5EB5789353166D5E -// INDEX 387 -uiAttribErr [Zugang unlesbar :] - -// HASH_VALUE C2B6FF326665E080 -// INDEX 388 -uiDelFile [File löschen :] - -// HASH_VALUE 0D262B3499A4A35A -// INDEX 389 -uiDelErr [ File kann nicht gelöscht werden:] - -// HASH_VALUE C238BC781514042B -// INDEX 390 -uiDelNoFile [ File löschen (Keine File)] - -// HASH_VALUE C1B7E33CDEF4085B -// INDEX 391 -uiRenameFile [File umbenennen:] - -// HASH_VALUE 8DB5533699858756 -// INDEX 392 -uiRenameErr [File kann nicht umbenannt werden :] diff --git a/code/ryzom/client/patcher/en.uxt b/code/ryzom/client/patcher/en.uxt deleted file mode 100644 index c092d57a1..000000000 --- a/code/ryzom/client/patcher/en.uxt +++ /dev/null @@ -1,191 +0,0 @@ -// HASH_VALUE 6B09AC86E0363C89 -// INDEX 0 -LanguageName [English] - -// HASH_VALUE 3259CCA76B39A0A8 -// INDEX 1 -TheSagaOfRyzom [Ryzom] - -// HASH_VALUE C7CC3BE0464ED819 -// INDEX 333 -uiOnChecking [CHECKING FILES FOR PATCH...] - -// HASH_VALUE 3DDF0D8BBD1D3C7A -// INDEX 348 -uiErrCantPatch [Error: You cannot patch because the PatchURL isn't setup in database (error code 16).] - -// HASH_VALUE E1B933F053557A69 -// INDEX 349 -uiNeedToPatch [Information: You need to patch to access to this shard.] - -// HASH_VALUE 1CFD71DE1856F357 -// INDEX 350 -uiErrServerLost [Error: Lost server during patching.] - -// HASH_VALUE 0781700FFA41B8F9 -// INDEX 351 -uiPatching [PATCHING PLEASE WAIT] - -// HASH_VALUE B11FE4024EE3A1CB -// INDEX 352 -uiErrPatchApply [Error: Patch process ended but the patch has not been successfully applied.] - -// HASH_VALUE 428B3D2BDA3B2CD2 -// INDEX 353 -uiErrChecking [Error: Patch files failed - checking.] - -// HASH_VALUE 40D0242C40D0242C -// INDEX 354 -uiKb [KB] - -// HASH_VALUE 4050243440502434 -// INDEX 355 -uiMb [MB] - -// HASH_VALUE 9FA5A06DD895B637 -// INDEX 356 -uiLoginGetFile [Getting File:] - -// HASH_VALUE 373988CC56A4B9DB -// INDEX 357 -uiDLFailed [Download from emergency server failed, patching is aborted] - -// HASH_VALUE 0DD314AEEB0A6833 -// INDEX 358 -uiDLURIFailed [Download from URI failed (will try again):] - -// HASH_VALUE 9FEF11F92FE58883 -// INDEX 359 -uiNoMoreURI [No more patch URI, try emergency patch server] - -// HASH_VALUE D126843FEAF6BF89 -// INDEX 360 -uiDLWithCurl [Downloading File With Curl:] - -// HASH_VALUE 5DF5B8902957A38B -// INDEX 361 -uiDecompressing [Decompressing File:] - -// HASH_VALUE 5C24504228490833 -// INDEX 362 -uiCheckInt [Checking Integrity:] - -// HASH_VALUE 4C08EC7AE63A3CA8 -// INDEX 363 -uiNoVersionFound [No Version Found] - -// HASH_VALUE EA9BF07087F0DE5C -// INDEX 364 -uiVersionFound [Version Found:] - -// HASH_VALUE 6CBAA4C2CED054DA -// INDEX 365 -uiApplyingDelta [Applying Delta:] - -// HASH_VALUE 6BA9B484A5229440 -// INDEX 366 -uiClientVersion [Client Version] - -// HASH_VALUE 2EAADC9D27B47047 -// INDEX 367 -uiServerVersion [Server Version] - -// HASH_VALUE A8B6FC32E686BF9C -// INDEX 368 -uiCheckingFile [Checking File] - -// HASH_VALUE 6618CC5E4408BC94 -// INDEX 369 -uiNeededPatches [Required Patches:] - -// HASH_VALUE 57D72C08D558C375 -// INDEX 370 -uiCheckInBNP [Checking inside BNP:] - -// HASH_VALUE 8810F72436CBB610 -// INDEX 371 -uiSHA1Diff [Force BNP Unpacking: checksums do not correspond:] - -// HASH_VALUE 0328885969AA93AC -// INDEX 372 -uiCheckEndNoErr [Checking file ended with no errors] - -// HASH_VALUE 9759642196BA93B6 -// INDEX 373 -uiCheckEndWithErr [Checking file ended with errors:] - -// HASH_VALUE 03196C6669AA93A9 -// INDEX 374 -uiPatchEndNoErr [Patching file ended with no errors] - -// HASH_VALUE E2A45B80D6C8F35E -// INDEX 375 -uiPatchEndWithErr [Patch failed!] - -// HASH_VALUE 97987345E8D46F43 -// INDEX 376 -uiPatchDiskFull [Disk full!] - -// HASH_VALUE 67818F3F0F656F1B -// INDEX 377 -uiPatchWriteError [Disk write error! (disk full?)] - -// HASH_VALUE 54956061978AB897 -// INDEX 378 -uiProcessing [Processing file:] - -// HASH_VALUE D183CC5E53E4E24A -// INDEX 379 -uiUnpack [BNP Unpacking:] - -// HASH_VALUE 57282453CE0D24A5 -// INDEX 380 -uiUnpackErrHead [Cannot read bnp header:] - -// HASH_VALUE 3EC17830B80D1B1D -// INDEX 381 -uiRebootConfirm [Ryzom will now relaunch. Please wait until Ryzom is fully restarted.] - -// HASH_VALUE 809F582A06023625 -// INDEX 382 -uiRebootBut [CLICK HERE TO RELAUNCH] - -// HASH_VALUE EA9888EBCAF59355 -// INDEX 383 -uiChangeDate [Changing the mod date:] - -// HASH_VALUE 4589434CDD042E75 -// INDEX 384 -uiChgDateErr [Cannot change file time:] - -// HASH_VALUE 5BCA0C0C45A99719 -// INDEX 385 -uiNowDate [Now the date is:] - -// HASH_VALUE 485B4807F0581777 -// INDEX 386 -uiSetAttrib [Set file attributes:] - -// HASH_VALUE 5EB5789353166D5E -// INDEX 387 -uiAttribErr [Cannot have read/write access:] - -// HASH_VALUE C2B6FF326665E080 -// INDEX 388 -uiDelFile [Delete file:] - -// HASH_VALUE 0D262B3499A4A35A -// INDEX 389 -uiDelErr [Cannot delete file:] - -// HASH_VALUE C238BC781514042B -// INDEX 390 -uiDelNoFile [Delete file (no file)] - -// HASH_VALUE C1B7E33CDEF4085B -// INDEX 391 -uiRenameFile [Rename File:] - -// HASH_VALUE 8DB5533699858756 -// INDEX 392 -uiRenameErr [Cannot rename file:] diff --git a/code/ryzom/client/patcher/fr.uxt b/code/ryzom/client/patcher/fr.uxt deleted file mode 100644 index 9be7db2d4..000000000 --- a/code/ryzom/client/patcher/fr.uxt +++ /dev/null @@ -1,191 +0,0 @@ -// HASH_VALUE 6B09AC86E0363C89 -// INDEX 0 -LanguageName [Français] - -// HASH_VALUE 3259CCA76B39A0A8 -// INDEX 1 -TheSagaOfRyzom [Ryzom] - -// HASH_VALUE C7CC3BE0464ED819 -// INDEX 333 -uiOnChecking [EXAMINE LES FICHIERS A PATCHER...] - -// HASH_VALUE 3DDF0D8BBD1D3C7A -// INDEX 348 -uiErrCantPatch [Erreur : Vous ne pouvez pas patcher car l'URL des mises à jour n'est pas configurée dans la base de données (erreur code 16).] - -// HASH_VALUE E1B933F053557A69 -// INDEX 349 -uiNeedToPatch [Information : Vous devez installer les mises à jour pour accéder à ce shard.] - -// HASH_VALUE 1CFD71DE1856F357 -// INDEX 350 -uiErrServerLost [Erreur : Perte du serveur durant la mise à jour de Ryzom.] - -// HASH_VALUE 0781700FFA41B8F9 -// INDEX 351 -uiPatching [MISE A JOUR EN COURS, VEUILLEZ PATIENTER] - -// HASH_VALUE B11FE4024EE3A1CB -// INDEX 352 -uiErrPatchApply [Erreur : le processus de mises à jour est terminé mais les patchs n'ont pas pu être installés correctement.] - -// HASH_VALUE 428B3D2BDA3B2CD2 -// INDEX 353 -uiErrChecking [Erreur : Echec des fichiers de mises à jour - vérification.] - -// HASH_VALUE 40D0242C40D0242C -// INDEX 354 -uiKb [Ko] - -// HASH_VALUE 4050243440502434 -// INDEX 355 -uiMb [Mo] - -// HASH_VALUE 9FA5A06DD895B637 -// INDEX 356 -uiLoginGetFile [Récupération du fichier :] - -// HASH_VALUE 373988CC56A4B9DB -// INDEX 357 -uiDLFailed [Echec téléchargement à partir du serveur d'urgence, processus de patchs avorté] - -// HASH_VALUE 0DD314AEEB0A6833 -// INDEX 358 -uiDLURIFailed [Echec téléchargement à partir d'URI (nouvel essai) :] - -// HASH_VALUE 9FEF11F92FE58883 -// INDEX 359 -uiNoMoreURI [Plus de patchs URI, essayez le serveur d'urgence] - -// HASH_VALUE D126843FEAF6BF89 -// INDEX 360 -uiDLWithCurl [Téléchargement des fichiers via Curl:] - -// HASH_VALUE 5DF5B8902957A38B -// INDEX 361 -uiDecompressing [Décompression du fichier :] - -// HASH_VALUE 5C24504228490833 -// INDEX 362 -uiCheckInt [Vérification de l'intégrité :] - -// HASH_VALUE 4C08EC7AE63A3CA8 -// INDEX 363 -uiNoVersionFound [Pas de Version trouvée] - -// HASH_VALUE EA9BF07087F0DE5C -// INDEX 364 -uiVersionFound [Version trouvée :] - -// HASH_VALUE 6CBAA4C2CED054DA -// INDEX 365 -uiApplyingDelta [Application du Delta :] - -// HASH_VALUE 6BA9B484A5229440 -// INDEX 366 -uiClientVersion [Version du Client] - -// HASH_VALUE 2EAADC9D27B47047 -// INDEX 367 -uiServerVersion [Version du Serveur] - -// HASH_VALUE A8B6FC32E686BF9C -// INDEX 368 -uiCheckingFile [Vérification du fichier] - -// HASH_VALUE 6618CC5E4408BC94 -// INDEX 369 -uiNeededPatches [Patchs nécessaires :] - -// HASH_VALUE 57D72C08D558C375 -// INDEX 370 -uiCheckInBNP [Vérification du BNP :] - -// HASH_VALUE 8810F72436CBB610 -// INDEX 371 -uiSHA1Diff [Force BNP Analysée : SHA1 ne correspond pas :] - -// HASH_VALUE 0328885969AA93AC -// INDEX 372 -uiCheckEndNoErr [Fin de vérification du fichier - Pas d'erreur] - -// HASH_VALUE 9759642196BA93B6 -// INDEX 373 -uiCheckEndWithErr [Fin de vérification du fichier - Erreur(s) :] - -// HASH_VALUE 03196C6669AA93A9 -// INDEX 374 -uiPatchEndNoErr [Fichier de patch terminé - Pas d'erreur] - -// HASH_VALUE E2A45B80D6C8F35E -// INDEX 375 -uiPatchEndWithErr [Echec de la mise à jour !] - -// HASH_VALUE 97987345E8D46F43 -// INDEX 376 -uiPatchDiskFull [Disque plein !] - -// HASH_VALUE 67818F3F0F656F1B -// INDEX 377 -uiPatchWriteError [Erreur d'écriture ! (disque plein ?)] - -// HASH_VALUE 54956061978AB897 -// INDEX 378 -uiProcessing [Traîtement des fichiers :] - -// HASH_VALUE D183CC5E53E4E24A -// INDEX 379 -uiUnpack [Décompression BNP :] - -// HASH_VALUE 57282453CE0D24A5 -// INDEX 380 -uiUnpackErrHead [Impossible de lire l'en-tête bnp :] - -// HASH_VALUE 3EC17830B80D1B1D -// INDEX 381 -uiRebootConfirm [Ryzom va être redémarré. Attendez que le jeu soit totalement relancé SVP.] - -// HASH_VALUE 809F582A06023625 -// INDEX 382 -uiRebootBut [CLIQUEZ ICI POUR REDEMARRER] - -// HASH_VALUE EA9888EBCAF59355 -// INDEX 383 -uiChangeDate [Changement du mode date :] - -// HASH_VALUE 4589434CDD042E75 -// INDEX 384 -uiChgDateErr [Impossible de modifier le fichier heure :] - -// HASH_VALUE 5BCA0C0C45A99719 -// INDEX 385 -uiNowDate [La date est :] - -// HASH_VALUE 485B4807F0581777 -// INDEX 386 -uiSetAttrib [Réglages attributs du fichier :] - -// HASH_VALUE 5EB5789353166D5E -// INDEX 387 -uiAttribErr [Impossible d'obtenir l'accès lire/écrire :] - -// HASH_VALUE C2B6FF326665E080 -// INDEX 388 -uiDelFile [Suppression du fichier :] - -// HASH_VALUE 0D262B3499A4A35A -// INDEX 389 -uiDelErr [Impossible de supprimer le fichier :] - -// HASH_VALUE C238BC781514042B -// INDEX 390 -uiDelNoFile [Suppression du fichier (pas de fichier)] - -// HASH_VALUE C1B7E33CDEF4085B -// INDEX 391 -uiRenameFile [Attribution d'un nouveau nom au fichier :] - -// HASH_VALUE 8DB5533699858756 -// INDEX 392 -uiRenameErr [Impossible de renommer le fichier :] diff --git a/code/ryzom/client/patcher/ru.uxt b/code/ryzom/client/patcher/ru.uxt deleted file mode 100644 index 048a29167..000000000 --- a/code/ryzom/client/patcher/ru.uxt +++ /dev/null @@ -1,191 +0,0 @@ -// HASH_VALUE 6B09AC86E0363C89 -// INDEX 0 -LanguageName [Русский] - -// HASH_VALUE 3259CCA76B39A0A8 -// INDEX 1 -TheSagaOfRyzom [Ризом] - -// HASH_VALUE C7CC3BE0464ED819 -// INDEX 333 -uiOnChecking [ПРОВЕРКА ФАЙЛОВ ИГРЫ...] - -// HASH_VALUE 3DDF0D8BBD1D3C7A -// INDEX 348 -uiErrCantPatch [Ошибка : Патч невозможен, поскольку адрес получения патча не установлен (error code 16).] - -// HASH_VALUE E1B933F053557A69 -// INDEX 349 -uiNeedToPatch [Информация : Для подключения к этому серверу необходим патч.] - -// HASH_VALUE 1CFD71DE1856F357 -// INDEX 350 -uiErrServerLost [Ошибка : Потеря связи с сервером во время патча.] - -// HASH_VALUE 0781700FFA41B8F9 -// INDEX 351 -uiPatching [ПАТЧ В ПРОЦЕССЕ... ПОДОЖДИТЕ] - -// HASH_VALUE B11FE4024EE3A1CB -// INDEX 352 -uiErrPatchApply [Ошибка : Процесс скачивания патча завершился, но патч невозможен.] - -// HASH_VALUE 428B3D2BDA3B2CD2 -// INDEX 353 -uiErrChecking [Ошибка : Файлы патча не соответствуют необходимым - идет проверка...] - -// HASH_VALUE 40D0242C40D0242C -// INDEX 354 -uiKb [КБ] - -// HASH_VALUE 4050243440502434 -// INDEX 355 -uiMb [МБ] - -// HASH_VALUE 9FA5A06DD895B637 -// INDEX 356 -uiLoginGetFile [Получение файла :] - -// HASH_VALUE 373988CC56A4B9DB -// INDEX 357 -uiDLFailed [Скачивание с экстренного сервера невозможно, патч не может быть завершен] - -// HASH_VALUE 0DD314AEEB0A6833 -// INDEX 358 -uiDLURIFailed [Скачивание по указанному адресу невозможно (попытки возобновятся позже) :] - -// HASH_VALUE 9FEF11F92FE58883 -// INDEX 359 -uiNoMoreURI [Адрес для скачивания патча недействителен, подключитесь к экстренному серверу] - -// HASH_VALUE D126843FEAF6BF89 -// INDEX 360 -uiDLWithCurl [Скачивание файла :] - -// HASH_VALUE 5DF5B8902957A38B -// INDEX 361 -uiDecompressing [Распаковка файла :] - -// HASH_VALUE 5C24504228490833 -// INDEX 362 -uiCheckInt [Проверка файла :] - -// HASH_VALUE 4C08EC7AE63A3CA8 -// INDEX 363 -uiNoVersionFound [Версия не обнаружена] - -// HASH_VALUE EA9BF07087F0DE5C -// INDEX 364 -uiVersionFound [Обнаружена версия :] - -// HASH_VALUE 6CBAA4C2CED054DA -// INDEX 365 -uiApplyingDelta [Применяется Дельта :] - -// HASH_VALUE 6BA9B484A5229440 -// INDEX 366 -uiClientVersion [Версия клиента] - -// HASH_VALUE 2EAADC9D27B47047 -// INDEX 367 -uiServerVersion [Версия сервера] - -// HASH_VALUE A8B6FC32E686BF9C -// INDEX 368 -uiCheckingFile [Проверка файла] - -// HASH_VALUE 6618CC5E4408BC94 -// INDEX 369 -uiNeededPatches [Необходимые патчи :] - -// HASH_VALUE 57D72C08D558C375 -// INDEX 370 -uiCheckInBNP [Проверка BNP :] - -// HASH_VALUE 8810F72436CBB610 -// INDEX 371 -uiSHA1Diff [Форсировать распаковку BNP : контрольные суммы не совпадают :] - -// HASH_VALUE 0328885969AA93AC -// INDEX 372 -uiCheckEndNoErr [Проверка файла не выявила ошибок] - -// HASH_VALUE 9759642196BA93B6 -// INDEX 373 -uiCheckEndWithErr [Проверка файла выявила ошибки :] - -// HASH_VALUE 03196C6669AA93A9 -// INDEX 374 -uiPatchEndNoErr [Патч осуществлен без ошибок] - -// HASH_VALUE E2A45B80D6C8F35E -// INDEX 375 -uiPatchEndWithErr [Патч невозможен!] - -// HASH_VALUE 97987345E8D46F43 -// INDEX 376 -uiPatchDiskFull [Диск переполнен!] - -// HASH_VALUE 67818F3F0F656F1B -// INDEX 377 -uiPatchWriteError [Ошибка записи! (диск переполнен ?)] - -// HASH_VALUE 54956061978AB897 -// INDEX 378 -uiProcessing [Обработка файла :] - -// HASH_VALUE D183CC5E53E4E24A -// INDEX 379 -uiUnpack [Распаковка BNP :] - -// HASH_VALUE 57282453CE0D24A5 -// INDEX 380 -uiUnpackErrHead [Невозможно прочесть заголовок BNP :] - -// HASH_VALUE 3EC17830B80D1B1D -// INDEX 381 -uiRebootConfirm [Ризом будет перезапущен. Пожалуйста, подождите...] - -// HASH_VALUE 809F582A06023625 -// INDEX 382 -uiRebootBut [ПЕРЕЗАПУСТИТЬ ИГРУ] - -// HASH_VALUE EA9888EBCAF59355 -// INDEX 383 -uiChangeDate [Перезапись даты изменений :] - -// HASH_VALUE 4589434CDD042E75 -// INDEX 384 -uiChgDateErr [Невозможно изменить время файла :] - -// HASH_VALUE 5BCA0C0C45A99719 -// INDEX 385 -uiNowDate [Новая дата :] - -// HASH_VALUE 485B4807F0581777 -// INDEX 386 -uiSetAttrib [Установить свойства файла :] - -// HASH_VALUE 5EB5789353166D5E -// INDEX 387 -uiAttribErr [Невозможно получить доступ к чтению/записи :] - -// HASH_VALUE C2B6FF326665E080 -// INDEX 388 -uiDelFile [Удалить файл :] - -// HASH_VALUE 0D262B3499A4A35A -// INDEX 389 -uiDelErr [Невозможно удалить файл :] - -// HASH_VALUE C238BC781514042B -// INDEX 390 -uiDelNoFile [Удалить файл (файл отсутствует)] - -// HASH_VALUE C1B7E33CDEF4085B -// INDEX 391 -uiRenameFile [Переименовать файл :] - -// HASH_VALUE 8DB5533699858756 -// INDEX 392 -uiRenameErr [Невозможно переименовать файл :] From 2274cfff891e3b96920ac179db5d7a003561c3a8 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:20:02 +0100 Subject: [PATCH 15/61] Fixed: Async execution of .bat under Windows --- code/nel/src/misc/common.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 119323331..20e03f438 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -732,8 +732,7 @@ bool launchProgram(const std::string &programName, const std::string &arguments, SetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, NULL ); } - string arg = " " + arguments; - BOOL res = CreateProcessA(programName.c_str(), (char*)arg.c_str(), NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW, NULL, NULL, &si, &pi); + BOOL res = CreateProcessA(programName.empty() ? NULL:programName.c_str(), (char*)arguments.c_str(), NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW, NULL, NULL, &si, &pi); if (res) { From e9a39a9a5570986006a9fd052f2e0fb1ace3f94f Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:20:34 +0100 Subject: [PATCH 16/61] Changed: Use "open" to open other programs too under OS X --- code/nel/src/misc/common.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 20e03f438..6888dd24f 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -753,25 +753,13 @@ bool launchProgram(const std::string &programName, const std::string &arguments, } #elif defined(NL_OS_MAC) - std::string command; + // we need to open bundles with "open" command + std::string command = NLMISC::toString("open \"%s\"", programName.c_str()); - if (CFile::getExtension(programName) == "app") + // append arguments if any + if (!arguments.empty()) { - // we need to open bundles with "open" command - command = NLMISC::toString("open \"%s\"", programName.c_str()); - - // append arguments if any - if (!arguments.empty()) - { - command += NLMISC::toString(" --args %s", arguments.c_str()); - } - } - else - { - command = programName; - - // append arguments if any - if (!arguments.empty()) command += " " + arguments; + command += NLMISC::toString(" --args %s", arguments.c_str()); } int res = system(command.c_str()); From 13c4282911cb66f450b15b76942f48646ec591f0 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:21:14 +0100 Subject: [PATCH 17/61] Changed: Minor changes --- code/ryzom/client/src/login_patch.cpp | 2 -- code/ryzom/tools/client/client_patcher/CMakeLists.txt | 1 - 2 files changed, 3 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 37cbddcbd..72f53103f 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -2356,7 +2356,6 @@ void CPatchThread::run() ucstring sTranslate; try { - // First do all ref files // ---------------------- @@ -2429,7 +2428,6 @@ void CPatchThread::run() pPM->deleteFile(pPM->UpdateBatchFilename, false, false); } - if (!bErr) { sTranslate = CI18N::get("uiPatchEndNoErr"); diff --git a/code/ryzom/tools/client/client_patcher/CMakeLists.txt b/code/ryzom/tools/client/client_patcher/CMakeLists.txt index 0b32a9867..8cfb5c452 100644 --- a/code/ryzom/tools/client/client_patcher/CMakeLists.txt +++ b/code/ryzom/tools/client/client_patcher/CMakeLists.txt @@ -3,7 +3,6 @@ FILE(GLOB SRC main.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/user_agent.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/client_cfg.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/login_patch.cpp - ${CMAKE_SOURCE_DIR}/ryzom/client/src/login_patch_seven_zip.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/login_xdelta.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/stdpch.cpp ${CMAKE_SOURCE_DIR}/ryzom/client/src/stdpch.h From 12204bb7e8598d8f6225a6a01a0112feb14ba848 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:22:25 +0100 Subject: [PATCH 18/61] Changed: Use application or current directory as root directory for patch --- code/ryzom/client/src/login_patch.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 72f53103f..e90035343 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -47,6 +47,7 @@ #include "nel/misc/sha1.h" #include "nel/misc/big_file.h" #include "nel/misc/i18n.h" +#include "nel/misc/cmd_args.h" #include "game_share/bg_downloader_msg.h" @@ -89,6 +90,8 @@ extern string R2ServerVersion; std::string TheTmpInstallDirectory = "patch/client_install"; #endif +extern NLMISC::CCmdArgs Args; + // **************************************************************************** // **************************************************************************** // **************************************************************************** @@ -120,8 +123,16 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st UpdateBatchFilename = "updt_nl.sh"; #endif - // use current directory by default - setClientRootPath("./"); + // use application directory by default + std::string rootPath = Args.getProgramPath(); + + if (!CFile::fileExists(rootPath + "client_default.cfg")) + { + // use current directory + rootPath = CPath::getCurrentPath(); + } + + setClientRootPath(rootPath); VerboseLog = true; From 178a8a949dd66d4acab3cc58e335191b3abcfed3 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:26:02 +0100 Subject: [PATCH 19/61] Fixed: Use absolute paths in patch batch and escape all paths Fixed: If not using batch file and unable to delete/move some files, use batch anyway only for these files --- code/ryzom/client/src/login_patch.cpp | 153 +++++++++++++------------- 1 file changed, 78 insertions(+), 75 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index e90035343..eef72cd50 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -727,29 +727,12 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool { uint nblab = 0; - FILE *fp = NULL; - - if (useBatchFile) - { - deleteBatchFile(); - fp = fopen (UpdateBatchFilename.c_str(), "wt"); - if (fp == 0) - { - string err = toString("Can't open file '%s' for writing: code=%d %s (error code 29)", UpdateBatchFilename.c_str(), errno, strerror(errno)); - throw Exception (err); - } - - //use bat if windows if not use sh -#ifdef NL_OS_WINDOWS - fprintf(fp, "@echo off\n"); -#else - fprintf(fp, "#!/bin/sh\n"); -#endif - } + std::string content; // Unpack files with category ExtractPath non empty const CBNPCategorySet &rDescCats = descFile.getCategories(); OptionalCat.clear(); + for (uint32 i = 0; i < rDescCats.categoryCount(); ++i) { // For all optional categories check if there is a 'file to patch' in it @@ -769,11 +752,6 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool } catch(...) { - if (useBatchFile) - { - fclose(fp); - } - throw; } @@ -782,11 +760,6 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool // TODO: handle exception? string err = toString("Error unpacking %s", rFilename.c_str()); - if (useBatchFile) - { - fclose(fp); - } - throw Exception (err); } else @@ -798,39 +771,41 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool NLMISC::CFile::createDirectoryTree(DstPath); // this file must be moved - if (useBatchFile) - { #ifdef NL_OS_WINDOWS - SrcPath = CPath::standardizeDosPath(SrcPath); - DstPath = CPath::standardizeDosPath(DstPath); -#else - SrcPath = CPath::standardizePath(SrcPath); - DstPath = CPath::standardizePath(DstPath); + SrcPath = CPath::standardizeDosPath(SrcPath); + DstPath = CPath::standardizeDosPath(DstPath); #endif - } std::string SrcName = SrcPath + vFilenames[fff]; std::string DstName = DstPath + vFilenames[fff]; - if (useBatchFile) + bool succeeded = false; + + if (!useBatchFile) + { + // don't check result, because it's possible the olk file doesn't exist + CFile::deleteFile(DstName); + + // try to move it, if fails move it later in a script + if (CFile::moveFile(DstName, SrcName)) + succeeded = true; + } + + // if we didn't succeed to delete or move the file, create a batch file anyway + if (!succeeded) { // write windows .bat format else write sh format #ifdef NL_OS_WINDOWS - fprintf(fp, ":loop%u\n", nblab); - fprintf(fp, "attrib -r -a -s -h %s\n", DstName.c_str()); - fprintf(fp, "del %s\n", DstName.c_str()); - fprintf(fp, "if exist %s goto loop%u\n", DstName.c_str(), nblab); - fprintf(fp, "move %s %s\n", SrcName.c_str(), DstPath.c_str()); + content += toString(":loop%u\n", nblab); + content += toString("attrib -r -a -s -h \"%s\"\n", DstName.c_str()); + content += toString("del \"%s\"\n", DstName.c_str()); + content += toString("if exist \"%s\" goto loop%u\n", DstName.c_str(), nblab); + content += toString("move \"%s\" \"%s\"\n", SrcName.c_str(), DstPath.c_str()); #else - fprintf(fp, "rm -rf %s\n", DstName.c_str()); - fprintf(fp, "mv %s %s\n", SrcName.c_str(), DstPath.c_str()); + content += toString("rm -rf \"%s\"\n", DstName.c_str()); + content += toString("mv %s \"%s\"\n", SrcName.c_str(), DstPath.c_str()); #endif } - else - { - deleteFile(DstName); - CFile::moveFile(DstName, SrcName); - } nblab++; } @@ -838,58 +813,86 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool } } + std::string patchDirectory = CPath::standardizeDosPath(ClientRootPath + "patch"); + // Finalize batch file - if (NLMISC::CFile::isExists("patch") && NLMISC::CFile::isDirectory("patch")) + if (NLMISC::CFile::isExists(patchDirectory) && NLMISC::CFile::isDirectory(patchDirectory)) { -#ifdef NL_OS_WINDOWS - if (useBatchFile) - { - fprintf(fp, ":looppatch\n"); - } -#endif + std::string patchContent; vector vFileList; - CPath::getPathContent ("patch", false, false, true, vFileList, NULL, false); + CPath::getPathContent (patchDirectory, false, false, true, vFileList, NULL, false); for(uint32 i = 0; i < vFileList.size(); ++i) { - if (useBatchFile) + bool succeeded = false; + + if (!useBatchFile) + { + if (CFile::deleteFile(vFileList[i])) + succeeded = true; + } + + // if we didn't succeed to delete, create a batch file anyway + if (!succeeded) { #ifdef NL_OS_WINDOWS - fprintf(fp, "del %s\n", CPath::standardizeDosPath(vFileList[i]).c_str()); + patchContent += toString("del \"%s\"\n", CPath::standardizeDosPath(vFileList[i]).c_str()); #else - fprintf(fp, "rm -f %s\n", CPath::standardizePath(vFileList[i]).c_str()); + patchContent += toString("rm -f \"%s\"\n", CPath::standardizePath(vFileList[i]).c_str()); #endif } - else - { - CFile::deleteFile(vFileList[i]); - } } - if (useBatchFile) + if (!patchContent.empty()) { #ifdef NL_OS_WINDOWS - fprintf(fp, "rd /Q /S patch\n"); - fprintf(fp, "if exist patch goto looppatch\n"); + content += toString(":looppatch\n"); + + content += patchContent; + + content += toString("rd /Q /S \"" + patchDirectory + "\"\n"); + content += toString("if exist \"" + patchDirectory + "\" goto looppatch\n"); #else - fprintf(fp, "rm -rf patch\n"); + content += toString("rm -rf \"" + patchDirectory + "\"\n"); #endif } else { - CFile::deleteDirectory("patch"); + CFile::deleteDirectory(patchDirectory); } } - if (useBatchFile) + if (!content.empty()) { + deleteBatchFile(); + + std::string batchFilename = ClientRootPath + UpdateBatchFilename; + + FILE *fp = fopen (batchFilename.c_str(), "wt"); + + if (fp == NULL) + { + string err = toString("Can't open file '%s' for writing: code=%d %s (error code 29)", batchFilename.c_str(), errno, strerror(errno)); + throw Exception (err); + } + + //use bat if windows if not use sh +#ifdef NL_OS_WINDOWS + fprintf(fp, "@echo off\n"); +#else + fprintf(fp, "#!/bin/sh\n"); +#endif + + // append content of script + fprintf(fp, content.c_str()); + if (wantRyzomRestart) { #ifdef NL_OS_WINDOWS - fprintf(fp, "start %s %%1 %%2 %%3\n", RyzomFilename.c_str()); + fprintf(fp, "start \"\" \"%s\" %%1 %%2 %%3\n", CPath::standardizeDosPath(RyzomFilename).c_str()); #else - fprintf(fp, "%s $1 $2 $3\n", RyzomFilename.c_str()); + fprintf(fp, "\"%s\" $1 $2 $3\n", RyzomFilename.c_str()); #endif } @@ -898,11 +901,11 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool fclose(fp); if (diskFull) { - throw NLMISC::EDiskFullError(UpdateBatchFilename.c_str()); + throw NLMISC::EDiskFullError(batchFilename.c_str()); } if (writeError) { - throw NLMISC::EWriteError(UpdateBatchFilename.c_str()); + throw NLMISC::EWriteError(batchFilename.c_str()); } } } From 6d41451d649ee1c56a326d9bfe9c7620c92df4c4 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:28:10 +0100 Subject: [PATCH 20/61] Fixed: Use launchProgram to launch batch --- code/ryzom/client/src/login_patch.cpp | 99 +++++++-------------------- 1 file changed, 25 insertions(+), 74 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index eef72cd50..0ef54d85c 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -917,93 +917,44 @@ void CPatchManager::executeBatchFile() extern void quitCrashReport (); quitCrashReport (); -#ifdef NL_OS_WINDOWS - // Launch the batch file - STARTUPINFO si; - PROCESS_INFORMATION pi; - - ZeroMemory( &si, sizeof(si) ); - si.dwFlags = STARTF_USESHOWWINDOW; - si.wShowWindow = SW_HIDE; // SW_SHOW - - si.cb = sizeof(si); - - ZeroMemory( &pi, sizeof(pi) ); - - // Start the child process. - string strCmdLine; - bool r2Mode = false; - #ifndef RY_BG_DOWNLOADER - r2Mode = ClientCfg.R2Mode; - #endif - if (r2Mode) - { - strCmdLine = UpdateBatchFilename + " " + LoginLogin + " " + LoginPassword; - } - else - { - strCmdLine = UpdateBatchFilename + " " + LoginLogin + " " + LoginPassword + " " + toString(LoginShardId); - } - if( !CreateProcess( NULL, // No module name (use command line). - (char*)strCmdLine.c_str(), // Command line. - NULL, // Process handle not inheritable. - NULL, // Thread handle not inheritable. - FALSE, // Set handle inheritance to FALSE. - 0, // No creation flags. - NULL, // Use parent's environment block. - NULL, // Use parent's starting directory. - &si, // Pointer to STARTUPINFO structure. - &pi ) // Pointer to PROCESS_INFORMATION structure. - ) - { - // error occurs during the launch - string str = toString("Can't execute '%s': code=%d %s (error code 30)", UpdateBatchFilename.c_str(), errno, strerror(errno)); - throw Exception (str); - } - // Close process and thread handles. -// CloseHandle( pi.hProcess ); -// CloseHandle( pi.hThread ); - -#else - // Start the child process. bool r2Mode = false; #ifndef RY_BG_DOWNLOADER r2Mode = ClientCfg.R2Mode; #endif - string strCmdLine; + std::string batchFilename; - strCmdLine = "./" + UpdateBatchFilename; +#ifdef NL_OS_WINDOWS + batchFilename = CPath::standardizeDosPath(ClientRootPath); +#else + batchFilename = ClientRootPath; +#endif - chmod(strCmdLine.c_str(), S_IRWXU); - if (r2Mode) + batchFilename += UpdateBatchFilename; + +#ifdef NL_OS_UNIX + // make script executable under UNIX + chmod(batchFilename.c_str(), S_IRWXU); +#endif + + std::string cmdLine = "\"" + batchFilename + "\" " + LoginLogin + " " + LoginPassword; + + if (!r2Mode) { - if (execl(strCmdLine.c_str(), strCmdLine.c_str(), LoginLogin.c_str(), LoginPassword.c_str(), (char *) NULL) == -1) - { - int errsv = errno; - nlerror("Execl Error: %d %s", errsv, strCmdLine.c_str()); - } - else - { - nlinfo("Ran batch file r2Mode Success"); - } + cmdLine += " " + toString(LoginShardId); + } + + if (launchProgram("", cmdLine, false)) + { + exit(0); } else { - if (execl(strCmdLine.c_str(), strCmdLine.c_str(), LoginLogin.c_str(), LoginPassword.c_str(), toString(LoginShardId).c_str(), (char *) NULL) == -1) - { - int errsv = errno; - nlerror("Execl r2mode Error: %d %s", errsv, strCmdLine.c_str()); - } - else - { - nlinfo("Ran batch file Success"); - } + // error occurs during the launch + string str = toString("Can't execute '%s': code=%d %s (error code 30)", UpdateBatchFilename.c_str(), errno, strerror(errno)); + throw Exception (str); } -#endif - -// exit(0); } // **************************************************************************** From 2f7992e43c079de1fcd4802ac425769fb125f0aa Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:28:47 +0100 Subject: [PATCH 21/61] Changed: Convert unpackTo directories to absolute directories --- code/ryzom/client/src/login_patch.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 0ef54d85c..68b29b687 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -1121,9 +1121,9 @@ void CPatchManager::readDescFile(sint32 nVersion) std::string unpackTo = category.getUnpackTo(); - if (unpackTo.substr(0, 2) == "./") + if (unpackTo.substr(0, 1) == ".") { - unpackTo = ClientRootPath + unpackTo.substr(2); + unpackTo = CPath::makePathAbsolute(unpackTo, ClientRootPath, true); category.setUnpackTo(unpackTo); } } @@ -2402,6 +2402,7 @@ void CPatchThread::run() // Set a more explicit error message pPM->setErrorMessage(sTranslate); } + PatchOk = !bErr; Ended = true; } From 22c8ce32a7c8ef8b9ce95814197b0639e04a3c81 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:30:00 +0100 Subject: [PATCH 22/61] Changed: Simplify client_patcher --- .../tools/client/client_patcher/main.cpp | 58 +------------------ 1 file changed, 2 insertions(+), 56 deletions(-) diff --git a/code/ryzom/tools/client/client_patcher/main.cpp b/code/ryzom/tools/client/client_patcher/main.cpp index 004e3d861..54b258e63 100644 --- a/code/ryzom/tools/client/client_patcher/main.cpp +++ b/code/ryzom/tools/client/client_patcher/main.cpp @@ -209,59 +209,6 @@ int main(int argc, char *argv[]) return 1; } - // set default paths - std::string dataPath = "./data/"; - std::string rootPath = "./"; - - // use custom data path if specified - if (!ClientCfg.DataPath.empty()) - { - dataPath = CPath::standardizePath(ClientCfg.DataPath.front()); - string::size_type pos = dataPath.rfind('/', dataPath.length()-2); - if (pos != string::npos) - rootPath = dataPath.substr(0, pos+1); - } - - std::string unpackPath = CPath::standardizePath(rootPath + "unpack"); - - // check if user can write in data directory - if (!CFile::isExists(unpackPath)) - { - if (!CFile::createDirectoryTree(unpackPath)) - { - printError("You don't have permission to create " + unpackPath); - return 1; - } - } - else - { - if (!CFile::createEmptyFile(unpackPath + "empty")) - { - printError("You don't have write permission in " + unpackPath); - return 1; - } - - CFile::deleteFile(unpackPath + "empty"); - } - - // only use PreDataPath for looking paths - if (!ClientCfg.PreDataPath.empty()) - { - for(uint i = 0; i < ClientCfg.PreDataPath.size(); ++i) - { - CPath::addSearchPath(NLMISC::expandEnvironmentVariables(ClientCfg.PreDataPath[i]), true, false); - } - } - - // add more search paths if translation is not found - if (!CPath::exists(lang + ".uxt")) - { - CPath::addSearchPath("patcher", true, false); -#ifdef RYZOM_SHARE_PREFIX - CPath::addSearchPath(RYZOM_SHARE_PREFIX"/patcher", true, false); -#endif - } - // load translation CI18N::load(lang); @@ -270,9 +217,6 @@ int main(int argc, char *argv[]) // initialize patch manager and set the ryzom full path, before it's used CPatchManager *pPM = CPatchManager::getInstance(); - // set the correct root path - pPM->setClientRootPath(rootPath); - // use PatchUrl vector patchURLs; pPM->init(patchURLs, ClientCfg.PatchUrl, ClientCfg.PatchVersion); @@ -385,6 +329,8 @@ int main(int argc, char *argv[]) printError(convert(CI18N::get("uiErrPatchApply")) + " " + error); return 1; } + + pPM->executeBatchFile(); } /* From 47f4a5d501a3f5b567ec040e7b59060669b17f39 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:30:19 +0100 Subject: [PATCH 23/61] Changed: Use CCmdArgs for client_patcher --- code/ryzom/tools/client/client_patcher/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/ryzom/tools/client/client_patcher/main.cpp b/code/ryzom/tools/client/client_patcher/main.cpp index 54b258e63..4402da8a9 100644 --- a/code/ryzom/tools/client/client_patcher/main.cpp +++ b/code/ryzom/tools/client/client_patcher/main.cpp @@ -1,6 +1,10 @@ #include "stdpch.h" #include "login_patch.h" #include "client_cfg.h" +#include "user_agent.h" + +#include "nel/misc/cmd_args.h" + #include #ifdef NL_OS_WINDOWS @@ -28,6 +32,8 @@ string VersionName; string LoginLogin, LoginPassword; uint32 LoginShardId = 0xFFFFFFFF; +CCmdArgs Args; + bool useUtf8 = false; bool useEsc = false; @@ -147,6 +153,12 @@ int main(int argc, char *argv[]) // init the Nel context CApplicationContext appContext; + Args.setVersion(getDisplayVersion()); + Args.setDescription("Ryzom client"); + Args.addArg("c", "config", "id", "Use this configuration to determine what directory to use by default"); + + if (!Args.parse(argc, argv)) return 1; + // create logs in temporary directory createDebug(CPath::getTemporaryDirectory().c_str(), true, true); From 5c8e42734c4c78f1786ea27acde7ec6dd429b136 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:49:37 +0100 Subject: [PATCH 24/61] Changed: Detect .bat file in launchProgram and adapt syntax of CreateProcess --- code/nel/src/misc/common.cpp | 17 ++++++++++++++++- code/ryzom/client/src/login_patch.cpp | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 6888dd24f..d586e4638 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -732,7 +732,22 @@ bool launchProgram(const std::string &programName, const std::string &arguments, SetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, NULL ); } - BOOL res = CreateProcessA(programName.empty() ? NULL:programName.c_str(), (char*)arguments.c_str(), NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW, NULL, NULL, &si, &pi); + const char *sProgramName = programName.c_str(); + + std::string args; + + // a .bat file must have first parameter to NULL and use 2nd parameter to pass filename + if (CFile::getExtension(programName) == "bat") + { + sProgramName = NULL; + args = "\"" + programName + "\" " + arguments; + } + else + { + args = arguments; + } + + BOOL res = CreateProcessA(sProgramName, (char*)args.c_str(), NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW, NULL, NULL, &si, &pi); if (res) { diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 68b29b687..898ee7d6d 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -938,14 +938,14 @@ void CPatchManager::executeBatchFile() chmod(batchFilename.c_str(), S_IRWXU); #endif - std::string cmdLine = "\"" + batchFilename + "\" " + LoginLogin + " " + LoginPassword; + std::string arguments = LoginLogin + " " + LoginPassword; if (!r2Mode) { - cmdLine += " " + toString(LoginShardId); + arguments += " " + toString(LoginShardId); } - if (launchProgram("", cmdLine, false)) + if (launchProgram(batchFilename, arguments, false)) { exit(0); } From 7028b0ce67dfdb1a1df90c94b3bbaadc5001da17 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:50:04 +0100 Subject: [PATCH 25/61] Changed: Use absolute path --- code/ryzom/client/src/login_patch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 898ee7d6d..3273dc95d 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -719,7 +719,7 @@ void CPatchManager::stopPatchThread() // **************************************************************************** void CPatchManager::deleteBatchFile() { - deleteFile(UpdateBatchFilename, false, false); + deleteFile(ClientRootPath + UpdateBatchFilename, false, false); } // **************************************************************************** @@ -952,7 +952,7 @@ void CPatchManager::executeBatchFile() else { // error occurs during the launch - string str = toString("Can't execute '%s': code=%d %s (error code 30)", UpdateBatchFilename.c_str(), errno, strerror(errno)); + string str = toString("Can't execute '%s': code=%d %s (error code 30)", batchFilename.c_str(), errno, strerror(errno)); throw Exception (str); } } From 07ef52ebe0801a8fb520de327b3ddec1f5cc5f31 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 20:48:49 +0100 Subject: [PATCH 26/61] Fixed: Compilation of shared library --- code/ryzom/client/src/seven_zip/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/seven_zip/CMakeLists.txt b/code/ryzom/client/src/seven_zip/CMakeLists.txt index eaa7cda6d..c4d61ae1d 100644 --- a/code/ryzom/client/src/seven_zip/CMakeLists.txt +++ b/code/ryzom/client/src/seven_zip/CMakeLists.txt @@ -5,7 +5,7 @@ FILE(GLOB LIB_SRC *.cpp *.h) LIST(REMOVE_ITEM LIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/7zMain.cpp) NL_TARGET_LIB(ryzom_sevenzip ${LIB_SRC}) -# TARGET_LINK_LIBRARIES(ryzom_sevenzip ${PLATFORM_LINKFLAGS}) +TARGET_LINK_LIBRARIES(ryzom_sevenzip nelmisc) NL_DEFAULT_PROPS(ryzom_sevenzip "Ryzom, Library: Seven Zip") NL_ADD_RUNTIME_FLAGS(ryzom_sevenzip) NL_ADD_LIB_SUFFIX(ryzom_sevenzip) From 5b82b0cd3b7b61cb87506dc965fb8fadcd5053f2 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 3 Feb 2016 20:17:16 +0100 Subject: [PATCH 27/61] Changed: Use KiB and MiB as units --- code/ryzom/tools/translation/translated/en.uxt | 8 ++++---- code/ryzom/tools/translation/translated/fr.uxt | 8 ++++---- code/ryzom/tools/translation/translated/wk.uxt | 8 ++++---- code/ryzom/tools/translation/work/wk.uxt | 6 ++++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/code/ryzom/tools/translation/translated/en.uxt b/code/ryzom/tools/translation/translated/en.uxt index 19c5f118e..fbff21563 100644 --- a/code/ryzom/tools/translation/translated/en.uxt +++ b/code/ryzom/tools/translation/translated/en.uxt @@ -1415,13 +1415,13 @@ uiErrPatchApply [Error: Patch process ended but the patch has not been successfu // INDEX 353 uiErrChecking [Error: Patch files failed - checking.] -// HASH_VALUE 40D0242C40D0242C +// HASH_VALUE 8E9280411622E45F // INDEX 354 -uiKb [KB] +uiKb [KiB] -// HASH_VALUE 4050243440502434 +// HASH_VALUE 90B288459762EC61 // INDEX 355 -uiMb [MB] +uiMb [MiB] // HASH_VALUE 9FA5A06DD895B637 // INDEX 356 diff --git a/code/ryzom/tools/translation/translated/fr.uxt b/code/ryzom/tools/translation/translated/fr.uxt index 00a167f20..32e90986a 100644 --- a/code/ryzom/tools/translation/translated/fr.uxt +++ b/code/ryzom/tools/translation/translated/fr.uxt @@ -1415,13 +1415,13 @@ uiErrPatchApply [Erreur : le processus de mises à jour est terminé mais les pa // INDEX 353 uiErrChecking [Erreur : Echec des fichiers de mises à jour - vérification.] -// HASH_VALUE 40D0242C40D0242C +// HASH_VALUE 8E9280411622E45F // INDEX 354 -uiKb [Ko] +uiKb [Kio] -// HASH_VALUE 4050243440502434 +// HASH_VALUE 90B288459762EC61 // INDEX 355 -uiMb [Mo] +uiMb [Mio] // HASH_VALUE 9FA5A06DD895B637 // INDEX 356 diff --git a/code/ryzom/tools/translation/translated/wk.uxt b/code/ryzom/tools/translation/translated/wk.uxt index 82b0aa4aa..d79fa74fc 100644 --- a/code/ryzom/tools/translation/translated/wk.uxt +++ b/code/ryzom/tools/translation/translated/wk.uxt @@ -1445,13 +1445,13 @@ uiErrPatchApply [Error : Patch process ended but the patch has not been successf // INDEX 353 uiErrChecking [Error : Checking for patch files failed] -// HASH_VALUE 40D0242C40D0242C +// HASH_VALUE 8E9280411622E45F // INDEX 354 -uiKb [KB] +uiKb [KiB] -// HASH_VALUE 4050243440502434 +// HASH_VALUE 90B288459762EC61 // INDEX 355 -uiMb [MB] +uiMb [MiB] // HASH_VALUE 9FA5A06DD895B637 // INDEX 356 diff --git a/code/ryzom/tools/translation/work/wk.uxt b/code/ryzom/tools/translation/work/wk.uxt index fc3750c76..e9f920a17 100644 --- a/code/ryzom/tools/translation/work/wk.uxt +++ b/code/ryzom/tools/translation/work/wk.uxt @@ -753,9 +753,9 @@ uiErrPatchApply [Error : Patch process ended but the patch has not been successf uiErrChecking [Error : Checking for patch files failed] -uiKb [KB] +uiKb [KiB] -uiMb [MB] +uiMb [MiB] uiLoginGetFile [Getting File :] uiDLFailed [Download from emergency server failed, patching is aborted] @@ -13454,3 +13454,5 @@ uiShowClock12h [Use 12-hour clock] uittShowClock12h [If checked, use 12-hour clock in compass and in chat messages.] uiRadarUseCamera [Radar follows camera rotation] uittRadarUseCamera [If checked, use camera rotation for radar view.] +uiTotalPatch [TOTAL PATCH] +uiRequiredFiles [REQUIRED FILES] From df983e3be4738e4c37ab45c86e7f4060b5698e1e Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 3 Feb 2016 20:17:42 +0100 Subject: [PATCH 28/61] Changed: Translate some texts in patch screen --- code/ryzom/tools/translation/translated/en.uxt | 8 ++++++++ code/ryzom/tools/translation/translated/fr.uxt | 8 ++++++++ code/ryzom/tools/translation/translated/wk.uxt | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/code/ryzom/tools/translation/translated/en.uxt b/code/ryzom/tools/translation/translated/en.uxt index fbff21563..b406d25c6 100644 --- a/code/ryzom/tools/translation/translated/en.uxt +++ b/code/ryzom/tools/translation/translated/en.uxt @@ -27237,3 +27237,11 @@ uiRadarUseCamera [Radar follows camera rotation] // INDEX 6466 uittRadarUseCamera [If checked, use camera rotation for radar view.] +// HASH_VALUE 82A1901C06A3F72E +// INDEX 6467 +uiTotalPatch [TOTAL PATCH] + +// HASH_VALUE D091B40C4890BC25 +// INDEX 6468 +uiRequiredFiles [REQUIRED FILES] + diff --git a/code/ryzom/tools/translation/translated/fr.uxt b/code/ryzom/tools/translation/translated/fr.uxt index 32e90986a..31263f558 100644 --- a/code/ryzom/tools/translation/translated/fr.uxt +++ b/code/ryzom/tools/translation/translated/fr.uxt @@ -27238,3 +27238,11 @@ uiRadarUseCamera [Le radar suit la rotation de la caméra] // INDEX 6466 uittRadarUseCamera [Si coché, utilise la rotation de la caméra pour la vue du radar.] +// HASH_VALUE 82A1901C06A3F72E +// INDEX 6467 +uiTotalPatch [PATCH TOTAL] + +// HASH_VALUE D091B40C4890BC25 +// INDEX 6468 +uiRequiredFiles [FICHIERS REQUIS] + diff --git a/code/ryzom/tools/translation/translated/wk.uxt b/code/ryzom/tools/translation/translated/wk.uxt index d79fa74fc..8b2db3e34 100644 --- a/code/ryzom/tools/translation/translated/wk.uxt +++ b/code/ryzom/tools/translation/translated/wk.uxt @@ -27455,3 +27455,11 @@ uiRadarUseCamera [Radar follows camera rotation] // INDEX 6466 uittRadarUseCamera [If checked, use camera rotation for radar view.] +// HASH_VALUE 82A1901C06A3F72E +// INDEX 6467 +uiTotalPatch [TOTAL PATCH] + +// HASH_VALUE D091B40C4890BC25 +// INDEX 6468 +uiRequiredFiles [REQUIRED FILES] + From e408242a39006f06373d225d36963baae029cf05 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 3 Feb 2016 21:56:28 +0100 Subject: [PATCH 29/61] Changed: Minor changes --- .../data/gamedev/interfaces_v3/login_main.xml | 232 +++++++++--------- code/ryzom/client/src/seven_zip/seven_zip.cpp | 2 +- 2 files changed, 117 insertions(+), 117 deletions(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml b/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml index 041a47359..dfde74c65 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml @@ -24,7 +24,7 @@ - @@ -32,35 +32,35 @@ - + - + - + - + - + - - - - + - @@ -73,23 +73,23 @@ - - - + - + @@ -120,7 +120,7 @@ - + - + - + - + - + - + - + - + - - + + - + @@ -224,12 +224,12 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t - + - - + + - + - + @@ -285,28 +285,28 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t - + - + - - + + - + - + - + - + @@ -318,17 +318,17 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t