- more ftp updates

This commit is contained in:
Mark Vejvoda 2010-12-29 01:32:55 +00:00
parent 9442c22dc3
commit e79147796f
2 changed files with 7 additions and 2 deletions

View File

@ -963,7 +963,9 @@ void MenuStateConnectedGame::update() {
} }
else { else {
// try to get the map via ftp // try to get the map via ftp
if(ftpClientThread != NULL) {
ftpClientThread->addMapToRequests(currentMap);
}
maps.push_back("***missing***"); maps.push_back("***missing***");
} }
listBoxMap.setItems(maps); listBoxMap.setItems(maps);

View File

@ -17,6 +17,7 @@
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h> #include <curl/types.h>
#include <curl/easy.h> #include <curl/easy.h>
#include <algorithm>
using namespace Shared::Util; using namespace Shared::Util;
using namespace Shared::PlatformCommon; using namespace Shared::PlatformCommon;
@ -150,7 +151,9 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
void FTPClientThread::addMapToRequests(string mapFilename) { void FTPClientThread::addMapToRequests(string mapFilename) {
MutexSafeWrapper safeMutex(&mutexMapFileList); MutexSafeWrapper safeMutex(&mutexMapFileList);
mapFileList.push_back(mapFilename); if(std::find(mapFileList.begin(),mapFileList.end(),mapFilename) == mapFileList.end()) {
mapFileList.push_back(mapFilename);
}
} }