diff --git a/source/glest_game/network/connection_slot.cpp b/source/glest_game/network/connection_slot.cpp index a6d4ca07..4364c901 100644 --- a/source/glest_game/network/connection_slot.cpp +++ b/source/glest_game/network/connection_slot.cpp @@ -498,6 +498,8 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { bool gotTextMsg = true; bool gotCellMarkerMsg = true; bool waitForLaggingClient = false; + bool waitedForLaggingClient = false; + for(;waitForLaggingClient == true || (this->hasDataToRead() == true && (gotTextMsg == true || gotCellMarkerMsg == true));) { @@ -1134,8 +1136,8 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { //!!! double LAG_CHECK_GRACE_PERIOD = 15; - double maxFrameCountLagAllowed = 7; - double maxClientLagTimeAllowed = 7; + double maxFrameCountLagAllowed = 10; + double maxClientLagTimeAllowed = 8; if(this->serverInterface->getGameStartTime() > 0 && difftime(time(NULL),this->serverInterface->getGameStartTime()) >= LAG_CHECK_GRACE_PERIOD) { @@ -1147,14 +1149,21 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { // New lag check if((maxFrameCountLagAllowed > 0 && clientLagCount > maxFrameCountLagAllowed) || (maxClientLagTimeAllowed > 0 && clientLagTime > maxClientLagTimeAllowed)) { - waitForLaggingClient = true; - printf("*TESTING*: Waiting for lagging client playerIndex = %d clientLagCount = %f [%f]\n",playerIndex,clientLagCount,clientLagTime); + waitForLaggingClient = true; + if(waitedForLaggingClient == false) { + waitedForLaggingClient = true; + printf("*TESTING*: START Waiting for lagging client playerIndex = %d clientLagCount = %f [%f]\n",playerIndex,clientLagCount,clientLagTime); + } } } } } + if(waitedForLaggingClient == true) { + printf("*TESTING*: FINISHED Waiting for lagging client playerIndex = %d\n",playerIndex); + } + //if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis()); validateConnection();