mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-26 18:40:54 +00:00
Fixed: Bug where exedll.bnp wasn't downloaded
This commit is contained in:
parent
3b7c82c473
commit
b78d33d1e2
1 changed files with 54 additions and 51 deletions
|
@ -73,9 +73,6 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
static std::vector<std::string> ForceMainlandPatchCategories;
|
|
||||||
static std::vector<std::string> ForceRemovePatchCategories;
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
|
|
||||||
|
@ -157,36 +154,6 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st
|
||||||
_AsyncDownloader = NULL;
|
_AsyncDownloader = NULL;
|
||||||
_StateListener = NULL;
|
_StateListener = NULL;
|
||||||
_StartRyzomAtEnd = true;
|
_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)
|
for (cat = 0; cat < DescFile.getCategories().categoryCount(); ++cat)
|
||||||
{
|
{
|
||||||
if (std::find(ForceMainlandPatchCategories.begin(), ForceMainlandPatchCategories.end(),
|
CBNPCategory &category = const_cast<CBNPCategory &>(DescFile.getCategories().getCategory(cat));
|
||||||
DescFile.getCategories().getCategory(cat).getName()) != ForceMainlandPatchCategories.end())
|
|
||||||
|
if (category.getName() == platformPatchCategory)
|
||||||
{
|
{
|
||||||
const_cast<CBNPCategory &>(DescFile.getCategories().getCategory(cat)).setOptional(true);
|
foundPlatformPatchCategory = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CBNPFileSet &bnpFS = const_cast<CBNPFileSet &>(DescFile.getFiles());
|
if (foundPlatformPatchCategory)
|
||||||
|
|
||||||
for(cat = 0; cat < DescFile.getCategories().categoryCount();)
|
|
||||||
{
|
{
|
||||||
const CBNPCategory &bnpCat = DescFile.getCategories().getCategory(cat);
|
std::vector<std::string> forceRemovePatchCategories;
|
||||||
|
|
||||||
if (std::find(ForceRemovePatchCategories.begin(), ForceRemovePatchCategories.end(),
|
// only download binaries for current platform
|
||||||
bnpCat.getName()) != ForceRemovePatchCategories.end())
|
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<CBNPFileSet &>(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);
|
for (uint file = 0; file < bnpCat.fileCount(); ++file)
|
||||||
bnpFS.removeFile(fileName);
|
{
|
||||||
|
std::string fileName = bnpCat.getFile(file);
|
||||||
|
bnpFS.removeFile(fileName);
|
||||||
|
}
|
||||||
|
const_cast<CBNPCategorySet &>(DescFile.getCategories()).deleteCategory(cat);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++cat;
|
||||||
}
|
}
|
||||||
const_cast<CBNPCategorySet &>(DescFile.getCategories()).deleteCategory(cat);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++cat;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue