Use hard disconnect instead of ClientKick in timeout (#320)

This commit is contained in:
Lion 2024-05-11 13:00:25 +02:00 committed by GitHub
commit 5f9726f10f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ private:
std::string mRole;
std::string mDID;
int mID = -1;
std::chrono::time_point<std::chrono::high_resolution_clock> mLastPingTime;
std::chrono::time_point<std::chrono::high_resolution_clock> mLastPingTime = std::chrono::high_resolution_clock::now();
};
std::optional<std::weak_ptr<TClient>> GetClient(class TServer& Server, int ID);

View File

@ -76,7 +76,7 @@ void TPPSMonitor::operator()() {
return true;
});
for (auto& ClientToKick : TimedOutClients) {
Network().ClientKick(*ClientToKick, "Timeout (no ping for way too long)");
ClientToKick->Disconnect("Timeout");
}
TimedOutClients.clear();
if (C == 0 || mInternalPPS == 0) {