improved packet loss handling

This commit is contained in:
Max-Wilhelm Bruker
2011-03-03 02:09:29 +01:00
parent 657f97680a
commit d6083a85c7
6 changed files with 26 additions and 19 deletions

View File

@@ -58,7 +58,6 @@ void Server_Game::pingClockTimeout()
{
++secondsElapsed;
QDateTime now = QDateTime::currentDateTime();
QList<ServerInfo_PlayerPing *> pingList;
QMapIterator<int, Server_Player *> playerIterator(players);
bool allPlayersInactive = true;
@@ -66,7 +65,7 @@ void Server_Game::pingClockTimeout()
Server_Player *player = playerIterator.next().value();
int pingTime;
if (player->getProtocolHandler()) {
pingTime = player->getProtocolHandler()->getLastCommandTime().secsTo(now);
pingTime = player->getProtocolHandler()->getLastCommandTime();
allPlayersInactive = false;
} else
pingTime = -1;