#pragma once #include "format.hpp" #include "session.hpp" #include #include #include class CSessionManager { public: CSessionManager(); ~CSessionManager(); std::pair> *newSession(); void run(); void broadcast(const std::string &msg) const; void kick(const CSession *session) const; void addSession(const CSession &session); void removeSession(std::pair> *session); bool nameExists(const std::string &name); void shutdownSessions(); private: void broadcastChat(const std::string &msg, const std::string &username) const; std::vector>> m_vSessions; friend class CChatManager; }; inline std::shared_ptr g_pSessionManager;