- added techtrees for file xfer and CRC checking (might need to turn off etc later but lets test for now)

This commit is contained in:
Mark Vejvoda
2011-03-09 23:09:32 +00:00
parent 5f9e8d97d3
commit 63da3d7af2
8 changed files with 402 additions and 28 deletions

View File

@@ -36,7 +36,8 @@ enum FTP_Client_ResultType {
enum FTP_Client_CallbackType {
ftp_cct_Map = 0,
ftp_cct_Tileset = 1,
ftp_cct_DownloadProgress = 2
ftp_cct_Techtree = 2,
ftp_cct_DownloadProgress = 3
};
class FTPClientCallbackInterface {
@@ -61,6 +62,7 @@ protected:
FTPClientCallbackInterface *pCBObject;
std::pair<string,string> mapsPath;
std::pair<string,string> tilesetsPath;
std::pair<string,string> techtreesPath;
Mutex mutexMapFileList;
vector<string> mapFileList;
@@ -68,12 +70,18 @@ protected:
Mutex mutexTilesetList;
vector<string> tilesetList;
Mutex mutexTechtreeList;
vector<string> techtreeList;
void getMapFromServer(string mapFilename);
FTP_Client_ResultType getMapFromServer(string mapFileName, string ftpUser, string ftpUserPassword);
void getTilesetFromServer(string tileSetName);
FTP_Client_ResultType getTilesetFromServer(string tileSetName, string tileSetNameSubfolder, string ftpUser, string ftpUserPassword, bool findArchive);
void getTechtreeFromServer(string techtreeName);
FTP_Client_ResultType getTechtreeFromServer(string techtreeName, string ftpUser, string ftpUserPassword);
Mutex mutexProgressMutex;
string fileArchiveExtension;
@@ -85,6 +93,7 @@ public:
FTPClientThread(int portNumber,string serverUrl,
std::pair<string,string> mapsPath,
std::pair<string,string> tilesetsPath,
std::pair<string,string> techtreesPath,
FTPClientCallbackInterface *pCBObject,
string fileArchiveExtension,
string fileArchiveExtractCommand,
@@ -95,6 +104,7 @@ public:
void addMapToRequests(string mapFilename);
void addTilesetToRequests(string tileSetName);
void addTechtreeToRequests(string techtreeName);
FTPClientCallbackInterface * getCallBackObject();
void setCallBackObject(FTPClientCallbackInterface *value);

View File

@@ -33,13 +33,17 @@ class FTPServerThread : public BaseThread
protected:
std::pair<string,string> mapsPath;
std::pair<string,string> tilesetsPath;
std::pair<string,string> techtreesPath;
int portNumber;
int maxPlayers;
static FTPClientValidationInterface *ftpValidationIntf;
public:
FTPServerThread(std::pair<string,string> mapsPath, std::pair<string,string> tilesetsPath, int portNumber,int maxPlayers, FTPClientValidationInterface *ftpValidationIntf);
FTPServerThread(std::pair<string,string> mapsPath,
std::pair<string,string> tilesetsPath, std::pair<string,string> techtreesPath,
int portNumber,int maxPlayers, FTPClientValidationInterface *ftpValidationIntf);
~FTPServerThread();
virtual void execute();
virtual void signalQuit();