- added more crc logging to detect oos location

This commit is contained in:
Mark Vejvoda 2013-10-17 02:49:25 +00:00
parent 37a53c114a
commit fb276d1dd7
4 changed files with 9 additions and 3 deletions

View File

@ -2320,6 +2320,7 @@ void Faction::addCRC_DetailsForWorldFrame(int worldFrameCount,bool isNetworkServ
for(unsigned int i = 0; i < units.size(); ++i) {
Unit *unit = units[i];
unit->getRandom()->clearLastCaller();
unit->clearNetworkCRCDecHpList();
}

View File

@ -4242,7 +4242,9 @@ std::string Unit::toString(bool crcMode) const {
result += "inBailOutAttempt = " + intToStr(inBailOutAttempt) + "\n";
result += "random = " + intToStr(random.getLastNumber()) + "\n";
result += "randomlastCaller = " + random.getLastCaller() + "\n";
if(this->random.getLastCaller() != "") {
result += "randomlastCaller = " + random.getLastCaller() + "\n";
}
result += "pathFindRefreshCellCount = " + intToStr(pathFindRefreshCellCount) + "\n";
result += "lastStuckFrame = " + uIntToStr(lastStuckFrame) + "\n";

View File

@ -48,6 +48,7 @@ public:
std::string getLastCaller() const;
void clearLastCaller() { lastCaller.clear(); }
//void clearLastCaller() { }
void addLastCaller(std::string text) { lastCaller.push_back(text); }
};
}}//end namespace

View File

@ -40,7 +40,9 @@ void RandomGen::init(int seed){
}
int RandomGen::rand(string lastCaller) {
this->lastCaller.push_back(lastCaller);
if(lastCaller != "") {
this->lastCaller.push_back(lastCaller);
}
this->lastNumber = (a*lastNumber + b) % m;
return lastNumber;
}
@ -49,7 +51,7 @@ std::string RandomGen::getLastCaller() const {
std::string result = "";
if(lastCaller.empty() == false) {
for(unsigned int index = 0; index < lastCaller.size(); ++index) {
result += lastCaller[index] + " ";
result += lastCaller[index] + "|";
}
}
return result;