diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2014-10-20 15:08:48 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2014-10-20 15:08:48 +0200 |
commit | c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0 (patch) | |
tree | 6fa9437a102961ff1e7884aef7f7f9dfd90d2a9f /src/Server.cpp | |
parent | Added error handling to load <plugin> command (diff) | |
download | cuberite-c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0.tar cuberite-c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0.tar.gz cuberite-c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0.tar.bz2 cuberite-c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0.tar.lz cuberite-c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0.tar.xz cuberite-c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0.tar.zst cuberite-c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Server.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Server.cpp b/src/Server.cpp index 8e5755a75..67315c8cf 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -491,6 +491,17 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac { if (split.size() > 1) { + cPluginManager::PluginMap map = cPluginManager::Get()->GetAllPlugins(); + + for(auto plugin_entry : map) + { + if(plugin_entry.first == split[1]) + { + a_Output.Out("Error! Plugin is already loaded!"); + a_Output.Finished(); + return; + } + } a_Output.Out(cPluginManager::Get()->LoadPlugin(split[1]) ? "Plugin loaded" : "Error occurred loading plugin"); } else |