diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 6044aeca..87f22a45 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -163,7 +163,7 @@ Game::Game() : ProgramState(NULL) { inJoinGameLoading = false; for( int i=0;i 0 && lastNetworkFrameFromServer > world.getFrameCount()) { - frameWhenMessageWasReceived[index]= lastNetworkFrameFromServer-world.getFrameCount(); - + receivedTooEarlyInFrames[index]= lastNetworkFrameFromServer-world.getFrameCount(); } } - if(frameWhenMessageWasReceived[index]==-1){ + if(framesNeededToWaitForServerMessage[index]==-1){ // calc time waiting for message in milliseconds to frames int64 timeClientWaitedForLastMessage=clientInterface->getTimeClientWaitedForLastMessage(); if(timeClientWaitedForLastMessage>0){ - printf("Client waited:%d ms\n",(int)timeClientWaitedForLastMessage); + printf("world.getFrameCount():%d index %d Client waited:%d ms\n",world.getFrameCount(),index,(int)timeClientWaitedForLastMessage); framesNeededToWaitForServerMessage[index]=timeClientWaitedForLastMessage/1000/GameConstants::updateFps; + printf("ClienttimeClientWaitedForLastMessage:%d ms\n",world.getFrameCount(),(int)timeClientWaitedForLastMessage); } else { framesNeededToWaitForServerMessage[index]=0; @@ -1817,10 +1817,10 @@ void Game::update() { for( int i=0;iallowedMaxFallback){ + if(receivedTooEarlyInFrames[i]>allowedMaxFallback){ countOfMessagesReceivedTooEarly++; - if ( minimum == 0 || minimum > frameWhenMessageWasReceived[i] ){ - minimum=frameWhenMessageWasReceived[i]; + if ( minimum == 0 || minimum > receivedTooEarlyInFrames[i] ){ + minimum=receivedTooEarlyInFrames[i]; } } if(framesNeededToWaitForServerMessage[i]>0){ @@ -1847,7 +1847,7 @@ void Game::update() { if(cleanupStats==true) { // Once we decided to use the stats to do some correction, we reset/cleanup our recorded stats for( int i=0;i