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/sessionManager.hpp | |
| parent | e23bd1552448f444ca0f97fcfd5c68016b2e7eb6 (diff) | |
perf: directly kick instead of calling function in the session(killing it's self?)
Diffstat (limited to 'src/sessionManager.hpp')
| -rw-r--r-- | src/sessionManager.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sessionManager.hpp b/src/sessionManager.hpp index 79fa372..70faa58 100644 --- a/src/sessionManager.hpp +++ b/src/sessionManager.hpp @@ -15,15 +15,15 @@ class CSessionManager { void run(); void broadcast(const std::string &msg) const; - void kick(const CSession *session, const std::string &reason = "") const; + void kick(CSession *session, const bool &kill = false, const std::string &reason = ""); + void kick(std::pair<std::jthread, std::shared_ptr<CSession>> *session, const bool &kill = false, const std::string &reason = ""); void addSession(const CSession &session); - void removeSession(std::pair<std::jthread, std::shared_ptr<CSession>> *session, const bool &kill = false); bool nameExists(const std::string &name); void shutdownSessions(); - const CSession *getByName(const std::string &name) const; - const CSession *getByIp(const char m_ip[INET_ADDRSTRLEN]) const; + CSession *getByName(const std::string &name) const; + CSession *getByIp(const char m_ip[INET_ADDRSTRLEN]) const; private: void broadcastChat(const std::string &msg, const std::string &username) const; |
