mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 07:31:21 +02:00
- by request added an option for modders to 'hide' duplicate files during validation
This commit is contained in:
@@ -1014,19 +1014,21 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
|
|||||||
printf("\n%s\t\t\tdisplays your SDL version information.",GAME_ARGS[GAME_ARG_SDL_INFO]);
|
printf("\n%s\t\t\tdisplays your SDL version information.",GAME_ARGS[GAME_ARG_SDL_INFO]);
|
||||||
printf("\n%s\t\t\tdisplays your LUA version information.",GAME_ARGS[GAME_ARG_LUA_INFO]);
|
printf("\n%s\t\t\tdisplays your LUA version information.",GAME_ARGS[GAME_ARG_LUA_INFO]);
|
||||||
printf("\n%s\t\t\tdisplays your CURL version information.",GAME_ARGS[GAME_ARG_CURL_INFO]);
|
printf("\n%s\t\t\tdisplays your CURL version information.",GAME_ARGS[GAME_ARG_CURL_INFO]);
|
||||||
printf("\n%s=x=purgeunused=purgeduplicates=svndelete\t\tdisplays a report detailing any known problems related",GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]);
|
printf("\n%s=x=purgeunused=purgeduplicates=svndelete=hideduplicates",GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]);
|
||||||
printf("\n \t\tto your selected techtrees game data.");
|
printf("\n \t\tdisplays a report detailing any known problems related to your selected techtrees game data.");
|
||||||
printf("\n \t\tWhere x is a comma-delimited list of techtrees to validate.");
|
printf("\n \t\tWhere x is a comma-delimited list of techtrees to validate.");
|
||||||
printf("\n \t\tWhere purgeunused is an optional parameter telling the validation to delete extra files in the techtree that are not used.");
|
printf("\n \t\tWhere purgeunused is an optional parameter telling the validation to delete extra files in the techtree that are not used.");
|
||||||
printf("\n \t\tWhere purgeduplicates is an optional parameter telling the validation to merge duplicate files in the techtree.");
|
printf("\n \t\tWhere purgeduplicates is an optional parameter telling the validation to merge duplicate files in the techtree.");
|
||||||
printf("\n \t\tWhere svndelete is an optional parameter telling the validation to call svn delete on duplicate / unused files in the techtree.");
|
printf("\n \t\tWhere svndelete is an optional parameter telling the validation to call svn delete on duplicate / unused files in the techtree.");
|
||||||
|
printf("\n \t\tWhere hideduplicates is an optional parameter telling the validation to NOT SHOW duplicate files in the techtree.");
|
||||||
printf("\n \t\t*NOTE: This only applies when files are purged due to the above flags being set.");
|
printf("\n \t\t*NOTE: This only applies when files are purged due to the above flags being set.");
|
||||||
printf("\n \t\texample: %s %s=megapack,vbros_pack_5",argv0,GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]);
|
printf("\n \t\texample: %s %s=megapack,vbros_pack_5",argv0,GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]);
|
||||||
printf("\n%s=x=purgeunused=purgeduplicates\t\tdisplays a report detailing any known problems related",GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]);
|
printf("\n%s=x=purgeunused=purgeduplicates=hideduplicates",GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]);
|
||||||
printf("\n \t\tto your selected factions game data.");
|
printf("\n \t\tdisplays a report detailing any known problems related to your selected factions game data.");
|
||||||
printf("\n \t\tWhere x is a comma-delimited list of factions to validate.");
|
printf("\n \t\tWhere x is a comma-delimited list of factions to validate.");
|
||||||
printf("\n \t\tWhere purgeunused is an optional parameter telling the validation to delete extra files in the faction that are not used.");
|
printf("\n \t\tWhere purgeunused is an optional parameter telling the validation to delete extra files in the faction that are not used.");
|
||||||
printf("\n \t\tWhere purgeduplicates is an optional parameter telling the validation to merge duplicate files in the faction.");
|
printf("\n \t\tWhere purgeduplicates is an optional parameter telling the validation to merge duplicate files in the faction.");
|
||||||
|
printf("\n \t\tWhere hideduplicates is an optional parameter telling the validation to NOT SHOW duplicate files in the techtree.");
|
||||||
printf("\n \t\t*NOTE: leaving the list empty is the same as running");
|
printf("\n \t\t*NOTE: leaving the list empty is the same as running");
|
||||||
printf("\n \t\t%s",GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]);
|
printf("\n \t\t%s",GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]);
|
||||||
printf("\n \t\texample: %s %s=tech,egypt",argv0,GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]);
|
printf("\n \t\texample: %s %s=tech,egypt",argv0,GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]);
|
||||||
@@ -1364,8 +1366,8 @@ void setupLogging(Config &config, bool haveSpecialOutputCommandLineOption) {
|
|||||||
|
|
||||||
void runTechValidationForPath(string techPath, string techName,
|
void runTechValidationForPath(string techPath, string techName,
|
||||||
const std::vector<string> filteredFactionList, World &world,
|
const std::vector<string> filteredFactionList, World &world,
|
||||||
bool purgeUnusedFiles,bool purgeDuplicateFiles, bool svnPurgeFiles,
|
bool purgeUnusedFiles,bool purgeDuplicateFiles, bool showDuplicateFiles,
|
||||||
double &purgedMegaBytes) {
|
bool svnPurgeFiles,double &purgedMegaBytes) {
|
||||||
Config &config = Config::getInstance();
|
Config &config = Config::getInstance();
|
||||||
vector<string> factionsList;
|
vector<string> factionsList;
|
||||||
findDirs(techPath + techName + "/factions/", factionsList, false, false);
|
findDirs(techPath + techName + "/factions/", factionsList, false, false);
|
||||||
@@ -1553,6 +1555,7 @@ void runTechValidationForPath(string techPath, string techName,
|
|||||||
printf("\nWarning, unused files were detected - END:\n");
|
printf("\nWarning, unused files were detected - END:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(showDuplicateFiles == true) {
|
||||||
std::map<int32,vector<string> > mapDuplicateFiles;
|
std::map<int32,vector<string> > mapDuplicateFiles;
|
||||||
// Now check for duplicate data content
|
// Now check for duplicate data content
|
||||||
for(std::map<string,vector<pair<string, string> > >::iterator iterMap = loadedFileList.begin();
|
for(std::map<string,vector<pair<string, string> > >::iterator iterMap = loadedFileList.begin();
|
||||||
@@ -1756,6 +1759,7 @@ void runTechValidationForPath(string techPath, string techName,
|
|||||||
|
|
||||||
printf("\nWarning, duplicate files were detected - END:\n");
|
printf("\nWarning, duplicate files were detected - END:\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(techtree_errors == false) {
|
if(techtree_errors == false) {
|
||||||
printf("\nValidation found NO ERRORS for techPath [%s] techName [%s] factions checked (count = %d):\n",techPath.c_str(), techName.c_str(),(int)factions.size());
|
printf("\nValidation found NO ERRORS for techPath [%s] techName [%s] factions checked (count = %d):\n",techPath.c_str(), techName.c_str(),(int)factions.size());
|
||||||
@@ -1773,6 +1777,7 @@ void runTechValidationReport(int argc, char** argv) {
|
|||||||
printf("====== Started Validation ======\n");
|
printf("====== Started Validation ======\n");
|
||||||
|
|
||||||
bool purgeDuplicateFiles = false;
|
bool purgeDuplicateFiles = false;
|
||||||
|
bool showDuplicateFiles = true;
|
||||||
bool purgeUnusedFiles = false;
|
bool purgeUnusedFiles = false;
|
||||||
bool svnPurgeFiles = false;
|
bool svnPurgeFiles = false;
|
||||||
|
|
||||||
@@ -1838,7 +1843,7 @@ void runTechValidationReport(int argc, char** argv) {
|
|||||||
|
|
||||||
printf("Found Scenario [%s] with custom techtree [%s] validating...\n",scenarioName.c_str(),techName.c_str());
|
printf("Found Scenario [%s] with custom techtree [%s] validating...\n",scenarioName.c_str(),techName.c_str());
|
||||||
runTechValidationForPath(techPath, techName, filteredFactionList,
|
runTechValidationForPath(techPath, techName, filteredFactionList,
|
||||||
world, purgeUnusedFiles, false, false, purgedMegaBytes);
|
world, purgeUnusedFiles, showDuplicateFiles, false, false, purgedMegaBytes);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@@ -1925,6 +1930,10 @@ void runTechValidationReport(int argc, char** argv) {
|
|||||||
svnPurgeFiles = true;
|
svnPurgeFiles = true;
|
||||||
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n");
|
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n");
|
||||||
}
|
}
|
||||||
|
else if(paramPartTokens[2] == "hideduplicates") {
|
||||||
|
showDuplicateFiles = false;
|
||||||
|
printf("*NOTE All duplicate techtree files will NOT be shown!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(paramPartTokens.size() >= 4) {
|
if(paramPartTokens.size() >= 4) {
|
||||||
if(paramPartTokens[3] == "purgeunused") {
|
if(paramPartTokens[3] == "purgeunused") {
|
||||||
@@ -1939,6 +1948,10 @@ void runTechValidationReport(int argc, char** argv) {
|
|||||||
svnPurgeFiles = true;
|
svnPurgeFiles = true;
|
||||||
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n");
|
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n");
|
||||||
}
|
}
|
||||||
|
else if(paramPartTokens[3] == "hideduplicates") {
|
||||||
|
showDuplicateFiles = false;
|
||||||
|
printf("*NOTE All duplicate techtree files will NOT be shown!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(paramPartTokens.size() >= 5) {
|
if(paramPartTokens.size() >= 5) {
|
||||||
if(paramPartTokens[4] == "purgeunused") {
|
if(paramPartTokens[4] == "purgeunused") {
|
||||||
@@ -1953,6 +1966,10 @@ void runTechValidationReport(int argc, char** argv) {
|
|||||||
svnPurgeFiles = true;
|
svnPurgeFiles = true;
|
||||||
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n");
|
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n");
|
||||||
}
|
}
|
||||||
|
else if(paramPartTokens[4] == "hideduplicates") {
|
||||||
|
showDuplicateFiles = false;
|
||||||
|
printf("*NOTE All duplicate techtree files will NOT be shown!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1976,7 +1993,8 @@ void runTechValidationReport(int argc, char** argv) {
|
|||||||
std::find(filteredTechTreeList.begin(),filteredTechTreeList.end(),techName) != filteredTechTreeList.end()) {
|
std::find(filteredTechTreeList.begin(),filteredTechTreeList.end(),techName) != filteredTechTreeList.end()) {
|
||||||
|
|
||||||
runTechValidationForPath(techPath, techName, filteredFactionList,
|
runTechValidationForPath(techPath, techName, filteredFactionList,
|
||||||
world, purgeUnusedFiles,purgeDuplicateFiles,svnPurgeFiles,purgedMegaBytes);
|
world, purgeUnusedFiles,purgeDuplicateFiles,
|
||||||
|
showDuplicateFiles,svnPurgeFiles,purgedMegaBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user