From 9adf8bcc625a794f0aa9c4e095c78379e18a27c9 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 28 Jan 2011 02:32:55 +0000 Subject: [PATCH] - a few more logging entries for future debugging needs --- source/glest_game/main/program.cpp | 24 +++++-------------- .../glest_game/network/client_interface.cpp | 2 +- source/glest_game/network/network_manager.cpp | 2 +- .../glest_game/network/server_interface.cpp | 4 ++-- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/source/glest_game/main/program.cpp b/source/glest_game/main/program.cpp index 88efece3..504f5abd 100644 --- a/source/glest_game/main/program.cpp +++ b/source/glest_game/main/program.cpp @@ -239,9 +239,6 @@ void Program::loopWorker() { Chrono chrono; chrono.start(); - //getWindow()->makeCurrentGl(); - //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - //render assert(programState != NULL); @@ -260,16 +257,7 @@ void Program::loopWorker() { } ProgramState *prevState = this->programState; - //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - - //if(skipRenderFrameCount <= 0) { programState->render(); - //} - //else { - // skipRenderFrameCount--; - //} - - //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d programState->render took msecs: %lld ==============> MAIN LOOP RENDERING\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); if(chrono.getMillis() > 0) chrono.start(); @@ -280,8 +268,6 @@ void Program::loopWorker() { programState->updateCamera(); } - //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d programState->render took msecs: %lld ==============> MAIN LOOP CAMERA UPDATING\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); if(chrono.getMillis() > 0) chrono.start(); @@ -317,13 +303,11 @@ void Program::loopWorker() { } updateCount++; } - //if(chrono.getMillis() >= 100) { - // skipRenderFrameCount = (chrono.getMillis() / 100); - //} if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d AFTER programState->update took msecs: %lld ==============> MAIN LOOP BODY LOGIC, updateCount = %d\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis(),updateCount); if(chrono.getMillis() > 0) chrono.start(); - //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d AFTER programState->update took msecs: %lld ==============> MAIN LOOP BODY LOGIC, updateCount = %d\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis(),updateCount); + if(chrono.getMillis() > 0) chrono.start(); if(prevState == this->programState) { //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); @@ -336,6 +320,10 @@ void Program::loopWorker() { if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d programState->render took msecs: %lld ==============> MAIN LOOP TICKING\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); if(chrono.getMillis() > 0) chrono.start(); + + if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d programState->render took msecs: %lld ==============> MAIN LOOP TICKING\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); + if(chrono.getMillis() > 0) chrono.start(); + } //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 5ca03734..218db0d0 100755 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -125,7 +125,7 @@ void ClientInterface::update() { } double lastSendElapsed = difftime(time(NULL),lastNetworkCommandListSendTime); - if(lastNetworkCommandListSendTime > 0) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] lastSendElapsed = %f\n",__FILE__,__FUNCTION__,__LINE__,lastSendElapsed); + if(lastSendElapsed > 0) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] lastSendElapsed = %f, networkMessageCommandList.getCommandCount() = %d, requestedCommands.empty() = %d\n",__FILE__,__FUNCTION__,__LINE__,lastSendElapsed,networkMessageCommandList.getCommandCount(),requestedCommands.empty()); if(networkMessageCommandList.getCommandCount() > 0 || (lastNetworkCommandListSendTime > 0 && lastSendElapsed >= ClientInterface::maxNetworkCommandListSendTimeWait)) { diff --git a/source/glest_game/network/network_manager.cpp b/source/glest_game/network/network_manager.cpp index eb6d7b9f..ae30edcb 100644 --- a/source/glest_game/network/network_manager.cpp +++ b/source/glest_game/network/network_manager.cpp @@ -94,7 +94,7 @@ GameNetworkInterface* NetworkManager::getGameNetworkInterface(bool throwErrorOnN } ServerInterface* NetworkManager::getServerInterface(bool throwErrorOnNull) { - SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] this->networkRole = %d gameNetworkInterface [%p]\n",__FILE__,__FUNCTION__,__LINE__,this->networkRole,gameNetworkInterface); + //SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] this->networkRole = %d gameNetworkInterface [%p]\n",__FILE__,__FUNCTION__,__LINE__,this->networkRole,gameNetworkInterface); //printf("==========] GET gameNetworkInterface (server) [%p]\n",gameNetworkInterface); if(throwErrorOnNull) { diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 93fd03da..04410dce 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -793,7 +793,7 @@ void ServerInterface::updateKeyframe(int frameCount) { Chrono chrono; chrono.start(); currentFrameCount = frameCount; - SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] currentFrameCount = %d\n",__FILE__,__FUNCTION__,__LINE__,currentFrameCount); + SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] currentFrameCount = %d, requestedCommands.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,currentFrameCount,requestedCommands.size()); NetworkMessageCommandList networkMessageCommandList(frameCount); while(requestedCommands.empty() == false) { if(networkMessageCommandList.addCommand(&requestedCommands.back())){ @@ -1471,7 +1471,7 @@ void ServerInterface::simpleTask(BaseThread *callingThread) { } } - SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); }