Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
console.h
Go to the documentation of this file.
1
12#ifndef MINESERVER_CONSOLE_H
13#define MINESERVER_CONSOLE_H
14
15#include <thread>
16#include <atomic>
17#include <utils/logger.h>
18#include <cmd/commands.h>
19
24class ConsoleManager : public ISender
25{
26private:
27 static ConsoleManager *instance;
28
29 std::string currentInput;
31 std::thread::native_handle_type threadHandle;
32 std::atomic<bool> isRunning;
33
34 void loop();
35
36public:
47
52 void start();
57 void stop();
65 static void onPostPrint(logger::PostPrintEvent event);
66
72 void sendMessage(const ChatMessage &message) override;
73
80 {
81 return *instance;
82 }
83};
84
85#endif // MINESERVER_CONSOLE_H
Minecraft Chat Message implementation.
Definition chatmessage.h:28
Console manager.
Definition console.h:25
~ConsoleManager()
Destroy the Console Manager object.
Definition console.cpp:27
void stop()
Stops listening for commands.
Definition console.cpp:115
void start()
Starts listening for commands.
Definition console.cpp:102
void sendMessage(const ChatMessage &message) override
Sends a message to the console.
Definition console.cpp:138
ConsoleManager()
Construct a new Console Manager object.
Definition console.cpp:18
static void onPostPrint(logger::PostPrintEvent event)
Post print hook.
Definition console.cpp:126
static ConsoleManager & inst()
Gets Console Manager instance.
Definition console.h:79
int subId
The Subscription Id.
Definition event.h:100
Sender Interface.
Definition commands.h:29
Post print event.
Definition logger.h:249
The file handling commands logic.
The main file for the logger.