summaryrefslogtreecommitdiffstats
path: root/source/cPlugin_NewLua.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cPlugin_NewLua.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp
index bae24d0ff..1b617f1ef 100644
--- a/source/cPlugin_NewLua.cpp
+++ b/source/cPlugin_NewLua.cpp
@@ -135,6 +135,10 @@ void cPlugin_NewLua::Tick(float a_Dt)
CallFunction(1, 0, "Tick");
}
+
+
+
+
bool cPlugin_NewLua::OnCollectItem( cPickup* a_Pickup, cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -151,6 +155,10 @@ bool cPlugin_NewLua::OnCollectItem( cPickup* a_Pickup, cPlayer* a_Player )
return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnDisconnect( std::string a_Reason, cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -167,6 +175,10 @@ bool cPlugin_NewLua::OnDisconnect( std::string a_Reason, cPlayer* a_Player )
return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnBlockPlace( cPacket_BlockPlace* a_PacketData, cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -183,6 +195,10 @@ bool cPlugin_NewLua::OnBlockPlace( cPacket_BlockPlace* a_PacketData, cPlayer* a_
return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnBlockDig( cPacket_BlockDig* a_PacketData, cPlayer* a_Player, cItem* a_PickupItem )
{
cCSLock Lock( m_CriticalSection );
@@ -200,6 +216,10 @@ bool cPlugin_NewLua::OnBlockDig( cPacket_BlockDig* a_PacketData, cPlayer* a_Play
return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnChat( const char* a_Chat, cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -216,6 +236,10 @@ bool cPlugin_NewLua::OnChat( const char* a_Chat, cPlayer* a_Player )
return bRetVal;
}
+
+
+
+
bool cPlugin_NewLua::OnLogin( cPacket_Login* a_PacketData )
{
cCSLock Lock( m_CriticalSection );
@@ -231,6 +255,10 @@ bool cPlugin_NewLua::OnLogin( cPacket_Login* a_PacketData )
return bRetVal;
}
+
+
+
+
void cPlugin_NewLua::OnPlayerSpawn( cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -242,6 +270,10 @@ void cPlugin_NewLua::OnPlayerSpawn( cPlayer* a_Player )
CallFunction(1, 0, "OnPlayerSpawn");
}
+
+
+
+
bool cPlugin_NewLua::OnPlayerJoin( cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -257,6 +289,10 @@ bool cPlugin_NewLua::OnPlayerJoin( cPlayer* a_Player )
return bRetVal;
}
+
+
+
+
void cPlugin_NewLua::OnPlayerMove( cPlayer* a_Player )
{
cCSLock Lock( m_CriticalSection );
@@ -268,6 +304,10 @@ void cPlugin_NewLua::OnPlayerMove( cPlayer* a_Player )
CallFunction(1, 0, "OnPlayerMove");
}
+
+
+
+
void cPlugin_NewLua::OnTakeDamage( cPawn* a_Pawn, TakeDamageInfo* a_TakeDamageInfo )
{
cCSLock Lock( m_CriticalSection );
@@ -280,6 +320,10 @@ void cPlugin_NewLua::OnTakeDamage( cPawn* a_Pawn, TakeDamageInfo* a_TakeDamageIn
CallFunction(2, 0, "OnTakeDamage");
}
+
+
+
+
bool cPlugin_NewLua::OnKilled( cPawn* a_Killed, cEntity* a_Killer )
{
cCSLock Lock( m_CriticalSection );
@@ -297,6 +341,28 @@ bool cPlugin_NewLua::OnKilled( cPawn* a_Killed, cEntity* a_Killer )
}
+
+
+
+void cPlugin_NewLua::OnChunkGenerated(cWorld * a_World, int a_ChunkX, int a_ChunkZ)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!PushFunction("OnChunkGenerated"))
+ {
+ return;
+ }
+
+ tolua_pushusertype(m_LuaState, a_World, "cWorld");
+ tolua_pushnumber (m_LuaState, a_ChunkX);
+ tolua_pushnumber (m_LuaState, a_ChunkZ);
+
+ CallFunction(3, 0, "OnChunkGenerated");
+}
+
+
+
+
+
cWebPlugin_Lua* cPlugin_NewLua::CreateWebPlugin(lua_State* a_LuaState)
{
cCSLock Lock( m_CriticalSection );