mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
- Integrated linenoise library for line editing and completion in the server console. - Updated ServerLogger to handle external writes safely during logging. - Modified ServerMain to initialize and manage the ServerCli for command input. - The implementation is separate from everything else, so it doesn't affect anything else. - The command input section and execution section are separated into threads.
45 lines
525 B
C++
45 lines
525 B
C++
#include "stdafx.h"
|
|
|
|
#include "ServerCli.h"
|
|
|
|
#include "ServerCliEngine.h"
|
|
#include "ServerCliInput.h"
|
|
|
|
namespace ServerRuntime
|
|
{
|
|
ServerCli::ServerCli()
|
|
: m_engine(new ServerCliEngine())
|
|
, m_input(new ServerCliInput())
|
|
{
|
|
}
|
|
|
|
ServerCli::~ServerCli()
|
|
{
|
|
Stop();
|
|
}
|
|
|
|
void ServerCli::Start()
|
|
{
|
|
if (m_input && m_engine)
|
|
{
|
|
m_input->Start(m_engine.get());
|
|
}
|
|
}
|
|
|
|
void ServerCli::Stop()
|
|
{
|
|
if (m_input)
|
|
{
|
|
m_input->Stop();
|
|
}
|
|
}
|
|
|
|
void ServerCli::Poll()
|
|
{
|
|
if (m_engine)
|
|
{
|
|
m_engine->Poll();
|
|
}
|
|
}
|
|
}
|