summaryrefslogtreecommitdiffstats
path: root/source/LuaState.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-08 16:30:02 +0200
committermadmaxoft <github@xoft.cz>2013-08-08 16:30:02 +0200
commiteb323166d9ae600fe422725ea29575ba4613b6d2 (patch)
treebad726267d13fec9994a2c20e8d88885fca29bd0 /source/LuaState.cpp
parentcPlugin_NewLua is now completely rewritten to use templated LuaState calls. (diff)
downloadcuberite-eb323166d9ae600fe422725ea29575ba4613b6d2.tar
cuberite-eb323166d9ae600fe422725ea29575ba4613b6d2.tar.gz
cuberite-eb323166d9ae600fe422725ea29575ba4613b6d2.tar.bz2
cuberite-eb323166d9ae600fe422725ea29575ba4613b6d2.tar.lz
cuberite-eb323166d9ae600fe422725ea29575ba4613b6d2.tar.xz
cuberite-eb323166d9ae600fe422725ea29575ba4613b6d2.tar.zst
cuberite-eb323166d9ae600fe422725ea29575ba4613b6d2.zip
Diffstat (limited to 'source/LuaState.cpp')
-rw-r--r--source/LuaState.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/LuaState.cpp b/source/LuaState.cpp
index 83581d19a..367a04266 100644
--- a/source/LuaState.cpp
+++ b/source/LuaState.cpp
@@ -599,6 +599,32 @@ void cLuaState::Push(const HTTPRequest * a_Request)
+void cLuaState::Push(cWebAdmin * a_WebAdmin)
+{
+ ASSERT(IsValid());
+ ASSERT(m_NumCurrentFunctionArgs >= 0); // A function must be pushed to stack first
+
+ tolua_pushusertype(m_LuaState, a_WebAdmin, "cWebAdmin");
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
+void cLuaState::Push(const HTTPTemplateRequest * a_Request)
+{
+ ASSERT(IsValid());
+ ASSERT(m_NumCurrentFunctionArgs >= 0); // A function must be pushed to stack first
+
+ tolua_pushusertype(m_LuaState, (void *)a_Request, "HTTPTemplateRequest");
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
void cLuaState::GetReturn(int a_StackPos, bool & a_ReturnedVal)
{
a_ReturnedVal = (tolua_toboolean(m_LuaState, a_StackPos, a_ReturnedVal ? 1 : 0) > 0);