Skip to content

Commit 5f9726f

Browse files
authored
Use hard disconnect instead of ClientKick in timeout (#320)
2 parents cf5ebcb + fcd4089 commit 5f9726f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/Client.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class TClient final {
128128
std::string mRole;
129129
std::string mDID;
130130
int mID = -1;
131-
std::chrono::time_point<std::chrono::high_resolution_clock> mLastPingTime;
131+
std::chrono::time_point<std::chrono::high_resolution_clock> mLastPingTime = std::chrono::high_resolution_clock::now();
132132
};
133133

134134
std::optional<std::weak_ptr<TClient>> GetClient(class TServer& Server, int ID);

src/TPPSMonitor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void TPPSMonitor::operator()() {
7676
return true;
7777
});
7878
for (auto& ClientToKick : TimedOutClients) {
79-
Network().ClientKick(*ClientToKick, "Timeout (no ping for way too long)");
79+
ClientToKick->Disconnect("Timeout");
8080
}
8181
TimedOutClients.clear();
8282
if (C == 0 || mInternalPPS == 0) {

0 commit comments

Comments
 (0)