diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-03 20:41:19 +0200 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-03 20:41:19 +0200 |
commit | 386d58b5862d8b76925c6523721594887606e82a (patch) | |
tree | ef073e7a843f4b75a4008d4b7383f7cdf08ceee5 /source/cPluginManager.h | |
parent | Visual Studio 2010 solution and project files (diff) | |
download | cuberite-386d58b5862d8b76925c6523721594887606e82a.tar cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.gz cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.bz2 cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.lz cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.xz cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.zst cuberite-386d58b5862d8b76925c6523721594887606e82a.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPluginManager.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/source/cPluginManager.h b/source/cPluginManager.h new file mode 100644 index 000000000..32c7b9d3a --- /dev/null +++ b/source/cPluginManager.h @@ -0,0 +1,68 @@ +#pragma once
+
+#include <list>
+
+struct lua_State;
+class cLuaCommandBinder;
+class cPlugin;
+class cPlugin_Lua;
+class cPluginManager //tolua_export
+{ //tolua_export
+public: //tolua_export
+
+ // Called each tick
+ virtual void Tick(float a_Dt);
+
+ enum PluginHook //tolua_export
+ { //tolua_export
+ E_PLUGIN_TICK, //tolua_export
+ E_PLUGIN_CHAT, //tolua_export
+ E_PLUGIN_COLLECT_ITEM, //tolua_export
+ E_PLUGIN_BLOCK_DIG, //tolua_export
+ E_PLUGIN_BLOCK_PLACE, //tolua_export
+ E_PLUGIN_DISCONNECT, //tolua_export
+ E_PLUGIN_HANDSHAKE, //tolua_export
+ E_PLUGIN_LOGIN, //tolua_export
+ E_PLUGIN_PLAYER_SPAWN, //tolua_export
+ E_PLUGIN_PLAYER_JOIN, //tolua_export
+ E_PLUGIN_PLAYER_MOVE, //tolua_export
+ E_PLUGIN_TAKE_DAMAGE, //tolua_export
+ E_PLUGIN_KILLED, //tolua_export
+ }; //tolua_export
+
+ static cPluginManager * GetPluginManager(); //tolua_export
+
+ typedef std::list< cPlugin* > PluginList;
+ cPlugin* GetPlugin( std::string a_Plugin ); //tolua_export
+ const PluginList & GetAllPlugins(); // >> EXPORTED IN MANUALBINDINGS <<
+
+ void ReloadPlugins(); //tolua_export
+ bool AddPlugin( cPlugin* a_Plugin );
+ bool AddPlugin( lua_State* a_LuaState, cPlugin* a_Plugin ); //tolua_export
+ bool AddLuaPlugin( cPlugin_Lua* a_Plugin );
+ void AddHook( cPlugin* a_Plugin, PluginHook a_Hook ); //tolua_export
+
+ unsigned int GetNumPlugins(); //tolua_export
+
+ bool CallHook( PluginHook a_Hook, unsigned int a_NumArgs, ... );
+
+ void RemovePlugin( cPlugin* a_Plugin, bool a_bDelete = false ); //tolua_export
+ void RemoveLuaPlugin( std::string a_FileName ); //tolua_export
+ cPlugin_Lua* GetLuaPlugin( lua_State* a_State ); //tolua_export
+
+ cLuaCommandBinder* GetLuaCommandBinder() { return m_LuaCommandBinder; }
+private:
+ friend class cRoot;
+ cPluginManager();
+ ~cPluginManager();
+
+ struct sPluginManagerState;
+ sPluginManagerState* m_pState;
+
+ void ReloadPluginsNow();
+ void UnloadPluginsNow();
+
+ cLuaCommandBinder* m_LuaCommandBinder;
+
+ bool m_bReloadPlugins;
+}; //tolua_export
|