mirror of
https://github.com/glest/glest-source.git
synced 2025-08-27 09:54:26 +02:00
maps:allow zgm extension, use zgm by default in editor
This commit is contained in:
@@ -1111,12 +1111,17 @@ namespace Shared {
|
||||
endPathWithSlash(map_path);
|
||||
|
||||
const string original = map_path + mapName;
|
||||
const string zeta = map_path + mapName + ".zgm";
|
||||
const string mega = map_path + mapName + ".mgm";
|
||||
const string glest = map_path + mapName + ".gbm";
|
||||
|
||||
if ((EndsWith(original, ".mgm") == true || EndsWith(original, ".gbm") == true) &&
|
||||
fileExists(original)) {
|
||||
if (( EndsWith(original, ".zgm") == true ||
|
||||
EndsWith(original, ".mgm") == true ||
|
||||
EndsWith(original, ".gbm") == true) &&
|
||||
fileExists(original)) {
|
||||
return original;
|
||||
} else if (fileExists(zeta)) {
|
||||
return zeta;
|
||||
} else if (fileExists(mega)) {
|
||||
return mega;
|
||||
} else if (fileExists(glest)) {
|
||||
@@ -1146,6 +1151,10 @@ namespace Shared {
|
||||
findAll(path + "*.gbm", results2, cutExtension, false);
|
||||
copy(results2.begin(), results2.end(), std::inserter(allMaps2, allMaps2.begin()));
|
||||
|
||||
results2.clear();
|
||||
findAll(path + "*.zgm", results2, cutExtension, false);
|
||||
copy(results2.begin(), results2.end(), std::inserter(allMaps2, allMaps2.begin()));
|
||||
|
||||
results2.clear();
|
||||
findAll(path + "*.mgm", results2, cutExtension, false);
|
||||
copy(results2.begin(), results2.end(), std::inserter(allMaps2, allMaps2.begin()));
|
||||
@@ -1160,6 +1169,10 @@ namespace Shared {
|
||||
findAll(pathList, "*.gbm", results, cutExtension, false);
|
||||
copy(results.begin(), results.end(), std::inserter(allMaps, allMaps.begin()));
|
||||
|
||||
results.clear();
|
||||
findAll(pathList, "*.zgm", results, cutExtension, false);
|
||||
copy(results.begin(), results.end(), std::inserter(allMaps, allMaps.begin()));
|
||||
|
||||
results.clear();
|
||||
findAll(pathList, "*.mgm", results, cutExtension, false);
|
||||
copy(results.begin(), results.end(), std::inserter(allMaps, allMaps.begin()));
|
||||
|
@@ -287,8 +287,8 @@ namespace Shared {
|
||||
destFile += mapFileName.first;
|
||||
|
||||
if (mapFileName.second == "") {
|
||||
if (EndsWith(destFile, ".mgm") == false && EndsWith(destFile, ".gbm") == false) {
|
||||
destFileExt = ".mgm";
|
||||
if (EndsWith(destFile, ".zgm") == false && EndsWith(destFile, ".mgm") == false && EndsWith(destFile, ".gbm") == false) {
|
||||
destFileExt = ".zgm";
|
||||
destFile += destFileExt;
|
||||
}
|
||||
}
|
||||
@@ -373,7 +373,7 @@ namespace Shared {
|
||||
result = getMapFromServer(mapFileName, "", "");
|
||||
} else {
|
||||
pair<string, string> findMapFileName = mapFileName;
|
||||
findMapFileName.first += +".mgm";
|
||||
findMapFileName.first += +".zgm";
|
||||
|
||||
result = getMapFromServer(findMapFileName, FTP_MAPS_CUSTOM_USERNAME, FTP_COMMON_PASSWORD);
|
||||
if (result.first == ftp_crt_FAIL && this->getQuitStatus() == false) {
|
||||
@@ -381,13 +381,18 @@ namespace Shared {
|
||||
findMapFileName.first += +".gbm";
|
||||
result = getMapFromServer(findMapFileName, FTP_MAPS_CUSTOM_USERNAME, FTP_COMMON_PASSWORD);
|
||||
if (result.first == ftp_crt_FAIL && this->getQuitStatus() == false) {
|
||||
findMapFileName = mapFileName;
|
||||
findMapFileName.first += +".mgm";
|
||||
result = getMapFromServer(findMapFileName, FTP_MAPS_USERNAME, FTP_COMMON_PASSWORD);
|
||||
findMapFileName = mapFileName;
|
||||
findMapFileName.first += +".zgm";
|
||||
result = getMapFromServer(findMapFileName, FTP_MAPS_USERNAME, FTP_COMMON_PASSWORD);
|
||||
if (result.first == ftp_crt_FAIL && this->getQuitStatus() == false) {
|
||||
findMapFileName = mapFileName;
|
||||
findMapFileName.first += +".gbm";
|
||||
findMapFileName.first += +".mgm";
|
||||
result = getMapFromServer(findMapFileName, FTP_MAPS_USERNAME, FTP_COMMON_PASSWORD);
|
||||
if (result.first == ftp_crt_FAIL && this->getQuitStatus() == false) {
|
||||
findMapFileName = mapFileName;
|
||||
findMapFileName.first += +".gbm";
|
||||
result = getMapFromServer(findMapFileName, FTP_MAPS_USERNAME, FTP_COMMON_PASSWORD);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user