- bugfixes for wrong item names sometimes for ftp file transfers
This commit is contained in:
parent
614d0c25db
commit
82b6b02a89
|
@ -2116,17 +2116,17 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
|
||||||
Checksum::clearFileCache();
|
Checksum::clearFileCache();
|
||||||
//lastCheckedCRCMapValue = -1;
|
//lastCheckedCRCMapValue = -1;
|
||||||
Checksum checksum;
|
Checksum checksum;
|
||||||
string file = Map::getMapPath(gameSettings->getMap(),"",false);
|
string file = Map::getMapPath(itemName,"",false);
|
||||||
//console.addLine("Checking map CRC [" + file + "]");
|
//console.addLine("Checking map CRC [" + file + "]");
|
||||||
checksum.addFile(file);
|
checksum.addFile(file);
|
||||||
lastCheckedCRCMapValue = checksum.getSum();
|
lastCheckedCRCMapValue = checksum.getSum();
|
||||||
|
|
||||||
char szMsg[1024]="";
|
char szMsg[1024]="";
|
||||||
if(lang.hasString("DataMissingMapSuccessDownload") == true) {
|
if(lang.hasString("DataMissingMapSuccessDownload") == true) {
|
||||||
sprintf(szMsg,lang.get("DataMissingMapSuccessDownload").c_str(),getHumanPlayerName().c_str(),gameSettings->getMap().c_str());
|
sprintf(szMsg,lang.get("DataMissingMapSuccessDownload").c_str(),getHumanPlayerName().c_str(),itemName.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(szMsg,"Player: %s SUCCESSFULLY downloaded the map: %s",getHumanPlayerName().c_str(),gameSettings->getMap().c_str());
|
sprintf(szMsg,"Player: %s SUCCESSFULLY downloaded the map: %s",getHumanPlayerName().c_str(),itemName.c_str());
|
||||||
}
|
}
|
||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
}
|
}
|
||||||
|
@ -2135,10 +2135,10 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
|
||||||
|
|
||||||
char szMsg[1024]="";
|
char szMsg[1024]="";
|
||||||
if(lang.hasString("DataMissingMapFailDownload") == true) {
|
if(lang.hasString("DataMissingMapFailDownload") == true) {
|
||||||
sprintf(szMsg,lang.get("DataMissingMapFailDownload").c_str(),getHumanPlayerName().c_str(),gameSettings->getMap().c_str(),curlVersion->version);
|
sprintf(szMsg,lang.get("DataMissingMapFailDownload").c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(szMsg,"Player: %s FAILED to download the map: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),gameSettings->getMap().c_str(),curlVersion->version);
|
sprintf(szMsg,"Player: %s FAILED to download the map: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
|
||||||
}
|
}
|
||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
|
|
||||||
|
@ -2160,10 +2160,10 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
|
||||||
if(result.first == ftp_crt_SUCCESS) {
|
if(result.first == ftp_crt_SUCCESS) {
|
||||||
char szMsg[1024]="";
|
char szMsg[1024]="";
|
||||||
if(lang.hasString("DataMissingTilesetSuccessDownload") == true) {
|
if(lang.hasString("DataMissingTilesetSuccessDownload") == true) {
|
||||||
sprintf(szMsg,lang.get("DataMissingTilesetSuccessDownload").c_str(),getHumanPlayerName().c_str(),gameSettings->getTileset().c_str());
|
sprintf(szMsg,lang.get("DataMissingTilesetSuccessDownload").c_str(),getHumanPlayerName().c_str(),itemName.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(szMsg,"Player: %s SUCCESSFULLY downloaded the tileset: %s",getHumanPlayerName().c_str(),gameSettings->getTileset().c_str());
|
sprintf(szMsg,"Player: %s SUCCESSFULLY downloaded the tileset: %s",getHumanPlayerName().c_str(),itemName.c_str());
|
||||||
}
|
}
|
||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
|
|
||||||
|
@ -2182,7 +2182,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
|
||||||
|
|
||||||
// Refresh CRC
|
// Refresh CRC
|
||||||
Config &config = Config::getInstance();
|
Config &config = Config::getInstance();
|
||||||
lastCheckedCRCTilesetValue = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + gameSettings->getTileset() + string("/*"), ".xml", NULL);
|
lastCheckedCRCTilesetValue = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + itemName + string("/*"), ".xml", NULL);
|
||||||
|
|
||||||
safeMutexFTPProgress.ReleaseLock();
|
safeMutexFTPProgress.ReleaseLock();
|
||||||
// END
|
// END
|
||||||
|
@ -2195,10 +2195,10 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
|
||||||
|
|
||||||
char szMsg[1024]="";
|
char szMsg[1024]="";
|
||||||
if(lang.hasString("DataMissingTilesetFailDownload") == true) {
|
if(lang.hasString("DataMissingTilesetFailDownload") == true) {
|
||||||
sprintf(szMsg,lang.get("DataMissingTilesetFailDownload").c_str(),getHumanPlayerName().c_str(),gameSettings->getTileset().c_str(),curlVersion->version);
|
sprintf(szMsg,lang.get("DataMissingTilesetFailDownload").c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(szMsg,"Player: %s FAILED to download the tileset: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),gameSettings->getTileset().c_str(),curlVersion->version);
|
sprintf(szMsg,"Player: %s FAILED to download the tileset: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
|
||||||
}
|
}
|
||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
console.addLine(result.second,true);
|
console.addLine(result.second,true);
|
||||||
|
@ -2219,10 +2219,10 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
|
||||||
if(result.first == ftp_crt_SUCCESS) {
|
if(result.first == ftp_crt_SUCCESS) {
|
||||||
char szMsg[1024]="";
|
char szMsg[1024]="";
|
||||||
if(lang.hasString("DataMissingTechtreeSuccessDownload") == true) {
|
if(lang.hasString("DataMissingTechtreeSuccessDownload") == true) {
|
||||||
sprintf(szMsg,lang.get("DataMissingTechtreeSuccessDownload").c_str(),getHumanPlayerName().c_str(),gameSettings->getTech().c_str());
|
sprintf(szMsg,lang.get("DataMissingTechtreeSuccessDownload").c_str(),getHumanPlayerName().c_str(),itemName.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(szMsg,"Player: %s SUCCESSFULLY downloaded the techtree: %s",getHumanPlayerName().c_str(),gameSettings->getTech().c_str());
|
sprintf(szMsg,"Player: %s SUCCESSFULLY downloaded the techtree: %s",getHumanPlayerName().c_str(),itemName.c_str());
|
||||||
}
|
}
|
||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
|
|
||||||
|
@ -2241,7 +2241,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
|
||||||
|
|
||||||
// Refresh CRC
|
// Refresh CRC
|
||||||
Config &config = Config::getInstance();
|
Config &config = Config::getInstance();
|
||||||
lastCheckedCRCTechtreeValue = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml", NULL);
|
lastCheckedCRCTechtreeValue = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + itemName + string("/*"), ".xml", NULL);
|
||||||
|
|
||||||
safeMutexFTPProgress.ReleaseLock();
|
safeMutexFTPProgress.ReleaseLock();
|
||||||
// END
|
// END
|
||||||
|
@ -2254,10 +2254,10 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
|
||||||
|
|
||||||
char szMsg[1024]="";
|
char szMsg[1024]="";
|
||||||
if(lang.hasString("DataMissingTechtreeFailDownload") == true) {
|
if(lang.hasString("DataMissingTechtreeFailDownload") == true) {
|
||||||
sprintf(szMsg,lang.get("DataMissingTechtreeFailDownload").c_str(),getHumanPlayerName().c_str(),gameSettings->getTech().c_str(),curlVersion->version);
|
sprintf(szMsg,lang.get("DataMissingTechtreeFailDownload").c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(szMsg,"Player: %s FAILED to download the techtree: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),gameSettings->getTech().c_str(),curlVersion->version);
|
sprintf(szMsg,"Player: %s FAILED to download the techtree: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
|
||||||
}
|
}
|
||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
console.addLine(result.second,true);
|
console.addLine(result.second,true);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user