diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-29 17:30:05 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-29 17:30:05 +0200 |
commit | 7b75aaea7c538f61518a60fe4af363383020e0bc (patch) | |
tree | a4ee92f7763ca9931e6c1e5b96a2b5275206ab46 /source/Server.cpp | |
parent | Added a function that allows you to change the /back coordinates. (diff) | |
download | cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.gz cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.bz2 cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.lz cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.xz cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.zst cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Server.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/Server.cpp b/source/Server.cpp index 7dac3ea18..67a02f626 100644 --- a/source/Server.cpp +++ b/source/Server.cpp @@ -21,6 +21,7 @@ #include "Tracer.h" #include "WebAdmin.h" #include "Protocol/ProtocolRecognizer.h" +#include "CommandOutput.h" #include "MersenneTwister.h" @@ -425,7 +426,7 @@ bool cServer::Command(cClientHandle & a_Client, AString & a_Cmd) -void cServer::ExecuteConsoleCommand(const AString & a_Cmd) +void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallback & a_Output) { AStringVector split = StringSplit(a_Cmd, " "); if (split.empty()) @@ -442,7 +443,8 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd) // There is currently no way a plugin can do these (and probably won't ever be): if (split[0].compare("chunkstats") == 0) { - cRoot::Get()->LogChunkStats(); + cRoot::Get()->LogChunkStats(a_Output); + a_Output.Finished(); return; } #if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER) @@ -462,12 +464,14 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd) } #endif - if (cPluginManager::Get()->ExecuteConsoleCommand(split)) + if (cPluginManager::Get()->ExecuteConsoleCommand(split, a_Output)) { + a_Output.Finished(); return; } - LOG("Unknown command, type 'help' for all commands.\n"); + a_Output.Out("Unknown command, type 'help' for all commands."); + a_Output.Finished(); } |