Skip to content

Commit

Permalink
Use hard disconnect instead of ClientKick in timeout (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
lionkor authored May 11, 2024
2 parents cf5ebcb + fcd4089 commit 5f9726f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class TClient final {
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);
2 changes: 1 addition & 1 deletion src/TPPSMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5f9726f

Please sign in to comment.