diff options
| -rw-r--r-- | src/session.cpp | 4 | ||||
| -rw-r--r-- | src/session.hpp | 1 | ||||
| -rw-r--r-- | src/sessionManager.hpp | 6 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/session.cpp b/src/session.cpp index 05d6873..9668cd8 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -204,6 +204,10 @@ const std::string &CSession::getName() const { return m_name; } +const char *CSession::getIp() const { + return m_ip; +} + void CSession::setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *self) { this->self = self; } diff --git a/src/session.hpp b/src/session.hpp index c4525bd..18c587d 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -22,6 +22,7 @@ class CSession { }; const std::string &getName() const; + const char *getIp() const; void setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *self); std::unique_ptr<SRecvData> read(); diff --git a/src/sessionManager.hpp b/src/sessionManager.hpp index b33a39e..a0f4389 100644 --- a/src/sessionManager.hpp +++ b/src/sessionManager.hpp @@ -22,9 +22,9 @@ class CSessionManager { bool nameExists(const std::string &name); void shutdownSessions(); - CSession *getByName(const std::string &name) const; - CSession *getByIp(const char m_ip[INET_ADDRSTRLEN]) const; - std::vector<std::shared_ptr<CSession>> getSessions() const; + CSession *getByName(const std::string &name) const; + CSession *getByIp(const char m_ip[INET_ADDRSTRLEN]) const; + std::vector<std::shared_ptr<CSession>> getSessions() const; private: void broadcastChat(const std::string &msg, const std::string &username) const; |
