- ftp file xfer bugfixes
This commit is contained in:
parent
9afcbe97b8
commit
b84bede3df
|
@ -55,6 +55,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
|
||||||
currentTechName_factionPreview="";
|
currentTechName_factionPreview="";
|
||||||
currentFactionName_factionPreview="";
|
currentFactionName_factionPreview="";
|
||||||
ftpClientThread = NULL;
|
ftpClientThread = NULL;
|
||||||
|
getMissingMapFromFTPServer = "";
|
||||||
|
|
||||||
currentFactionLogo = "";
|
currentFactionLogo = "";
|
||||||
factionTexture=NULL;
|
factionTexture=NULL;
|
||||||
|
@ -963,7 +964,8 @@ void MenuStateConnectedGame::update() {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// try to get the map via ftp
|
// try to get the map via ftp
|
||||||
if(ftpClientThread != NULL) {
|
if(ftpClientThread != NULL && getMissingMapFromFTPServer != currentMap) {
|
||||||
|
getMissingMapFromFTPServer = currentMap;
|
||||||
ftpClientThread->addMapToRequests(currentMap);
|
ftpClientThread->addMapToRequests(currentMap);
|
||||||
}
|
}
|
||||||
maps.push_back("***missing***");
|
maps.push_back("***missing***");
|
||||||
|
|
|
@ -137,6 +137,7 @@ private:
|
||||||
std::vector<std::string> tileSets;
|
std::vector<std::string> tileSets;
|
||||||
|
|
||||||
FTPClientThread *ftpClientThread;
|
FTPClientThread *ftpClientThread;
|
||||||
|
string getMissingMapFromFTPServer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char szBuf[1024]="";
|
char szBuf[1024]="";
|
||||||
sprintf(szBuf,"ftp://maps:mg_ftp_server@%s/maps/%s",serverUrl.c_str(),mapFileName.c_str());
|
sprintf(szBuf,"ftp://maps:mg_ftp_server@%s/%s",serverUrl.c_str(),mapFileName.c_str());
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,szBuf);
|
curl_easy_setopt(curl, CURLOPT_URL,szBuf);
|
||||||
/* Define our callback to get called when there's data to be written */
|
/* Define our callback to get called when there's data to be written */
|
||||||
|
@ -107,7 +107,7 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
||||||
/* we failed */
|
/* we failed */
|
||||||
fprintf(stderr, "curl told us %d\n", res);
|
fprintf(stderr, "curl told us %d\n", res);
|
||||||
|
|
||||||
sprintf(szBuf,"ftp://maps_custom:mg_ftp_server@%s/maps/%s",serverUrl.c_str(),mapFileName.c_str());
|
sprintf(szBuf,"ftp://maps_custom:mg_ftp_server@%s/%s",serverUrl.c_str(),mapFileName.c_str());
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,szBuf);
|
curl_easy_setopt(curl, CURLOPT_URL,szBuf);
|
||||||
/* Define our callback to get called when there's data to be written */
|
/* Define our callback to get called when there's data to be written */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user