From 6f7b994684032060f0a2d7af82f4f3572293b8d6 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 12 Jun 2025 21:41:41 +0800 Subject: internal!: organized internal structure, using cmake now --- src/core/sessionManager.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/sessionManager.hpp') diff --git a/src/core/sessionManager.hpp b/src/core/sessionManager.hpp index e84226c..71bcc5f 100644 --- a/src/core/sessionManager.hpp +++ b/src/core/sessionManager.hpp @@ -1,9 +1,9 @@ #pragma once #include "../debug/format.hpp" -#include "../misc/memory.hpp" #include "chatManager.hpp" #include "session.hpp" +#include #include #include @@ -15,22 +15,22 @@ class CSessionManager { void newSession(); void run(); - void broadcast(const std::string &msg, std::optional> self = std::nullopt) const; // second param only specified when we want to exclude the sender - void kick(WP session, const bool kill = false, const std::string &reason = ""); + void broadcast(const std::string &msg, std::optional> self = std::nullopt) const; // second param only specified when we want to exclude the sender + void kick(std::weak_ptr session, const bool kill = false, const std::string &reason = ""); void addSession(const CSession &session); bool nameExists(const std::string &name); void shutdownSessions(); - SP getByName(const std::string &name) const; - SP getByIp(const std::string &ip) const; - std::vector> getSessions() const; + std::shared_ptr getByName(const std::string &name) const; + std::shared_ptr getByIp(const std::string &ip) const; + std::vector> getSessions() const; private: void broadcast(const CChatManager::SMessage &msg) const; - std::vector>> m_vSessions; + std::vector>> m_vSessions; friend class CChatManager; }; -inline SP g_pSessionManager; +inline std::shared_ptr g_pSessionManager; -- cgit v1.2.3