summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2014-05-17 19:39:16 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2014-05-17 19:39:16 +0200
commit19f4cd05470785a1afdc764b79db3777f62fe65d (patch)
tree590bb2b56ba3a3f26bed45a625b243105cc0fdeb
parentAdded load command in the cServer class (diff)
downloadcuberite-19f4cd05470785a1afdc764b79db3777f62fe65d.tar
cuberite-19f4cd05470785a1afdc764b79db3777f62fe65d.tar.gz
cuberite-19f4cd05470785a1afdc764b79db3777f62fe65d.tar.bz2
cuberite-19f4cd05470785a1afdc764b79db3777f62fe65d.tar.lz
cuberite-19f4cd05470785a1afdc764b79db3777f62fe65d.tar.xz
cuberite-19f4cd05470785a1afdc764b79db3777f62fe65d.tar.zst
cuberite-19f4cd05470785a1afdc764b79db3777f62fe65d.zip
-rw-r--r--src/Server.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 91bc6853e..8e222b743 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -476,13 +476,34 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
a_Output.Finished();
return;
}
- if (split[0] == "load" && !split[1].empty())
+ if (split[0] == "load")
{
- cPluginManager::Get()->LoadPlugin(split[1]);
- a_Output.Out("Plugin " + split[1] + " added and activated!");
- a_Output.Finished();
+ if (split.size() > 1)
+ {
+ cPluginManager::Get()->LoadPlugin(split[1]);
+ return;
+ }
+ else
+ {
+ a_Output.Out("No plugin given! Command: load <pluginname>");
+ a_Output.Finished();
+ return;
+ }
}
-
+ /*
+ * TODO: Declare unload command
+ if (split[0] == "unload")
+ {
+ if (split.size() > 1)
+ {
+
+ }
+ else
+ {
+
+ }
+ }
+ */
// There is currently no way a plugin can do these (and probably won't ever be):
if (split[0].compare("chunkstats") == 0)
{
@@ -573,6 +594,9 @@ void cServer::BindBuiltInConsoleCommands(void)
PlgMgr->BindConsoleCommand("restart", NULL, " - Restarts the server cleanly");
PlgMgr->BindConsoleCommand("stop", NULL, " - Stops the server cleanly");
PlgMgr->BindConsoleCommand("chunkstats", NULL, " - Displays detailed chunk memory statistics");
+ PlgMgr->BindConsoleCommand("load <pluginname>", NULL, " - Adds and enables the specified plugin");
+ PlgMgr->BindConsoleCommand("unload <pluginname>", NULL, " - Disables the specified plugin");
+
#if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER)
PlgMgr->BindConsoleCommand("dumpmem", NULL, " - Dumps all used memory blocks together with their callstacks into memdump.xml");
#endif