diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index f41f3d73..4a55e26b 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -325,12 +325,7 @@ void PathFinder::processNode(Unit *unit, Node *node,const Vec2i finalPos, int i, sucNode->prev= node; sucNode->next= NULL; sucNode->exploredCell= map->getSurfaceCell(Map::toSurfCoords(sucPos))->isExplored(unit->getTeam()); - std::map::iterator iterFind = openNodesList.find(sucNode->heuristic); - if(iterFind == openNodesList.end()) { - openNodesList[sucNode->heuristic].reserve(PathFinder::pathFindNodesMax / 3); - iterFind = openNodesList.find(sucNode->heuristic); - } - iterFind->second.push_back(sucNode); + openNodesList[sucNode->heuristic].push_back(sucNode); openPosList[sucNode->pos] = true; } else { @@ -489,13 +484,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout firstNode->pos= unitPos; firstNode->heuristic= heuristic(unitPos, finalPos); firstNode->exploredCell= true; - - std::map::iterator iterFind = openNodesList.find(firstNode->heuristic); - if(iterFind == openNodesList.end()) { - openNodesList[firstNode->heuristic].reserve(PathFinder::pathFindNodesMax / 3); - iterFind = openNodesList.find(firstNode->heuristic); - } - iterFind->second.push_back(firstNode); + openNodesList[firstNode->heuristic].push_back(firstNode); openPosList[firstNode->pos] = true; //b) loop @@ -527,12 +516,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout //b4) move this node from closedNodes to openNodes //add all succesors that are not in closedNodes or openNodes to openNodes - std::map::iterator iterFind = closedNodesList.find(node->heuristic); - if(iterFind == closedNodesList.end()) { - closedNodesList[node->heuristic].reserve(PathFinder::pathFindNodesMax / 3); - iterFind = closedNodesList.find(node->heuristic); - } - iterFind->second.push_back(node); + closedNodesList[node->heuristic].push_back(node); openPosList[node->pos] = true; int tryDirection = random.randRange(0,3); diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 3d082c6c..dc5915bf 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -34,10 +34,10 @@ namespace Glest { namespace Game { double maxFrameCountLagAllowed = 25; double maxClientLagTimeAllowed = 30; -double maxFrameCountLagAllowedEver = 60; +double maxFrameCountLagAllowedEver = 65; double warnFrameCountLagPercent = 0.65; double LAG_CHECK_GRACE_PERIOD = 15; -double MAX_CLIENT_WAIT_SECONDS_FOR_PAUSE = 1; +double MAX_CLIENT_WAIT_SECONDS_FOR_PAUSE = 2; const int MAX_SLOT_THREAD_WAIT_TIME = 3; const int MASTERSERVER_HEARTBEAT_GAME_STATUS_SECONDS = 30; @@ -1170,17 +1170,18 @@ bool ServerInterface::launchGame(const GameSettings *gameSettings) { } if(bOkToStart == true) { -/* - SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - for(int i= 0; exitServer == false && i < GameConstants::maxPlayers; ++i) { - MutexSafeWrapper safeMutexSlot(&slotAccessorMutexes[i],string(__FILE__) + "_" + intToStr(__LINE__) + "_" + intToStr(i)); - ConnectionSlot *connectionSlot= slots[i]; - if(connectionSlot != NULL && - connectionSlot->isConnected()) { - connectionSlot->getSocket()->setBlock(true); + bool useInGameBlockingClientSockets = Config::getInstance().getBool("EnableInGameBlockingSockets","false"); + if(useInGameBlockingClientSockets == true) { + SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + for(int i= 0; i < GameConstants::maxPlayers; ++i) { + MutexSafeWrapper safeMutexSlot(&slotAccessorMutexes[i],string(__FILE__) + "_" + intToStr(__LINE__) + "_" + intToStr(i)); + ConnectionSlot *connectionSlot= slots[i]; + if(connectionSlot != NULL && connectionSlot->isConnected()) { + connectionSlot->getSocket()->setBlock(true); + } } } -*/ + SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] needToRepublishToMasterserver = %d\n",__FILE__,__FUNCTION__,__LINE__,needToRepublishToMasterserver); serverSocket.stopBroadCastThread(); diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 96caa575..5931c99b 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -339,7 +339,7 @@ void UnitUpdater::updateMove(Unit *unit) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) { char szBuf[4096]=""; - sprintf(szBuf,"[updateMove] pos [%s] cmd [%s]",pos.getString().c_str(),command->toString().c_str()); + sprintf(szBuf,"[updateMove] pos [%s] unit [%d - %s] cmd [%s]",pos.getString().c_str(),unit->getId(),unit->getFullName().c_str(),command->toString().c_str()); unit->logSynchData(__FILE__,__LINE__,szBuf); }