From de68fc759d50c40e09045494af141b7df0c2b7af Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 25 May 2013 18:22:36 +0000 Subject: [PATCH] comment out some world synch logging --- source/glest_game/ai/path_finder.cpp | 180 +++++++++---------- source/glest_game/type_instances/faction.cpp | 28 +-- source/glest_game/world/unit_updater.cpp | 124 ++++++------- 3 files changed, 166 insertions(+), 166 deletions(-) diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index fc2ca74e..7170cabc 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -159,11 +159,11 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu //printf("Unit Pathfind Unit [%d - %s] from = %s to = %s frameIndex = %d\n",unit->getId(),unit->getType()->getName().c_str(),unit->getPos().getString().c_str(),finalPos.getString().c_str(),frameIndex); if(frameIndex >= 0) { - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[findPath] "); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[findPath] "); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } clearUnitPrecache(unit); } @@ -177,11 +177,11 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu snprintf(szBuf,8096,"canUnitsPathfind() == false"); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"canUnitsPathfind() == false"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"canUnitsPathfind() == false"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return tsBlocked; } @@ -225,11 +225,11 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu unit->setCurrentUnitTitle(szBuf); } - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"return tsArrived"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"return tsArrived"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return tsArrived; } @@ -253,11 +253,11 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu } - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"return tsMoving"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"return tsMoving"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return tsMoving; } @@ -272,11 +272,11 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu unit->setTargetPos(pos); } - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"return tsMoving"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"return tsMoving"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return tsMoving; } @@ -295,11 +295,11 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu snprintf(szBuf,8096,"path->isStuck() == true unit->getLastStuckPos() [%s] finalPos [%s] path->getBlockCount() [%d] tolerance: %d",unit->getLastStuckPos().getString().c_str(),finalPos.getString().c_str(),path->getBlockCount(),unit->isLastStuckFrameWithinCurrentFrameTolerance()); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"path->isStuck() == true unit->getLastStuckPos() [%s] finalPos [%s] path->getBlockCount() [%d] tolerance: %d",unit->getLastStuckPos().getString().c_str(),finalPos.getString().c_str(),path->getBlockCount(),unit->isLastStuckFrameWithinCurrentFrameTolerance()); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"path->isStuck() == true unit->getLastStuckPos() [%s] finalPos [%s] path->getBlockCount() [%d] tolerance: %d",unit->getLastStuckPos().getString().c_str(),finalPos.getString().c_str(),path->getBlockCount(),unit->isLastStuckFrameWithinCurrentFrameTolerance()); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } //printf("$$$$ Unit STILL BLOCKED for [%d - %s]\n",unit->getId(),unit->getFullName().c_str()); return tsBlocked; @@ -322,11 +322,11 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu snprintf(szBuf,8096,"maxNodeCount: %d",maxNodeCount); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"maxNodeCount: %d",maxNodeCount); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"maxNodeCount: %d",maxNodeCount); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } } @@ -346,19 +346,19 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu snprintf(szBuf,8096,"calling aStar()"); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"calling aStar()"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"calling aStar()"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } ts = aStar(unit, finalPos, false, frameIndex, maxNodeCount,&searched_node_count); - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"called aStar() ts: %d",ts); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"called aStar() ts: %d",ts); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } //post actions switch(ts) { @@ -1027,20 +1027,20 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout snprintf(szBuf,8096,"return factions[unitFactionIndex].precachedTravelState[unit->getId()];"); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"return factions[unitFactionIndex].precachedTravelState[unit->getId()];"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"return factions[unitFactionIndex].precachedTravelState[unit->getId()];"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return factions[unitFactionIndex].precachedTravelState[unit->getId()]; } else { - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"clearUnitPrecache(unit);"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"clearUnitPrecache(unit);"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } clearUnitPrecache(unit); } @@ -1058,11 +1058,11 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout snprintf(szBuf,8096,"return factions[unitFactionIndex].precachedTravelState[unit->getId()];"); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"return factions[unitFactionIndex].precachedTravelState[unit->getId()];"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"return factions[unitFactionIndex].precachedTravelState[unit->getId()];"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return factions[unitFactionIndex].precachedTravelState[unit->getId()]; } @@ -1070,11 +1070,11 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout } } else { - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"clearUnitPrecache(unit);"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"clearUnitPrecache(unit);"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } clearUnitPrecache(unit); @@ -1181,11 +1181,11 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout snprintf(szBuf,8096,"return ts: %d",ts); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"return ts: %d",ts); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"return ts: %d",ts); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return ts; } @@ -1253,11 +1253,11 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout snprintf(szBuf,8096,"return ts: %d",ts); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"return ts: %d",ts); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"return ts: %d",ts); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return ts; } @@ -1439,11 +1439,11 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout snprintf(szBuf,8096,"calling aStar()"); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"calling aStar()"); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"calling aStar()"); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return aStar(unit, targetPos, false, frameIndex, pathFindNodesAbsoluteMax); } @@ -1455,11 +1455,11 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout snprintf(szBuf,8096,"nodeLimitReached: %d",nodeLimitReached); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"nodeLimitReached: %d",nodeLimitReached); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"nodeLimitReached: %d",nodeLimitReached); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } } @@ -1643,11 +1643,11 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout snprintf(szBuf,8096,"return ts: %d",ts); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"return ts: %d",ts); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"return ts: %d",ts); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } return ts; } diff --git a/source/glest_game/type_instances/faction.cpp b/source/glest_game/type_instances/faction.cpp index 9d6856b3..2043d3d8 100644 --- a/source/glest_game/type_instances/faction.cpp +++ b/source/glest_game/type_instances/faction.cpp @@ -392,20 +392,20 @@ void FactionThread::execute() { if(minorDebugPerformance && (chrono.getMillis() - elapsed2) >= 1) printf("Faction [%d - %s] #2-unit threaded updates on frame: %d for [%d] unit # %d, unitCount = %d, took [%lld] msecs\n",faction->getStartLocationIndex(),faction->getType()->getName().c_str(),currentTriggeredFrameIndex,faction->getUnitPathfindingListCount(),j,unitCount,(long long int)chrono.getMillis() - elapsed2); } - else { - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) { - int updateProgressValue = unit->getUpdateProgress(); - int speed = unit->getCurrSkill()->getTotalSpeed(unit->getTotalUpgrade()); - int df = unit->getDiagonalFactor(); - int hf = unit->getHeightFactor(); - bool changedActiveCommand = unit->isChangedActiveCommand(); - - char szBuf[8096]=""; - snprintf(szBuf,8096,"unit->needToUpdate() returned: %d updateProgressValue: %d speed: %d changedActiveCommand: %d df: %d hf: %d",update,updateProgressValue,speed,changedActiveCommand,df,hf); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } - - } +// else { +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) { +// int updateProgressValue = unit->getUpdateProgress(); +// int speed = unit->getCurrSkill()->getTotalSpeed(unit->getTotalUpgrade()); +// int df = unit->getDiagonalFactor(); +// int hf = unit->getHeightFactor(); +// bool changedActiveCommand = unit->isChangedActiveCommand(); +// +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"unit->needToUpdate() returned: %d updateProgressValue: %d speed: %d changedActiveCommand: %d df: %d hf: %d",update,updateProgressValue,speed,changedActiveCommand,df,hf); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } +// +// } } if(minorDebugPerformance && chrono.getMillis() >= 1) printf("Faction [%d - %s] threaded updates on frame: %d for [%d] units took [%lld] msecs\n",faction->getStartLocationIndex(),faction->getType()->getName().c_str(),currentTriggeredFrameIndex,faction->getUnitPathfindingListCount(),(long long int)chrono.getMillis()); diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 38e66eb0..4f82ffcc 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -356,11 +356,11 @@ void UnitUpdater::updateUnitCommand(Unit *unit, int frameIndex) { void UnitUpdater::updateStop(Unit *unit, int frameIndex) { // Nothing to do if(frameIndex >= 0) { - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateStop]"); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateStop]"); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } clearUnitPrecache(unit); return; } @@ -441,11 +441,11 @@ void UnitUpdater::updateMove(Unit *unit, int frameIndex) { snprintf(szBuf,8096,"[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); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateMove] pos [%s] unit [%d - %s] cmd [%s]",pos.getString().c_str(),unit->getId(),unit->getFullName().c_str(),command->toString().c_str()); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateMove] pos [%s] unit [%d - %s] cmd [%s]",pos.getString().c_str(),unit->getId(),unit->getFullName().c_str(),command->toString().c_str()); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); @@ -484,11 +484,11 @@ void UnitUpdater::updateMove(Unit *unit, int frameIndex) { snprintf(szBuf,8096,"[updateMove] tsValue [%d]",tsValue); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateMove] tsValue [%d]",tsValue); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateMove] tsValue [%d]",tsValue); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld --------------------------- [END OF METHOD] ---------------------------\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); } @@ -503,11 +503,11 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { snprintf(szBuf,8096,"[updateAttack]"); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateAttack]"); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateAttack]"); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } Chrono chrono; if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled) chrono.start(); @@ -591,11 +591,11 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { snprintf(szBuf,8096,"[updateAttack] pos [%s] unit->getPos() [%s]",pos.getString().c_str(),unit->getPos().getString().c_str()); unit->logSynchData(__FILE__,__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateAttack] pos [%s] unit->getPos() [%s]",pos.getString().c_str(),unit->getPos().getString().c_str()); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateAttack] pos [%s] unit->getPos() [%s]",pos.getString().c_str(),unit->getPos().getString().c_str()); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); @@ -693,11 +693,11 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { } } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateAttack] tsValue [%d]",tsValue); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateAttack] tsValue [%d]",tsValue); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); } @@ -840,11 +840,11 @@ void UnitUpdater::updateBuild(Unit *unit, int frameIndex) { snprintf(szBuf,8096,"[updateBuild]"); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateBuild]"); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateBuild]"); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } Chrono chrono; if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled) chrono.start(); @@ -879,12 +879,12 @@ void UnitUpdater::updateBuild(Unit *unit, int frameIndex) { unit->getPos().getString().c_str(),command->getPos().getString().c_str(),buildPos.getString().c_str()); unit->logSynchData(__FILE__,__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateBuild] unit->getPos() [%s] command->getPos() [%s] buildPos [%s]", - unit->getPos().getString().c_str(),command->getPos().getString().c_str(),buildPos.getString().c_str()); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateBuild] unit->getPos() [%s] command->getPos() [%s] buildPos [%s]", +// unit->getPos().getString().c_str(),command->getPos().getString().c_str(),buildPos.getString().c_str()); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } tsValue = pathFinder->findPath(unit, buildPos, NULL, frameIndex); @@ -893,11 +893,11 @@ void UnitUpdater::updateBuild(Unit *unit, int frameIndex) { snprintf(szBuf,8096,"[updateBuild] tsValue: %d",tsValue); unit->logSynchData(__FILE__,__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateBuild] tsValue: %d",tsValue); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateBuild] tsValue: %d",tsValue); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } } break; @@ -1169,11 +1169,11 @@ void UnitUpdater::updateHarvest(Unit *unit, int frameIndex) { snprintf(szBuf,8096,"[updateHarvest]"); unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateHarvest]"); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateHarvest]"); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } Chrono chrono; if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled) chrono.start(); @@ -1264,11 +1264,11 @@ void UnitUpdater::updateHarvest(Unit *unit, int frameIndex) { unit->setLastHarvestResourceTarget(NULL); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateHarvest]"); - unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateHarvest]"); +// unit->logSynchDataThreaded(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); +// } canHarvestDestPos = (map->getSurfaceCell(Map::toSurfCoords(targetPos)) != NULL && map->getSurfaceCell(Map::toSurfCoords(targetPos))->getResource() != NULL && map->getSurfaceCell(Map::toSurfCoords(targetPos))->getResource()->getType() != NULL); @@ -1321,12 +1321,12 @@ void UnitUpdater::updateHarvest(Unit *unit, int frameIndex) { unit->getPos().getString().c_str(),command->getPos().getString().c_str()); unit->logSynchData(__FILE__,__LINE__,szBuf); } - else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[updateHarvest] unit->getPos() [%s] command->getPos() [%s]", - unit->getPos().getString().c_str(),command->getPos().getString().c_str()); - unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); - } +// else if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex >= 0) { +// char szBuf[8096]=""; +// snprintf(szBuf,8096,"[updateHarvest] unit->getPos() [%s] command->getPos() [%s]", +// unit->getPos().getString().c_str(),command->getPos().getString().c_str()); +// unit->logSynchDataThreaded(__FILE__,__LINE__,szBuf); +// } //if not continue walking bool wasStuck = false;