mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 03:09:49 +02:00
- added more socket threaded protection and output curl version if ftp transfers fail
This commit is contained in:
@@ -409,6 +409,27 @@ vector<string> Config::getPathListForType(PathType type, string scenarioDir) {
|
|||||||
if(isdir(userData.c_str()) == false) {
|
if(isdir(userData.c_str()) == false) {
|
||||||
createDirectoryPaths(userData);
|
createDirectoryPaths(userData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string userDataMaps = userData + GameConstants::folder_path_maps;
|
||||||
|
if(isdir(userDataMaps.c_str()) == false) {
|
||||||
|
createDirectoryPaths(userDataMaps);
|
||||||
|
}
|
||||||
|
string userDataScenarios = userData + GameConstants::folder_path_scenarios;
|
||||||
|
if(isdir(userDataScenarios.c_str()) == false) {
|
||||||
|
createDirectoryPaths(userDataScenarios);
|
||||||
|
}
|
||||||
|
string userDataTechs = userData + GameConstants::folder_path_techs;
|
||||||
|
if(isdir(userDataTechs.c_str()) == false) {
|
||||||
|
createDirectoryPaths(userDataTechs);
|
||||||
|
}
|
||||||
|
string userDataTilesets = userData + GameConstants::folder_path_tilesets;
|
||||||
|
if(isdir(userDataTilesets.c_str()) == false) {
|
||||||
|
createDirectoryPaths(userDataTilesets);
|
||||||
|
}
|
||||||
|
string userDataTutorials = userData + GameConstants::folder_path_tutorials;
|
||||||
|
if(isdir(userDataTutorials.c_str()) == false) {
|
||||||
|
createDirectoryPaths(userDataTutorials);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(scenarioDir != "") {
|
if(scenarioDir != "") {
|
||||||
pathList.push_back(data_path+scenarioDir);
|
pathList.push_back(data_path+scenarioDir);
|
||||||
|
@@ -1011,7 +1011,8 @@ int glestMain(int argc, char** argv) {
|
|||||||
|
|
||||||
if( (hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VERSION]) == true ||
|
if( (hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VERSION]) == true ||
|
||||||
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SDL_INFO]) == true ||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SDL_INFO]) == true ||
|
||||||
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LUA_INFO]) == true) &&
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LUA_INFO]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_CURL_INFO]) == true) &&
|
||||||
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == false &&
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == false &&
|
||||||
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]) == false &&
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]) == false &&
|
||||||
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]) == false) {
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]) == false) {
|
||||||
|
@@ -1691,8 +1691,10 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName, FTP_Client
|
|||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
curl_version_info_data *curlVersion= curl_version_info(CURLVERSION_NOW);
|
||||||
|
|
||||||
char szMsg[1024]="";
|
char szMsg[1024]="";
|
||||||
sprintf(szMsg,"Player: %s FAILED to download the map: %s",getHumanPlayerName().c_str(),gameSettings->getMap().c_str());
|
sprintf(szMsg,"Player: %s FAILED to download the map: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),gameSettings->getMap().c_str(),curlVersion->version);
|
||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1712,8 +1714,11 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName, FTP_Client
|
|||||||
findDirs(Config::getInstance().getPathListForType(ptTilesets), tileSets);
|
findDirs(Config::getInstance().getPathListForType(ptTilesets), tileSets);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
curl_version_info_data *curlVersion= curl_version_info(CURLVERSION_NOW);
|
||||||
|
|
||||||
char szMsg[1024]="";
|
char szMsg[1024]="";
|
||||||
sprintf(szMsg,"Player: %s FAILED to download the tileset: %s",getHumanPlayerName().c_str(),gameSettings->getTileset().c_str());
|
sprintf(szMsg,"Player: %s FAILED to download the tileset: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),gameSettings->getTileset().c_str(),curlVersion->version);
|
||||||
clientInterface->sendTextMessage(szMsg,-1, true);
|
clientInterface->sendTextMessage(szMsg,-1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -142,9 +142,6 @@ void ClientInterface::update() {
|
|||||||
string sMsg = "may go out of synch: client requestedCommands.size() = " + intToStr(requestedCommands.size());
|
string sMsg = "may go out of synch: client requestedCommands.size() = " + intToStr(requestedCommands.size());
|
||||||
sendTextMessage(sMsg,-1, true);
|
sendTextMessage(sMsg,-1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//clear chat variables
|
|
||||||
//!!!clearChatInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ClientInterface::getServerIpAddress() {
|
std::string ClientInterface::getServerIpAddress() {
|
||||||
@@ -153,10 +150,6 @@ std::string ClientInterface::getServerIpAddress() {
|
|||||||
|
|
||||||
void ClientInterface::updateLobby() {
|
void ClientInterface::updateLobby() {
|
||||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
//clear chat variables
|
|
||||||
//!!!clearChatInfo();
|
|
||||||
|
|
||||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
|
||||||
NetworkMessageType networkMessageType = getNextMessageType(true);
|
NetworkMessageType networkMessageType = getNextMessageType(true);
|
||||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
switch(networkMessageType)
|
switch(networkMessageType)
|
||||||
|
@@ -345,11 +345,16 @@ void ServerInterface::updateSlot(ConnectionSlotEvent *event) {
|
|||||||
bool checkForNewClients = true;
|
bool checkForNewClients = true;
|
||||||
|
|
||||||
// Safety check since we can experience a disconnect and the slot is NULL
|
// Safety check since we can experience a disconnect and the slot is NULL
|
||||||
MutexSafeWrapper safeMutexSlot(&slotAccessorMutexes[event->triggerId],intToStr(__LINE__) + "_" + intToStr(event->triggerId));
|
|
||||||
ConnectionSlot *connectionSlot = NULL;
|
ConnectionSlot *connectionSlot = NULL;
|
||||||
|
MutexSafeWrapper safeMutexSlot(NULL);
|
||||||
if(event->triggerId >= 0 && event->triggerId < GameConstants::maxPlayers) {
|
if(event->triggerId >= 0 && event->triggerId < GameConstants::maxPlayers) {
|
||||||
|
safeMutexSlot.setMutex(&slotAccessorMutexes[event->triggerId],intToStr(__LINE__) + "_" + intToStr(event->triggerId));
|
||||||
connectionSlot = slots[event->triggerId];
|
connectionSlot = slots[event->triggerId];
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] ERROR CONDITION, event->triggerId = %d\n",__FILE__,__FUNCTION__,__LINE__,event->triggerId);
|
||||||
|
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] ERROR CONDITION, event->triggerId = %d\n",__FILE__,__FUNCTION__,__LINE__,event->triggerId);
|
||||||
|
}
|
||||||
|
|
||||||
if(connectionSlot != NULL &&
|
if(connectionSlot != NULL &&
|
||||||
(gameHasBeenInitiated == false ||
|
(gameHasBeenInitiated == false ||
|
||||||
|
Reference in New Issue
Block a user