diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-21 18:09:05 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-22 15:02:46 +0800 |
| commit | 3e19bf603af0ac01f6690afe7cf59702a4a5cc02 (patch) | |
| tree | b8ee33d721aa200364617239aab557639b5003c5 /src/session.hpp | |
| parent | 97d82139d2011a790c0d3d254add5d800de2742f (diff) | |
feat(commands): client execute commands (#8)
refactor(session): writeChat, unify written chat
internal: removed `CChatManager::broadcastMessage`, just use `g_pSessionManager->broadcastChat(msg)`
Diffstat (limited to 'src/session.hpp')
| -rw-r--r-- | src/session.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/session.hpp b/src/session.hpp index 18c587d..1b7b8db 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -1,6 +1,7 @@ #pragma once #include "FileDescriptor.hpp" +#include "chatManager.hpp" #include "format.hpp" #include <memory> #include <netinet/in.h> @@ -32,12 +33,15 @@ class CSession { bool write(std::format_string<Args...> fmt, Args &&...args); template <typename... Args> bool write(eFormatType type, std::format_string<Args...> fmt, Args &&...args); + void writeChat(const CChatManager::SMessage &msg); void run(); bool isValid(); private: + constexpr static char m_adminIps[1][INET_ADDRSTRLEN] = {"127.0.0.1"}; + enum eEventType : std::uint8_t { READ, WRITE @@ -50,6 +54,7 @@ class CSession { std::string m_name; char m_ip[INET_ADDRSTRLEN]; int m_port; + bool m_isAdmin = false; bool m_isReading = false; |
