diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-20 21:06:46 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-21 11:18:14 +0800 |
| commit | bc23856add348060b600fd0f9cbccfd79b744af5 (patch) | |
| tree | 64a3d5ebe3b5bf21fcba1e18b1685e2fa852ab56 /src/session.cpp | |
| parent | e23bd1552448f444ca0f97fcfd5c68016b2e7eb6 (diff) | |
perf: directly kick instead of calling function in the session(killing it's self?)
Diffstat (limited to 'src/session.cpp')
| -rw-r--r-- | src/session.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
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<std::jthread, std::shared_ptr<CSession>> *self) { this->self = self; } - -void CSession::onKick(const std::string &reason, const bool &kill) { - if (!reason.empty()) - write(reason); - g_pSessionManager->removeSession(self, kill); -} |
