From 2f3433688fd6cea365b566856b291650fa385447 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 20 May 2013 21:52:36 +0000 Subject: [PATCH] more logs to track out of synch --- source/glest_game/ai/path_finder.cpp | 7 ++----- source/glest_game/world/unit_updater.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index 01a73527..72c31118 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -111,11 +111,6 @@ void PathFinder::clearCaches() { factions[i].precachedPath.clear(); factions[i].badCellList.clear(); } - - if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) { - char szBuf[8096]=""; - snprintf(szBuf,8096,"[clearCaches]"); - } } void PathFinder::clearUnitPrecache(Unit *unit) { @@ -149,6 +144,7 @@ void PathFinder::removeUnitPrecache(Unit *unit) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) { char szBuf[8096]=""; snprintf(szBuf,8096,"[removeUnitPrecache] clearTravelState: %d clearPath: %d",clearTravelState,clearPath); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } } } @@ -965,6 +961,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[clearUnitPrecache]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } } diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 81e103dc..901dee7f 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -362,6 +362,7 @@ void UnitUpdater::updateStop(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateStop]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } Chrono chrono; @@ -478,6 +479,7 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateAttack]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } Chrono chrono; @@ -489,6 +491,7 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateAttack]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } return; @@ -499,6 +502,7 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateAttack]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } return; @@ -515,6 +519,7 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateAttack]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } } return; @@ -536,6 +541,7 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateAttack]"); + unit->logSynchData(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()); @@ -589,6 +595,7 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateAttack]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } } else { @@ -650,6 +657,7 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateAttack]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } } @@ -673,6 +681,7 @@ void UnitUpdater::updateAttackStopped(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateAttackStopped]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } Chrono chrono; @@ -1577,6 +1586,7 @@ void UnitUpdater::updateRepair(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateRepair]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } Chrono chrono; @@ -1890,6 +1900,7 @@ void UnitUpdater::updateProduce(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateProduce]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } Chrono chrono; @@ -1966,6 +1977,7 @@ void UnitUpdater::updateUpgrade(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateUpgrade]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } Chrono chrono; @@ -2002,6 +2014,7 @@ void UnitUpdater::updateMorph(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; snprintf(szBuf,8096,"[updateMorph]"); + unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf); } Chrono chrono;