MCPcopy Create free account
hub / github.com/cuberite/cuberite / InputThread

Method InputThread

src/Root.cpp:76–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75
76void cRoot::InputThread(void * a_Params)
77{
78 cRoot & self = *(cRoot*)a_Params;
79
80 cLogCommandOutputCallback Output;
81
82 while (!self.m_bStop && !self.m_bRestart && !g_TERMINATE_EVENT_RAISED && std::cin.good())
83 {
84 AString Command;
85 std::getline(std::cin, Command);
86 if (!Command.empty())
87 {
88 self.ExecuteConsoleCommand(TrimString(Command), Output);
89 }
90 }
91
92 if (g_TERMINATE_EVENT_RAISED || !std::cin.good())
93 {
94 // We have come here because the std::cin has received an EOF / a terminate signal has been sent, and the server is still running; stop the server:
95 self.m_bStop = true;
96 }
97}
98
99
100

Callers

nothing calls this directly

Calls 3

ExecuteConsoleCommandMethod · 0.95
TrimStringFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected