summaryrefslogtreecommitdiff
path: root/src/sessionManager.hpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-04-07 18:20:47 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-04-07 18:21:45 +0800
commita38b8c35e4c9b85e0b035c5dfa2bee26a5c36b65 (patch)
tree841c5bdf7d9466ed94316c64336efcd709e6ec18 /src/sessionManager.hpp
parentcfb29cfd831b8c44112dd15c821ce235e78beb2e (diff)
internal: use smart pointer for everything, no more naked pointer
Diffstat (limited to 'src/sessionManager.hpp')
-rw-r--r--src/sessionManager.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sessionManager.hpp b/src/sessionManager.hpp
index 8e02a7d..e969bd9 100644
--- a/src/sessionManager.hpp
+++ b/src/sessionManager.hpp
@@ -12,19 +12,19 @@ class CSessionManager {
CSessionManager();
~CSessionManager();
- std::pair<std::jthread, std::shared_ptr<CSession>> *newSession();
+ void newSession();
void run();
void broadcast(const std::string &msg) 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 kick(std::shared_ptr<CSession> session, const bool kill = false, const std::string &reason = "");
+ void kick(std::unique_ptr<std::pair<std::jthread, std::shared_ptr<CSession>>> session, const bool kill = false, const std::string &reason = "");
void addSession(const CSession &session);
bool nameExists(const std::string &name);
void shutdownSessions();
- CSession *getByName(const std::string &name) const;
- CSession *getByIp(const std::string &ip) const;
+ std::shared_ptr<CSession> getByName(const std::string &name) const;
+ std::shared_ptr<CSession> getByIp(const std::string &ip) const;
std::vector<std::shared_ptr<CSession>> getSessions() const;
private: