summaryrefslogtreecommitdiff
path: root/src/chatServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chatServer.cpp')
-rw-r--r--src/chatServer.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/chatServer.cpp b/src/chatServer.cpp
index 8e9a3ab..56caf4b 100644
--- a/src/chatServer.cpp
+++ b/src/chatServer.cpp
@@ -1,5 +1,8 @@
#include "chatServer.hpp"
#include "chatManager.hpp"
+#include "commandHandler.hpp"
+#include "commands.hpp"
+#include "inputManager.hpp"
#include "log.hpp"
#include "server.hpp"
#include "sessionManager.hpp"
@@ -23,6 +26,8 @@ void CChatServer::cleanup() {
// m_sessionManagerThread.join();
g_pSessionManager.reset();
g_pServer.reset();
+ g_pCommandHandler.reset();
+ g_pInputManager.reset();
}
void CChatServer::initManagers() {
@@ -33,15 +38,20 @@ void CChatServer::initManagers() {
g_pSessionManager = std::make_shared<CSessionManager>();
log(LOG, "Creating ChatManager");
g_pChatManager = std::make_unique<CChatManager>();
+ log(LOG, "Creating InputManager");
+ g_pInputManager = std::make_unique<CInputManager>();
}
void CChatServer::start() {
initManagers();
+ log(LOG, "Creating CommandHandler");
+ g_pCommandHandler = std::make_unique<CCommandHandler>();
+ registerCommands();
+
// will await while waiting for accept() to return a new client
m_sessionManagerThread = std::jthread(&CSessionManager::run, g_pSessionManager.get());
m_sessionManagerThread.detach();
- while (true) {
- }
+ g_pInputManager->run();
}