From bc23856add348060b600fd0f9cbccfd79b744af5 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 20 Mar 2025 21:06:46 +0800 Subject: perf: directly kick instead of calling function in the session(killing it's self?) --- src/session.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/session.cpp') diff --git a/src/session.cpp b/src/session.cpp index 50eaff4..10c549b 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -127,7 +127,7 @@ void CSession::run() { } else log(LOG, "Client {} exited without even registering", m_ip); - g_pSessionManager->removeSession(self); + g_pSessionManager->kick(self); } bool CSession::registerSession() { @@ -205,9 +205,3 @@ const std::string &CSession::getName() const { void CSession::setSelf(std::pair> *self) { this->self = self; } - -void CSession::onKick(const std::string &reason, const bool &kill) { - if (!reason.empty()) - write(reason); - g_pSessionManager->removeSession(self, kill); -} -- cgit v1.2.3