From 7c84349990f21f783f4b24c113fb372a3c00164b Mon Sep 17 00:00:00 2001 From: faketruth Date: Wed, 22 Aug 2012 14:22:21 +0000 Subject: WebAdmin should not cause crashes anymore Got rid of cWebPlugin_Lua cPlugin_Lua is also a cWebPlugin now, so plugins don't need a separate cWebPlugin object Changed some stuff to use AString instead of char* git-svn-id: http://mc-server.googlecode.com/svn/trunk@777 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWebPlugin.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'source/cWebPlugin.h') diff --git a/source/cWebPlugin.h b/source/cWebPlugin.h index e6eb00559..c4f08015b 100644 --- a/source/cWebPlugin.h +++ b/source/cWebPlugin.h @@ -7,18 +7,32 @@ struct HTTPRequest; class cWebPlugin { public: - cWebPlugin( lua_State* L ); + cWebPlugin(); virtual ~cWebPlugin(); void SetName( std::string a_Name ) { m_Name = a_Name; } std::string GetName() { return m_Name; } - virtual std::string HandleRequest( HTTPRequest* a_Request ) = 0; - virtual void Initialize() = 0; + virtual std::string HandleWebRequest( HTTPRequest* a_Request ) = 0; + + static AString SafeString( const AString & a_String ); //tolua_end - lua_State* GetLuaState() { return m_LuaState; } + struct sWebPluginTab + { + std::string Title; + std::string SafeTitle; + + int UserData; + }; + + typedef std::list< sWebPluginTab* > TabList; + TabList & GetTabs() { return m_Tabs; } + + std::list< std::pair > GetTabNames(); + std::pair< std::string, std::string > GetTabNameForRequest( HTTPRequest* a_Request ); + private: - lua_State* m_LuaState; + TabList m_Tabs; std::string m_Name; }; //tolua_export \ No newline at end of file -- cgit v1.2.3