mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
improved packet loss handling
This commit is contained in:
parent
657f97680a
commit
d6083a85c7
6 changed files with 26 additions and 19 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue