summaryrefslogtreecommitdiffstats
path: root/source/cPlugin_NewLua.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/cPlugin_NewLua.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/cPlugin_NewLua.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/cPlugin_NewLua.h b/source/cPlugin_NewLua.h
index 20b74b490..d48c38127 100644
--- a/source/cPlugin_NewLua.h
+++ b/source/cPlugin_NewLua.h
@@ -2,6 +2,7 @@
#pragma once
#include "cPlugin.h"
+#include "cWebPlugin.h"
@@ -14,7 +15,7 @@ class cWebPlugin_Lua;
-class cPlugin_NewLua : public cPlugin //tolua_export
+class cPlugin_NewLua : public cPlugin, public cWebPlugin //tolua_export
{ //tolua_export
public: //tolua_export
cPlugin_NewLua( const char* a_PluginName );
@@ -46,18 +47,22 @@ public: //tolua_export
virtual bool OnUpdatingSign (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4) override;
virtual bool OnWeatherChanged (cWorld * a_World) override;
+ virtual void SetName( const AString & a_Name ) override { cPlugin::SetName(a_Name); cWebPlugin::SetName(a_Name); }
+
+ // cWebPlugin and WebAdmin stuff
+ virtual AString HandleWebRequest( HTTPRequest * a_Request ) override;
+ bool AddWebTab( const AString & a_Title, lua_State * a_LuaState, int a_FunctionReference ); // >> EXPORTED IN MANUALBINDINGS <<
+ OBSOLETE bool AddTab( const AString & a_Title, lua_State * a_LuaState, int a_FunctionReference ); // >> EXPORTED IN MANUALBINDINGS <<
+
lua_State* GetLuaState() { return m_LuaState; }
- cWebPlugin_Lua* CreateWebPlugin(lua_State* a_LuaState); //tolua_export
+ OBSOLETE cPlugin_NewLua * CreateWebPlugin(lua_State* a_LuaState); //tolua_export
cCriticalSection & GetCriticalSection() { return m_CriticalSection; }
private:
bool PushFunction( const char* a_FunctionName, bool a_bLogError = true );
bool CallFunction( int a_NumArgs, int a_NumResults, const char* a_FunctionName ); // a_FunctionName is only used for error messages, nothing else
- typedef std::list< cWebPlugin_Lua* > WebPluginList;
- WebPluginList m_WebPlugins;
-
cCriticalSection m_CriticalSection;
std::string m_Directory;