summaryrefslogtreecommitdiffstats
path: root/source/Server.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Server.cpp12
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();
}