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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user