1
0

Almost all packets' handling is now rewritten not to use cPacket descendants elsewhere than in cClientHandle.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@761 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-08-19 19:42:32 +00:00
parent 5b36aa1567
commit 427e582d5f
40 changed files with 1089 additions and 507 deletions

View File

@@ -184,20 +184,23 @@ bool cPlugin_NewLua::OnCollectItem( cPickup* a_Pickup, cPlayer* a_Player )
bool cPlugin_NewLua::OnDisconnect(const AString & a_Reason, cPlayer* a_Player )
bool cPlugin_NewLua::OnDisconnect(cPlayer * a_Player, const AString & a_Reason)
{
cCSLock Lock( m_CriticalSection );
if( !PushFunction("OnDisconnect") )
cCSLock Lock(m_CriticalSection);
if (!PushFunction("OnDisconnect"))
{
return false;
}
tolua_pushstring( m_LuaState, a_Reason.c_str() );
tolua_pushusertype(m_LuaState, a_Player, "cPlayer");
tolua_pushstring (m_LuaState, a_Reason.c_str());
if( !CallFunction(2, 1, "OnDisconnect") )
if (!CallFunction(2, 1, "OnDisconnect"))
{
return false;
}
bool bRetVal = (tolua_toboolean( m_LuaState, -1, 0) > 0);
return bRetVal;
return (tolua_toboolean( m_LuaState, -1, 0) > 0);
}