diff options
author | Mattes D <github@xoft.cz> | 2014-06-01 10:43:37 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-06-01 10:43:37 +0200 |
commit | 2059944d1e39e952c164b8a87c0c3f216b3b731e (patch) | |
tree | fd210c1cf1bfcda2f7ed1292df01a26f9555c057 /src/Server.cpp | |
parent | Initial commit of the Generator article. (diff) | |
parent | Updated AlchemistVillage prefabs. (diff) | |
download | cuberite-2059944d1e39e952c164b8a87c0c3f216b3b731e.tar cuberite-2059944d1e39e952c164b8a87c0c3f216b3b731e.tar.gz cuberite-2059944d1e39e952c164b8a87c0c3f216b3b731e.tar.bz2 cuberite-2059944d1e39e952c164b8a87c0c3f216b3b731e.tar.lz cuberite-2059944d1e39e952c164b8a87c0c3f216b3b731e.tar.xz cuberite-2059944d1e39e952c164b8a87c0c3f216b3b731e.tar.zst cuberite-2059944d1e39e952c164b8a87c0c3f216b3b731e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Server.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/Server.cpp b/src/Server.cpp index bfb1b1cbb..aa731cdd2 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -476,7 +476,37 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac a_Output.Finished(); return; } - + if (split[0] == "load") + { + if (split.size() > 1) + { + cPluginManager::Get()->LoadPlugin(split[1]); + + return; + } + else + { + a_Output.Out("No plugin given! Command: load <pluginname>"); + a_Output.Finished(); + return; + } + } + + if (split[0] == "unload") + { + if (split.size() > 1) + { + cPluginManager::Get()->RemovePlugin(cPluginManager::Get()->GetPlugin(split[1])); + return; + } + else + { + a_Output.Out("No plugin given! Command: unload <pluginname>"); + a_Output.Finished(); + return; + } + } + // There is currently no way a plugin can do these (and probably won't ever be): if (split[0].compare("chunkstats") == 0) { @@ -567,6 +597,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 |