From c2560cc1be9a41dc80733fa8c55b00ec6e15a7f0 Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Mon, 20 Oct 2014 15:08:48 +0200 Subject: Added error message --- src/Server.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Server.cpp') 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 -- cgit v1.2.3 From d2cc1e0cd3dde8c748de8436be4f4ad8c92abb89 Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Mon, 20 Oct 2014 15:58:08 +0200 Subject: Fix for fix #1552 --- src/Server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 67315c8cf..db3ab2ed4 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -493,9 +493,9 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac { cPluginManager::PluginMap map = cPluginManager::Get()->GetAllPlugins(); - for(auto plugin_entry : map) + for (auto plugin_entry : map) { - if(plugin_entry.first == split[1]) + if (plugin_entry.first == split[1]) { a_Output.Out("Error! Plugin is already loaded!"); a_Output.Finished(); -- cgit v1.2.3