From 41ba1a7642105ac21b67f4febac3eceef6a39f0a Mon Sep 17 00:00:00 2001 From: faketruth Date: Sat, 13 Oct 2012 23:34:47 +0000 Subject: Completely removed support for old style Lua plugins (can use both Plugin and NewPlugin in settings.ini for now) Removed cPlugin_Lua, obviously cPluginManager stores plugins by their (folder)name cPluginManager now scans the Plugins folder for potential plugins and adds them as non-loaded plugins Added a DisablePlugin and LoadPlugin to disable and load plugins on a per-plugin basis instead of all at once cPluginManager::FindPlugins refreshes the plugin list by removing non-existing plugins and adding new plugins Made it incredibly easy to use new plugins from the WebAdmin Exposed some food/hunger related functions in cPlayer to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@959 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Plugin.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'source/Plugin.h') diff --git a/source/Plugin.h b/source/Plugin.h index d88a26d4e..52508eb6a 100644 --- a/source/Plugin.h +++ b/source/Plugin.h @@ -28,7 +28,7 @@ class cCraftingRecipe; class cPlugin { public: - cPlugin(); + cPlugin( const AString & a_PluginDirectory ); virtual ~cPlugin(); virtual void OnDisable() {} @@ -70,18 +70,21 @@ public: int GetVersion() const { return m_Version; } void SetVersion( int a_Version ) { m_Version = a_Version; } + const AString & GetDirectory(void) const {return m_Directory; } + AString GetLocalDirectory(void) const; //tolua_export + struct CommandStruct { - std::string Command; - std::string Description; - std::string Permission; + AString Command; + AString Description; + AString Permission; }; void AddCommand(const AString & a_Command, const AString & a_Description, const AString & a_Permission); // tolua_end - typedef bool (FuncCommandHandler)( std::string & a_Command, std::vector< std::string > & a_Split ); - void BindCommand( FuncCommandHandler* a_Function, std::string & a_Command ); // >> EXPORTED IN MANUALBINDINGS << + typedef bool (FuncCommandHandler)( AString & a_Command, std::vector< std::string > & a_Split ); + void BindCommand( FuncCommandHandler* a_Function, AString & a_Command ); // >> EXPORTED IN MANUALBINDINGS << const std::vector< CommandStruct > & GetCommands() const { return m_Commands; } // >> EXPORTED IN MANUALBINDINGS << @@ -102,8 +105,10 @@ private: PluginLanguage m_Language; std::vector< CommandStruct > m_Commands; - std::string m_Name; + AString m_Name; int m_Version; + + AString m_Directory; }; //tolua_export -- cgit v1.2.3