summaryrefslogtreecommitdiffstats
path: root/source/cPlugin_NewLua.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-05 22:30:27 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-05 22:30:27 +0200
commitf94456dd3eccc65a6f304d4b804ca09a67fa6008 (patch)
tree9997e63b9e0152661232aff9c78b78f2b215233e /source/cPlugin_NewLua.cpp
parentProtoProxy: Added about 10 new packet types parsed (diff)
downloadcuberite-f94456dd3eccc65a6f304d4b804ca09a67fa6008.tar
cuberite-f94456dd3eccc65a6f304d4b804ca09a67fa6008.tar.gz
cuberite-f94456dd3eccc65a6f304d4b804ca09a67fa6008.tar.bz2
cuberite-f94456dd3eccc65a6f304d4b804ca09a67fa6008.tar.lz
cuberite-f94456dd3eccc65a6f304d4b804ca09a67fa6008.tar.xz
cuberite-f94456dd3eccc65a6f304d4b804ca09a67fa6008.tar.zst
cuberite-f94456dd3eccc65a6f304d4b804ca09a67fa6008.zip
Diffstat (limited to 'source/cPlugin_NewLua.cpp')
-rw-r--r--source/cPlugin_NewLua.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp
index dea74540b..1b9e8cdbb 100644
--- a/source/cPlugin_NewLua.cpp
+++ b/source/cPlugin_NewLua.cpp
@@ -640,6 +640,30 @@ bool cPlugin_NewLua::OnUpdatedSign(
+bool cPlugin_NewLua::OnHandshake(cClientHandle * a_Client, const AString & a_Username)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!PushFunction("OnHandshake"))
+ {
+ return false;
+ }
+
+ tolua_pushusertype(m_LuaState, a_Client, "cClientHandle");
+ tolua_pushstring (m_LuaState, a_Username.c_str());
+
+ if (!CallFunction(2, 1, "OnHandshake"))
+ {
+ return false;
+ }
+
+ bool bRetVal = (tolua_toboolean( m_LuaState, -1, 0) > 0);
+ return bRetVal;
+}
+
+
+
+
+
cPlugin_NewLua * cPlugin_NewLua::CreateWebPlugin(lua_State * a_LuaState)
{
LOGWARN("WARNING: Using deprecated function CreateWebPlugin()! A Lua plugin is a WebPlugin by itself now. (plugin \"%s\" in folder \"%s\")",