diff --git a/src/TPPSMonitor.cpp b/src/TPPSMonitor.cpp index e079266..a92f0c9 100644 --- a/src/TPPSMonitor.cpp +++ b/src/TPPSMonitor.cpp @@ -37,12 +37,13 @@ void TPPSMonitor::operator()() { C++; V += c->GetCarCount(); } - // kick on "no ping" - if (c->SecondsSinceLastPing() > 10 && c->IsSynced()) { - TimedOutClients.push_back(c); - } else if (!c->IsSynced()) { + if (!c->IsSynced() || c->IsSyncing()) { c->UpdatePingTime(); } + // kick on "no ping" + if (c->SecondsSinceLastPing() > 10 && c->IsSynced() && !c->IsSyncing()) { + TimedOutClients.push_back(c); + } } return true; }); diff --git a/src/TServer.cpp b/src/TServer.cpp index 2664415..5ac21c6 100644 --- a/src/TServer.cpp +++ b/src/TServer.cpp @@ -76,6 +76,8 @@ void TServer::GlobalParser(const std::weak_ptr& Client, std::string Pac return; } auto LockedClient = Client.lock(); + // FIXME: this should not be needed here + LockedClient->UpdatePingTime(); std::any Res; char Code = Packet.at(0); @@ -96,7 +98,6 @@ void TServer::GlobalParser(const std::weak_ptr& Client, std::string Pac case 'p': Network.Respond(*LockedClient, ("p"), false); Network.UpdatePlayer(*LockedClient); - LockedClient->UpdatePingTime(); return; case 'O': if (Packet.length() > 1000) {