Removed CRC checks for game mods due to slow load times

This commit is contained in:
mathusummut
2019-03-19 23:28:54 +01:00
parent 4ad9ed1d65
commit 911a1fc927
3 changed files with 43 additions and 43 deletions

View File

@@ -685,7 +685,7 @@ namespace Game {
tilesetListRemote.clear(); tilesetListRemote.clear();
Tokenize(tilesetsMetaData, tilesetListRemote, "\n"); Tokenize(tilesetsMetaData, tilesetListRemote, "\n");
modMenuState = mmst_CalculatingCRC; //modMenuState = mmst_CalculatingCRC;
getTilesetsLocalList(); getTilesetsLocalList();
for (unsigned int i = 0; i < tilesetListRemote.size(); i++) { for (unsigned int i = 0; i < tilesetListRemote.size(); i++) {
@@ -1133,7 +1133,7 @@ namespace Game {
modinfo.imageUrl = techInfoList[5]; modinfo.imageUrl = techInfoList[5];
modinfo.type = mt_Techtree; modinfo.type = mt_Techtree;
string itemPath = /*string itemPath =
config.getPathListForType(ptTechs, config.getPathListForType(ptTechs,
"")[1] + "/" + modinfo.name + "")[1] + "/" + modinfo.name +
string("/*"); string("/*");
@@ -1158,9 +1158,9 @@ namespace Game {
} }
modinfo.localCRC = crc; modinfo.localCRC = crc;
//printf("itemPath='%s' remote crc:'%s' local crc:'%s' crc='%d' \n",itemPath.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str(),crc); //printf("itemPath='%s' remote crc:'%s' local crc:'%s' crc='%d' \n",itemPath.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str(),crc);
} else { } else {*/
modinfo.localCRC = 0; modinfo.localCRC = 0;
} //}
techCacheList[modinfo.name] = modinfo; techCacheList[modinfo.name] = modinfo;
return modinfo.name; return modinfo.name;
} }
@@ -1201,7 +1201,7 @@ namespace Game {
modinfo.imageUrl = tilesetInfoList[4]; modinfo.imageUrl = tilesetInfoList[4];
modinfo.type = mt_Tileset; modinfo.type = mt_Tileset;
string itemPath = /*string itemPath =
config.getPathListForType(ptTilesets, config.getPathListForType(ptTilesets,
"")[1] + "/" + modinfo.name + "")[1] + "/" + modinfo.name +
string("/*"); string("/*");
@@ -1228,11 +1228,11 @@ namespace Game {
//printf("itemPath='%s' remote crc:'%s' local crc:'%s' crc='%d' \n",itemPath.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str(),crc); //printf("itemPath='%s' remote crc:'%s' local crc:'%s' crc='%d' \n",itemPath.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str(),crc);
//printf("#1 refreshTilesetModInfo name [%s] modInfo.crc [%s] modInfo.localCRC [%s]\n",modinfo.name.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str()); //printf("#1 refreshTilesetModInfo name [%s] modInfo.crc [%s] modInfo.localCRC [%s]\n",modinfo.name.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str());
} else { } else {*/
modinfo.localCRC = 0; modinfo.localCRC = 0;
//printf("#2 refreshTilesetModInfo name [%s] modInfo.crc [%s] modInfo.localCRC [%s]\n",modinfo.name.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str()); //printf("#2 refreshTilesetModInfo name [%s] modInfo.crc [%s] modInfo.localCRC [%s]\n",modinfo.name.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str());
} //}
tilesetCacheList[modinfo.name] = modinfo; tilesetCacheList[modinfo.name] = modinfo;
return modinfo.name; return modinfo.name;
@@ -1315,7 +1315,7 @@ namespace Game {
modinfo.url = mapInfoList[4]; modinfo.url = mapInfoList[4];
modinfo.imageUrl = mapInfoList[5]; modinfo.imageUrl = mapInfoList[5];
modinfo.type = mt_Map; modinfo.type = mt_Map;
modinfo.localCRC = getMapCRC(modinfo.name); modinfo.localCRC = /*getMapCRC(modinfo.name)*/0;
mapCacheList[modinfo.name] = modinfo; mapCacheList[modinfo.name] = modinfo;
return modinfo.name; return modinfo.name;
} }
@@ -1383,7 +1383,7 @@ namespace Game {
modinfo.imageUrl = scenarioInfoList[4]; modinfo.imageUrl = scenarioInfoList[4];
modinfo.type = mt_Scenario; modinfo.type = mt_Scenario;
string itemPath = /*string itemPath =
config.getPathListForType(ptScenarios, config.getPathListForType(ptScenarios,
"")[1] + "/" + modinfo.name + "")[1] + "/" + modinfo.name +
string("/*"); string("/*");
@@ -1408,9 +1408,9 @@ namespace Game {
} }
modinfo.localCRC = crc; modinfo.localCRC = crc;
//printf(" itemPath='%s' remote crc:'%s' local crc:'%s' crc='%d' \n",itemPath.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str(),crc); //printf(" itemPath='%s' remote crc:'%s' local crc:'%s' crc='%d' \n",itemPath.c_str(),modinfo.crc.c_str(),modinfo.localCRC.c_str(),crc);
} else { } else {*/
modinfo.localCRC = 0; modinfo.localCRC = 0;
} //}
scenarioCacheList[modinfo.name] = modinfo; scenarioCacheList[modinfo.name] = modinfo;
return modinfo.name; return modinfo.name;
} }
@@ -2003,7 +2003,7 @@ namespace Game {
config.getPathListForType(ptTechs, config.getPathListForType(ptTechs,
"")[1] + "/" + selectedTechName + "")[1] + "/" + selectedTechName +
string("/*"); string("/*");
bool forceRefresh = /*bool forceRefresh =
(mapCRCUpdateList.find(itemPath) == mapCRCUpdateList.end()); (mapCRCUpdateList.find(itemPath) == mapCRCUpdateList.end());
if (modInfo.crc != 0 && modInfo.crc != if (modInfo.crc != 0 && modInfo.crc !=
getFolderTreeContentsCheckSumRecursively(itemPath, ".xml", getFolderTreeContentsCheckSumRecursively(itemPath, ".xml",
@@ -2023,7 +2023,7 @@ namespace Game {
lang.getString("ModLocalRemoteMismatch").c_str(), lang.getString("ModLocalRemoteMismatch").c_str(),
selectedTechName.c_str()); selectedTechName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true); showMessageBox(szBuf, lang.getString("Notice"), true);
} else { } else {*/
mainMessageBoxState = ftpmsg_None; mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.getString("Ok"), 450); mainMessageBox.init(lang.getString("Ok"), 450);
char szBuf[8096] = ""; char szBuf[8096] = "";
@@ -2031,7 +2031,7 @@ namespace Game {
lang.getString("ModTechAlreadyInstalled").c_str(), lang.getString("ModTechAlreadyInstalled").c_str(),
selectedTechName.c_str()); selectedTechName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true); showMessageBox(szBuf, lang.getString("Notice"), true);
} //}
mapCRCUpdateList[itemPath] = true; mapCRCUpdateList[itemPath] = true;
} }
} else { } else {
@@ -2118,7 +2118,7 @@ namespace Game {
config.getPathListForType(ptTilesets, config.getPathListForType(ptTilesets,
"")[1] + "/" + "")[1] + "/" +
selectedTilesetName + string("/*"); selectedTilesetName + string("/*");
bool forceRefresh = /*bool forceRefresh =
(mapCRCUpdateList.find(itemPath) == mapCRCUpdateList.end()); (mapCRCUpdateList.find(itemPath) == mapCRCUpdateList.end());
if (modInfo.crc != 0 && modInfo.crc != if (modInfo.crc != 0 && modInfo.crc !=
@@ -2141,7 +2141,7 @@ namespace Game {
lang.getString("ModLocalRemoteMismatch").c_str(), lang.getString("ModLocalRemoteMismatch").c_str(),
selectedTilesetName.c_str()); selectedTilesetName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true); showMessageBox(szBuf, lang.getString("Notice"), true);
} else { } else {*/
mainMessageBoxState = ftpmsg_None; mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.getString("Ok"), 450); mainMessageBox.init(lang.getString("Ok"), 450);
char szBuf[8096] = ""; char szBuf[8096] = "";
@@ -2149,7 +2149,7 @@ namespace Game {
lang.getString("ModTilesetAlreadyInstalled"). lang.getString("ModTilesetAlreadyInstalled").
c_str(), selectedTilesetName.c_str()); c_str(), selectedTilesetName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true); showMessageBox(szBuf, lang.getString("Notice"), true);
} //}
} }
} else { } else {
string tilesetName = selectedTilesetName; string tilesetName = selectedTilesetName;
@@ -2224,7 +2224,7 @@ namespace Game {
(mapCacheList.find(selectedMapName) != mapCacheList.end()); (mapCacheList.find(selectedMapName) != mapCacheList.end());
if (remoteHasMap) { if (remoteHasMap) {
ModInfo & modInfo = mapCacheList[selectedMapName]; ModInfo & modInfo = mapCacheList[selectedMapName];
if (modInfo.crc != modInfo.localCRC) { /*if (modInfo.crc != modInfo.localCRC) {
mainMessageBoxState = ftpmsg_ReplaceMap; mainMessageBoxState = ftpmsg_ReplaceMap;
mainMessageBox.init(lang.getString("Yes"), mainMessageBox.init(lang.getString("Yes"),
lang.getString("No"), 450); lang.getString("No"), 450);
@@ -2233,7 +2233,7 @@ namespace Game {
lang.getString("ModLocalRemoteMismatch").c_str(), lang.getString("ModLocalRemoteMismatch").c_str(),
selectedMapName.c_str()); selectedMapName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true); showMessageBox(szBuf, lang.getString("Notice"), true);
} else { } else {*/
mainMessageBoxState = ftpmsg_None; mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.getString("Ok"), 450); mainMessageBox.init(lang.getString("Ok"), 450);
char szBuf[8096] = ""; char szBuf[8096] = "";
@@ -2241,7 +2241,7 @@ namespace Game {
lang.getString("ModMapAlreadyInstalled").c_str(), lang.getString("ModMapAlreadyInstalled").c_str(),
selectedMapName.c_str()); selectedMapName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true); showMessageBox(szBuf, lang.getString("Notice"), true);
} //}
} }
} else { } else {
string mapName = selectedMapName; string mapName = selectedMapName;
@@ -2326,7 +2326,7 @@ namespace Game {
config.getPathListForType(ptScenarios, config.getPathListForType(ptScenarios,
"")[1] + "/" + "")[1] + "/" +
selectedScenarioName + string("/*"); selectedScenarioName + string("/*");
bool forceRefresh = /*bool forceRefresh =
(mapCRCUpdateList.find(itemPath) == mapCRCUpdateList.end()); (mapCRCUpdateList.find(itemPath) == mapCRCUpdateList.end());
if (modInfo.crc != 0 && modInfo.crc != if (modInfo.crc != 0 && modInfo.crc !=
@@ -2348,7 +2348,7 @@ namespace Game {
lang.getString("ModLocalRemoteMismatch").c_str(), lang.getString("ModLocalRemoteMismatch").c_str(),
selectedScenarioName.c_str()); selectedScenarioName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true); showMessageBox(szBuf, lang.getString("Notice"), true);
} else { } else {*/
mainMessageBoxState = ftpmsg_None; mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.getString("Ok"), 450); mainMessageBox.init(lang.getString("Ok"), 450);
char szBuf[8096] = ""; char szBuf[8096] = "";
@@ -2356,7 +2356,7 @@ namespace Game {
lang.getString("ModScenarioAlreadyInstalled"). lang.getString("ModScenarioAlreadyInstalled").
c_str(), selectedScenarioName.c_str()); c_str(), selectedScenarioName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true); showMessageBox(szBuf, lang.getString("Notice"), true);
} //}
} }
} else { } else {
string scenarioName = selectedScenarioName; string scenarioName = selectedScenarioName;
@@ -2854,16 +2854,16 @@ namespace Game {
if (remoteHasTech) { if (remoteHasTech) {
ModInfo & modInfo = ModInfo & modInfo =
techCacheList[keyTechButtons[i]->getText()]; techCacheList[keyTechButtons[i]->getText()];
if (modInfo.crc == modInfo.localCRC) { //if (modInfo.crc == modInfo.localCRC) {
keyTechButtons[i]-> keyTechButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
getOnServerInstalledTexture()); getOnServerInstalledTexture());
} else { /*} else {
//printf("modInfo.name=%s modInfo.crc=%s modInfo.localCRC=%s\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str()); //printf("modInfo.name=%s modInfo.crc=%s modInfo.localCRC=%s\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str());
keyTechButtons[i]-> keyTechButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
getOnServerDifferentTexture()); getOnServerDifferentTexture());
} }*/
} else { } else {
keyTechButtons[i]->setCustomTexture(CoreData::getInstance(). keyTechButtons[i]->setCustomTexture(CoreData::getInstance().
getNotOnServerTexture getNotOnServerTexture
@@ -2908,18 +2908,18 @@ namespace Game {
ModInfo & modInfo = ModInfo & modInfo =
tilesetCacheList[keyTilesetButtons[i]->getText()]; tilesetCacheList[keyTilesetButtons[i]->getText()];
if (modInfo.crc == modInfo.localCRC) { //if (modInfo.crc == modInfo.localCRC) {
keyTilesetButtons[i]-> keyTilesetButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
getOnServerInstalledTexture()); getOnServerInstalledTexture());
} else { /*} else {
//printf("modInfo.name=%s modInfo.crc=%s modInfo.localCRC=%s\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str()); //printf("modInfo.name=%s modInfo.crc=%s modInfo.localCRC=%s\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str());
//printf("name [%s] modInfo.crc [%s] modInfo.localCRC [%s]\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str()); //printf("name [%s] modInfo.crc [%s] modInfo.localCRC [%s]\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str());
keyTilesetButtons[i]-> keyTilesetButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
getOnServerDifferentTexture()); getOnServerDifferentTexture());
} }*/
} else { } else {
keyTilesetButtons[i]-> keyTilesetButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
@@ -2963,16 +2963,16 @@ namespace Game {
if (remoteHasMap) { if (remoteHasMap) {
ModInfo & modInfo = ModInfo & modInfo =
mapCacheList[keyMapButtons[i]->getText()]; mapCacheList[keyMapButtons[i]->getText()];
if (modInfo.crc == modInfo.localCRC) { //if (modInfo.crc == modInfo.localCRC) {
keyMapButtons[i]-> keyMapButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
getOnServerInstalledTexture()); getOnServerInstalledTexture());
} else { /*} else {
//printf("modInfo.name=%s modInfo.crc=%s modInfo.localCRC=%s\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str()); //printf("modInfo.name=%s modInfo.crc=%s modInfo.localCRC=%s\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str());
keyMapButtons[i]-> keyMapButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
getOnServerDifferentTexture()); getOnServerDifferentTexture());
} }*/
} else { } else {
keyMapButtons[i]->setCustomTexture(CoreData::getInstance(). keyMapButtons[i]->setCustomTexture(CoreData::getInstance().
getNotOnServerTexture()); getNotOnServerTexture());
@@ -3022,16 +3022,16 @@ namespace Game {
if (remoteHasScenario) { if (remoteHasScenario) {
ModInfo & modInfo = ModInfo & modInfo =
scenarioCacheList[keyScenarioButtons[i]->getText()]; scenarioCacheList[keyScenarioButtons[i]->getText()];
if (modInfo.crc == modInfo.localCRC) { //if (modInfo.crc == modInfo.localCRC) {
keyScenarioButtons[i]-> keyScenarioButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
getOnServerInstalledTexture()); getOnServerInstalledTexture());
} else { /*} else {
//printf("modInfo.name=%s modInfo.crc=%s modInfo.localCRC=%s\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str()); //printf("modInfo.name=%s modInfo.crc=%s modInfo.localCRC=%s\n",modInfo.name.c_str(),modInfo.crc.c_str(),modInfo.localCRC.c_str());
keyScenarioButtons[i]-> keyScenarioButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
getOnServerDifferentTexture()); getOnServerDifferentTexture());
} }*/
} else { } else {
keyScenarioButtons[i]-> keyScenarioButtons[i]->
setCustomTexture(CoreData::getInstance(). setCustomTexture(CoreData::getInstance().
@@ -3111,11 +3111,11 @@ namespace Game {
pleaseWaitLabel.setText(lang. pleaseWaitLabel.setText(lang.
getString getString
("GettingModlistFromMasterserver")); ("GettingModlistFromMasterserver"));
} else if (modMenuState == mmst_CalculatingCRC) { }/* else if (modMenuState == mmst_CalculatingCRC) {
pleaseWaitLabel.setText(lang. pleaseWaitLabel.setText(lang.
getString getString
("PleaseWaitCalculatingCRC")); ("PleaseWaitCalculatingCRC"));
} }*/
oldMenuState = modMenuState; oldMenuState = modMenuState;
} }
float anim = GraphicComponent::getAnim(); float anim = GraphicComponent::getAnim();
@@ -3483,12 +3483,12 @@ namespace Game {
// Refresh CRC // Refresh CRC
Config & config = Config::getInstance(); Config & config = Config::getInstance();
getFolderTreeContentsCheckSumRecursively(config. /*getFolderTreeContentsCheckSumRecursively(config.
getPathListForType getPathListForType
(ptTechs, ""), (ptTechs, ""),
string("/") + itemName + string("/") + itemName +
string("/*"), ".xml", string("/*"), ".xml",
NULL, true); NULL, true);*/
safeMutexFTPProgress.ReleaseLock(); safeMutexFTPProgress.ReleaseLock();
refreshTechs(); refreshTechs();
@@ -3549,12 +3549,12 @@ namespace Game {
// Refresh CRC // Refresh CRC
Config & config = Config::getInstance(); Config & config = Config::getInstance();
getFolderTreeContentsCheckSumRecursively(config. /*getFolderTreeContentsCheckSumRecursively(config.
getPathListForType getPathListForType
(ptScenarios, ""), (ptScenarios, ""),
string("/") + itemName + string("/") + itemName +
string("/*"), ".xml", string("/*"), ".xml",
NULL, true); NULL, true);*/
safeMutexFTPProgress.ReleaseLock(); safeMutexFTPProgress.ReleaseLock();
refreshScenarios(); refreshScenarios();

View File

@@ -47,7 +47,7 @@ namespace Game {
enum ModMenuState { enum ModMenuState {
mmst_None, mmst_None,
mmst_Loading, mmst_Loading,
mmst_CalculatingCRC //mmst_CalculatingCRC
}; };
typedef vector < GraphicButton * >UserButtons; typedef vector < GraphicButton * >UserButtons;

View File

@@ -2,4 +2,4 @@
#define G3D_VIEWER_VERSION "1.0" #define G3D_VIEWER_VERSION "1.0"
#define MAP_EDITOR_VERSION "1.0" #define MAP_EDITOR_VERSION "1.0"
//Month then Day //Month then Day
#define GAME_BUILD_DATE "0308" #define GAME_BUILD_DATE "0319"