summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginManager.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-21 22:59:08 +0100
committermadmaxoft <github@xoft.cz>2014-01-21 23:00:35 +0100
commit2a018cfa49e0a85d2984f6daf6ee3c3372bdafda (patch)
treead5fd7e212a7256d3de42f101f3d74296f5b2425 /src/Bindings/PluginManager.cpp
parentFix a crash but somewhere... (diff)
downloadcuberite-2a018cfa49e0a85d2984f6daf6ee3c3372bdafda.tar
cuberite-2a018cfa49e0a85d2984f6daf6ee3c3372bdafda.tar.gz
cuberite-2a018cfa49e0a85d2984f6daf6ee3c3372bdafda.tar.bz2
cuberite-2a018cfa49e0a85d2984f6daf6ee3c3372bdafda.tar.lz
cuberite-2a018cfa49e0a85d2984f6daf6ee3c3372bdafda.tar.xz
cuberite-2a018cfa49e0a85d2984f6daf6ee3c3372bdafda.tar.zst
cuberite-2a018cfa49e0a85d2984f6daf6ee3c3372bdafda.zip
Diffstat (limited to 'src/Bindings/PluginManager.cpp')
-rw-r--r--src/Bindings/PluginManager.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index 24bb914d1..92c06487c 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -1736,6 +1736,21 @@ bool cPluginManager::IsValidHookType(int a_HookType)
+bool cPluginManager::DoWithPlugin(const AString & a_PluginName, cPluginCallback & a_Callback)
+{
+ // TODO: Implement locking for plugins
+ PluginMap::iterator itr = m_Plugins.find(a_PluginName);
+ if (itr == m_Plugins.end())
+ {
+ return false;
+ }
+ return a_Callback.Item(itr->second);
+}
+
+
+
+
+
bool cPluginManager::AddPlugin(cPlugin * a_Plugin)
{
m_Plugins[a_Plugin->GetDirectory()] = a_Plugin;