summaryrefslogtreecommitdiffstats
path: root/source/cPluginManager.h
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-28 20:11:06 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-28 20:11:06 +0200
commit091d958b0c22e1bfd88144b4cda0c7ca00f4cf28 (patch)
tree9e851f6defc071ab9b723ca2d3a14638c16120c9 /source/cPluginManager.h
parentFixed a possible crash in ChunkSender - a client would be reported as removed but still would be in the internal queue. (diff)
downloadcuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.gz
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.bz2
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.lz
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.xz
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.zst
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.zip
Diffstat (limited to '')
-rw-r--r--source/cPluginManager.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/cPluginManager.h b/source/cPluginManager.h
index b42db94d6..d2099ebd7 100644
--- a/source/cPluginManager.h
+++ b/source/cPluginManager.h
@@ -32,8 +32,8 @@ public: //tolua_export
static cPluginManager * GetPluginManager(); //tolua_export
typedef std::list< cPlugin* > PluginList;
- cPlugin* GetPlugin( const char* a_Plugin ); //tolua_export
- const PluginList & GetAllPlugins(); // >> EXPORTED IN MANUALBINDINGS <<
+ cPlugin* GetPlugin( const char* a_Plugin ) const; //tolua_export
+ const PluginList & GetAllPlugins() const; // >> EXPORTED IN MANUALBINDINGS <<
void ReloadPlugins(); //tolua_export
bool AddPlugin( cPlugin* a_Plugin );
@@ -41,7 +41,7 @@ public: //tolua_export
bool AddLuaPlugin( cPlugin_Lua* a_Plugin );
void AddHook( cPlugin* a_Plugin, PluginHook a_Hook ); //tolua_export
- unsigned int GetNumPlugins(); //tolua_export
+ unsigned int GetNumPlugins() const; //tolua_export
bool CallHook( PluginHook a_Hook, unsigned int a_NumArgs, ... );
@@ -50,14 +50,20 @@ public: //tolua_export
void RemoveLuaPlugin( std::string a_FileName ); //tolua_export
cPlugin_Lua* GetLuaPlugin( lua_State* a_State ); //tolua_export
- cLuaCommandBinder* GetLuaCommandBinder() { return m_LuaCommandBinder; }
+ cLuaCommandBinder* GetLuaCommandBinder() const { return m_LuaCommandBinder; }
+
+ bool HasPlugin( cPlugin* a_Plugin ) const;
private:
friend class cRoot;
cPluginManager();
~cPluginManager();
- struct sPluginManagerState;
- sPluginManagerState* m_pState;
+ typedef std::list< cPlugin_Lua* > LuaPluginList;
+ typedef std::map< cPluginManager::PluginHook, cPluginManager::PluginList > HookMap;
+
+ LuaPluginList m_LuaPlugins;
+ PluginList m_Plugins;
+ HookMap m_Hooks;
void ReloadPluginsNow();
void UnloadPluginsNow();