diff options
author | Mattes D <github@xoft.cz> | 2015-04-19 19:53:14 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-04-19 19:53:14 +0200 |
commit | ba6f5aea4c088b92365b6636d96873a82706c8c8 (patch) | |
tree | d8c6f3a3eda7c0ed1f70bc5a01b97b90d940eab4 /src/Server.cpp | |
parent | ClientHandle: Fixed re-sending refused right-clicks. (diff) | |
parent | Refresh plugin list before trying to load. (diff) | |
download | cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.gz cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.bz2 cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.lz cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.xz cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.zst cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.zip |
Diffstat (limited to 'src/Server.cpp')
-rw-r--r-- | src/Server.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/Server.cpp b/src/Server.cpp index df2c7deef..8b6a2e769 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -464,22 +464,12 @@ 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; - } - } + cPluginManager::Get()->RefreshPluginList(); // Refresh the plugin list, so that if the plugin was added just now, it is loadable a_Output.Out(cPluginManager::Get()->LoadPlugin(split[1]) ? "Plugin loaded" : "Error occurred loading plugin"); } else { - a_Output.Out("Usage: load <pluginname>"); + a_Output.Out("Usage: load <PluginFolder>"); } a_Output.Finished(); return; @@ -488,12 +478,12 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac { if (split.size() > 1) { - cPluginManager::Get()->RemovePlugin(cPluginManager::Get()->GetPlugin(split[1])); - a_Output.Out("Plugin unloaded"); + cPluginManager::Get()->UnloadPlugin(split[1]); + a_Output.Out("Plugin unload scheduled"); } else { - a_Output.Out("Usage: unload <pluginname>"); + a_Output.Out("Usage: unload <PluginFolder>"); } a_Output.Finished(); return; |