- attempt to let user know when host does not have data port open

This commit is contained in:
Mark Vejvoda 2012-10-16 00:58:49 +00:00
parent 0926f1e747
commit bb2ba50589
3 changed files with 36 additions and 1 deletions

View File

@ -3749,6 +3749,15 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
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, lang.isLanguageLocal(languageList[i]),languageList[i]);
if(result.first == ftp_crt_HOST_NOT_ACCEPTING) {
if(lang.hasString("HostNotAcceptingDataConnections",languageList[i]) == true) {
clientInterface->sendTextMessage(lang.get("DataMissingMapFailDownload",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
else {
clientInterface->sendTextMessage("*Warning* the host is not accepting data connections.",-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
}
}
console.addLine(result.second,true);
@ -3823,6 +3832,15 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
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, lang.isLanguageLocal(languageList[i]),languageList[i]);
if(result.first == ftp_crt_HOST_NOT_ACCEPTING) {
if(lang.hasString("HostNotAcceptingDataConnections",languageList[i]) == true) {
clientInterface->sendTextMessage(lang.get("DataMissingMapFailDownload",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
else {
clientInterface->sendTextMessage("*Warning* the host is not accepting data connections.",-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
}
}
console.addLine(result.second,true);
@ -3899,6 +3917,15 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
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, lang.isLanguageLocal(languageList[i]),languageList[i]);
if(result.first == ftp_crt_HOST_NOT_ACCEPTING) {
if(lang.hasString("HostNotAcceptingDataConnections",languageList[i]) == true) {
clientInterface->sendTextMessage(lang.get("DataMissingMapFailDownload",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
else {
clientInterface->sendTextMessage("*Warning* the host is not accepting data connections.",-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
}
}
console.addLine(result.second,true);

View File

@ -30,7 +30,8 @@ enum FTP_Client_ResultType {
ftp_crt_SUCCESS = 0,
ftp_crt_PARTIALFAIL = 1,
ftp_crt_FAIL = 2,
ftp_crt_ABORTED = 3
ftp_crt_ABORTED = 3,
ftp_crt_HOST_NOT_ACCEPTING = 4
};
enum FTP_Client_CallbackType {

View File

@ -338,6 +338,9 @@ pair<FTP_Client_ResultType,string> FTPClientThread::getMapFromServer(pair<string
if(res == CURLE_PARTIAL_FILE) {
result.first = ftp_crt_PARTIALFAIL;
}
else if(res == CURLE_COULDNT_CONNECT) {
result.first = ftp_crt_HOST_NOT_ACCEPTING;
}
}
else {
result.first = ftp_crt_SUCCESS;
@ -931,6 +934,10 @@ pair<FTP_Client_ResultType,string> FTPClientThread::getFileFromServer(FTP_Clien
if(res == CURLE_PARTIAL_FILE || ftpfile.isValidXfer == true) {
result.first = ftp_crt_PARTIALFAIL;
}
else if(res == CURLE_COULDNT_CONNECT) {
result.first = ftp_crt_HOST_NOT_ACCEPTING;
}
if(destRootFolder != "") {
if(pathCreated == true) {