summaryrefslogtreecommitdiff
path: root/src/core/sessionManager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/sessionManager.hpp')
-rw-r--r--src/core/sessionManager.hpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/sessionManager.hpp b/src/core/sessionManager.hpp
index 71bcc5f..e84226c 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 <memory>
#include <thread>
#include <vector>
@@ -15,22 +15,22 @@ class CSessionManager {
void newSession();
void run();
- void broadcast(const std::string &msg, std::optional<std::weak_ptr<CSession>> self = std::nullopt) const; // second param only specified when we want to exclude the sender
- void kick(std::weak_ptr<CSession> session, const bool kill = false, const std::string &reason = "");
+ void broadcast(const std::string &msg, std::optional<WP<CSession>> self = std::nullopt) const; // second param only specified when we want to exclude the sender
+ void kick(WP<CSession> session, const bool kill = false, const std::string &reason = "");
void addSession(const CSession &session);
bool nameExists(const std::string &name);
void shutdownSessions();
- 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;
+ SP<CSession> getByName(const std::string &name) const;
+ SP<CSession> getByIp(const std::string &ip) const;
+ std::vector<SP<CSession>> getSessions() const;
private:
void broadcast(const CChatManager::SMessage &msg) const;
- std::vector<std::pair<std::jthread, std::shared_ptr<CSession>>> m_vSessions;
+ std::vector<std::pair<std::jthread, SP<CSession>>> m_vSessions;
friend class CChatManager;
};
-inline std::shared_ptr<CSessionManager> g_pSessionManager;
+inline SP<CSessionManager> g_pSessionManager;