diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 10ac69ed8..94d06a248 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1715,7 +1715,28 @@ void Unit::exploreCells() { void Unit::logSynchData(string file,int line,string source) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) { - char szBuf[1024]=""; + char szBuf[4096]=""; + + sprintf(szBuf, + "FrameCount [%d] Unit = %d [%s][%s] pos = %s, lastPos = %s, targetPos = %s, targetVec = %s, meetingPos = %s, progress [%f], progress2 [%d]\nUnit Path [%s]\n", + getFrameCount(), + id, + getFullName().c_str(), + faction->getType()->getName().c_str(), + //getDesc().c_str(), + pos.getString().c_str(), + lastPos.getString().c_str(), + targetPos.getString().c_str(), + targetVec.getString().c_str(), + meetingPos.getString().c_str(), +// lastRotation, +// targetRotation, +// rotation, + progress, + progress2, + (unitPath != NULL ? unitPath->toString().c_str() : "NULL")); + +/* sprintf(szBuf, "FrameCount [%d] Unit = %d [%s][%s] pos = %s, lastPos = %s, targetPos = %s, targetVec = %s, meetingPos = %s, lastRotation [%f], targetRotation [%f], rotation [%f], progress [%f], progress2 [%d]\nUnit Path [%s]\n", getFrameCount(), @@ -1734,7 +1755,7 @@ void Unit::logSynchData(string file,int line,string source) { progress, progress2, (unitPath != NULL ? unitPath->toString().c_str() : "NULL")); - +*/ if( lastSynchDataString != string(szBuf) || lastFile != file || lastLine != line || diff --git a/source/shared_lib/sources/platform/common/simple_threads.cpp b/source/shared_lib/sources/platform/common/simple_threads.cpp index fa0a7b660..04748bc1c 100644 --- a/source/shared_lib/sources/platform/common/simple_threads.cpp +++ b/source/shared_lib/sources/platform/common/simple_threads.cpp @@ -206,6 +206,10 @@ void LogFileThread::addLogEntry(SystemFlags::DebugType type, string logEntry) { entry.entry = logEntry; entry.entryDateTime = time(NULL); logList.push_back(entry); + + if(logList.size() >= 100000) { + saveToDisk(false); + } } bool LogFileThread::checkSaveCurrentLogBufferToDisk() {