- added more verbose info when tracking network CRC

This commit is contained in:
SoftCoder 2014-02-01 10:27:11 -08:00
parent 78ed6d4601
commit c7a2040fdc
3 changed files with 37 additions and 8 deletions

View File

@ -2241,10 +2241,31 @@ int64 Unit::getUpdatedProgress(int64 currentProgress, int64 updateFPS, int64 spe
}
if(isNetworkCRCEnabled() == true) {
float height = map->getCell(pos)->getHeight();
float airHeight = game->getWorld()->getTileset()->getAirHeight();
int cellUnitHeight = -1;
int cellObjectHeight = -1;
Unit *unit = map->getCell(pos)->getUnit(fLand);
if(unit != NULL && unit->getType()->getHeight() > airHeight) {
cellUnitHeight = unit->getType()->getHeight();
}
else {
SurfaceCell *sc = map->getSurfaceCell(map->toSurfCoords(pos));
if(sc != NULL && sc->getObject() != NULL && sc->getObject()->getType() != NULL) {
if(sc->getObject()->getType()->getHeight() > airHeight) {
cellObjectHeight = sc->getObject()->getType()->getHeight();
}
}
}
char szBuf[8096]="";
snprintf(szBuf,8095,"currentProgress = " MG_I64_SPECIFIER " updateFPS = " MG_I64_SPECIFIER " speed = " MG_I64_SPECIFIER " diagonalFactor = " MG_I64_SPECIFIER " heightFactor = " MG_I64_SPECIFIER " speedDenominator = " MG_I64_SPECIFIER " progressIncrease = " MG_I64_SPECIFIER " [" MG_I64_SPECIFIER "]",
currentProgress,updateFPS,speed,diagonalFactor,heightFactor,speedDenominator,progressIncrease,((speed * diagonalFactor * heightFactor) / speedDenominator));
snprintf(szBuf,8095,"currentProgress = " MG_I64_SPECIFIER " updateFPS = " MG_I64_SPECIFIER " speed = " MG_I64_SPECIFIER " diagonalFactor = " MG_I64_SPECIFIER " heightFactor = " MG_I64_SPECIFIER " speedDenominator = " MG_I64_SPECIFIER " progressIncrease = " MG_I64_SPECIFIER " [" MG_I64_SPECIFIER "] height [%f] airHeight [%f] cellUnitHeight [%d] cellObjectHeight [%d]",
currentProgress,updateFPS,speed,diagonalFactor,heightFactor,speedDenominator,progressIncrease,((speed * diagonalFactor * heightFactor) / speedDenominator),height,airHeight,cellUnitHeight,cellObjectHeight);
networkCRCLogInfo = szBuf;
//printf("%s\n",szBuf);
}
newProgress += progressIncrease;
@ -4068,10 +4089,10 @@ void Unit::startDamageParticles() {
checkCustomizedParticleTriggers(false);
}
void Unit::setTargetVec(const Vec3f &targetVec) {
this->targetVec= targetVec;
logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
}
//void Unit::setTargetVec(const Vec3f &targetVec) {
// this->targetVec= targetVec;
// logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
//}
void Unit::setMeetingPos(const Vec2i &meetingPos) {
this->meetingPos= meetingPos;

View File

@ -627,7 +627,7 @@ public:
void refreshPos();
void setTargetPos(const Vec2i &targetPos);
void setTarget(const Unit *unit);
void setTargetVec(const Vec3f &targetVec);
//void setTargetVec(const Vec3f &targetVec);
void setMeetingPos(const Vec2i &meetingPos);
void setVisible(const bool visible);
inline bool getVisible() const { return visible; }

View File

@ -38,6 +38,7 @@ IF(BUILD_MEGAGLEST_TESTS)
SET(DIRS_WITH_SRC
./
shared_lib/graphics
shared_lib/streflop
shared_lib/util
shared_lib/xml)
@ -60,7 +61,14 @@ IF(BUILD_MEGAGLEST_TESTS)
${GLEST_LIB_INCLUDE_ROOT}xml/rapidxml
${GLEST_LIB_INCLUDE_ROOT}glew
${GLEST_LIB_INCLUDE_ROOT}lua
${GLEST_LIB_INCLUDE_ROOT}map)
${GLEST_LIB_INCLUDE_ROOT}map
${PROJECT_SOURCE_DIR}/source/glest_game/graphics
${PROJECT_SOURCE_DIR}/source/glest_game/world
${PROJECT_SOURCE_DIR}/source/glest_game/sound
${PROJECT_SOURCE_DIR}/source/glest_game/type_instances
${PROJECT_SOURCE_DIR}/source/glest_game/types
)
IF(WANT_STREFLOP)
SET(GLEST_LIB_INCLUDE_DIRS