summaryrefslogtreecommitdiffstats
path: root/source/cWebPlugin.h
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-22 16:22:21 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-22 16:22:21 +0200
commit7c84349990f21f783f4b24c113fb372a3c00164b (patch)
tree41cb29e214b98fc5b9c105bdf722a5c236c2318e /source/cWebPlugin.h
parentFixed cWebPlugin_Lua being not thread safe. And I don't know why, but it still crashes in Lua sometimes o_O (diff)
downloadcuberite-7c84349990f21f783f4b24c113fb372a3c00164b.tar
cuberite-7c84349990f21f783f4b24c113fb372a3c00164b.tar.gz
cuberite-7c84349990f21f783f4b24c113fb372a3c00164b.tar.bz2
cuberite-7c84349990f21f783f4b24c113fb372a3c00164b.tar.lz
cuberite-7c84349990f21f783f4b24c113fb372a3c00164b.tar.xz
cuberite-7c84349990f21f783f4b24c113fb372a3c00164b.tar.zst
cuberite-7c84349990f21f783f4b24c113fb372a3c00164b.zip
Diffstat (limited to '')
-rw-r--r--source/cWebPlugin.h24
1 files changed, 19 insertions, 5 deletions
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<std::string, std::string> > 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