From 58a8da65901ae5c9d045c8ce0a3cf6374b373362 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Sep 2016 19:40:40 +0200 Subject: [PATCH] Merge with develop --- code/ryzom/client/macosx/Info.plist | 2 +- code/ryzom/client/src/login_patch.cpp | 105 +++++++++++++------------- code/ryzom/client/src/stdpch.h | 1 - 3 files changed, 55 insertions(+), 53 deletions(-) diff --git a/code/ryzom/client/macosx/Info.plist b/code/ryzom/client/macosx/Info.plist index 9bb1fdbe0..0d86dbb1b 100644 --- a/code/ryzom/client/macosx/Info.plist +++ b/code/ryzom/client/macosx/Info.plist @@ -43,7 +43,7 @@ LSApplicationCategoryType public.app-category.role-playing-games LSFileQuarantineEnabled - + LSMinimumSystemVersion ${CMAKE_OSX_DEPLOYMENT_TARGET} LSRequiresCarbon diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index f7ce24f45..34669e43f 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -73,9 +73,6 @@ // -static std::vector ForceMainlandPatchCategories; -static std::vector ForceRemovePatchCategories; - using namespace std; using namespace NLMISC; @@ -157,36 +154,6 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st _AsyncDownloader = NULL; _StateListener = NULL; _StartRyzomAtEnd = true; - - // only download binaries for current platform - ForceRemovePatchCategories.clear(); - ForceRemovePatchCategories.push_back("main_exedll"); -#if defined(NL_OS_WIN64) - ForceRemovePatchCategories.push_back("main_exedll_win32"); - ForceRemovePatchCategories.push_back("main_exedll_linux32"); - ForceRemovePatchCategories.push_back("main_exedll_linux64"); - ForceRemovePatchCategories.push_back("main_exedll_osx"); -#elif defined(NL_OS_WIN32) - ForceRemovePatchCategories.push_back("main_exedll_win64"); - ForceRemovePatchCategories.push_back("main_exedll_linux32"); - ForceRemovePatchCategories.push_back("main_exedll_linux64"); - ForceRemovePatchCategories.push_back("main_exedll_osx"); -#elif defined(NL_OS_MAC) - ForceRemovePatchCategories.push_back("main_exedll_win32"); - ForceRemovePatchCategories.push_back("main_exedll_win64"); - ForceRemovePatchCategories.push_back("main_exedll_linux32"); - ForceRemovePatchCategories.push_back("main_exedll_linux64"); -#elif defined(NL_OS_UNIX) && defined(_LP64) - ForceRemovePatchCategories.push_back("main_exedll_win32"); - ForceRemovePatchCategories.push_back("main_exedll_win64"); - ForceRemovePatchCategories.push_back("main_exedll_linux32"); - ForceRemovePatchCategories.push_back("main_exedll_osx"); -#else - ForceRemovePatchCategories.push_back("main_exedll_win32"); - ForceRemovePatchCategories.push_back("main_exedll_win64"); - ForceRemovePatchCategories.push_back("main_exedll_linux64"); - ForceRemovePatchCategories.push_back("main_exedll_osx"); -#endif } // **************************************************************************** @@ -1249,35 +1216,71 @@ void CPatchManager::readDescFile(sint32 nVersion) } } - // tmp for debug : flag some categories as 'Mainland' + // patch category for current platform + std::string platformPatchCategory; + +#if defined(NL_OS_WIN64) + platformPatchCategory = "main_exedll_win64"; +#elif defined(NL_OS_WIN32) + platformPatchCategory = "main_exedll_win32"; +#elif defined(NL_OS_MAC) + platformPatchCategory = "main_exedll_osx"; +#elif defined(NL_OS_UNIX) && defined(_LP64) + platformPatchCategory = "main_exedll_linux64"; +#else + platformPatchCategory = "main_exedll_linux32"; +#endif + + // check if we are using main_exedll or specific main_exedll_* for platform + bool foundPlatformPatchCategory = false; + for (cat = 0; cat < DescFile.getCategories().categoryCount(); ++cat) { - if (std::find(ForceMainlandPatchCategories.begin(), ForceMainlandPatchCategories.end(), - DescFile.getCategories().getCategory(cat).getName()) != ForceMainlandPatchCategories.end()) + CBNPCategory &category = const_cast(DescFile.getCategories().getCategory(cat)); + + if (category.getName() == platformPatchCategory) { - const_cast(DescFile.getCategories().getCategory(cat)).setOptional(true); + foundPlatformPatchCategory = true; + break; } } - CBNPFileSet &bnpFS = const_cast(DescFile.getFiles()); - - for(cat = 0; cat < DescFile.getCategories().categoryCount();) + if (foundPlatformPatchCategory) { - const CBNPCategory &bnpCat = DescFile.getCategories().getCategory(cat); + std::vector forceRemovePatchCategories; - if (std::find(ForceRemovePatchCategories.begin(), ForceRemovePatchCategories.end(), - bnpCat.getName()) != ForceRemovePatchCategories.end()) + // only download binaries for current platform + forceRemovePatchCategories.push_back("main_exedll"); + forceRemovePatchCategories.push_back("main_exedll_win32"); + forceRemovePatchCategories.push_back("main_exedll_win64"); + forceRemovePatchCategories.push_back("main_exedll_linux32"); + forceRemovePatchCategories.push_back("main_exedll_linux64"); + forceRemovePatchCategories.push_back("main_exedll_osx"); + + // remove current platform category from remove list + forceRemovePatchCategories.erase(std::remove(forceRemovePatchCategories.begin(), + forceRemovePatchCategories.end(), platformPatchCategory), forceRemovePatchCategories.end()); + + CBNPFileSet &bnpFS = const_cast(DescFile.getFiles()); + + for (cat = 0; cat < DescFile.getCategories().categoryCount();) { - for(uint file = 0; file < bnpCat.fileCount(); ++file) + const CBNPCategory &bnpCat = DescFile.getCategories().getCategory(cat); + + if (std::find(forceRemovePatchCategories.begin(), forceRemovePatchCategories.end(), + bnpCat.getName()) != forceRemovePatchCategories.end()) { - std::string fileName = bnpCat.getFile(file); - bnpFS.removeFile(fileName); + for (uint file = 0; file < bnpCat.fileCount(); ++file) + { + std::string fileName = bnpCat.getFile(file); + bnpFS.removeFile(fileName); + } + const_cast(DescFile.getCategories()).deleteCategory(cat); + } + else + { + ++cat; } - const_cast(DescFile.getCategories()).deleteCategory(cat); - } - else - { - ++cat; } } } diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index e54865c18..c017c584b 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -29,7 +29,6 @@ #include #include #include -//#include #include #include #include