예제 #1
0
파일: base.cpp 프로젝트: Eayon/kbengine
//-------------------------------------------------------------------------------------
void Base::onDestroy(bool callScript)																					
{
	if(callScript)
	{
		SCOPED_PROFILE(SCRIPTCALL_PROFILE);
		SCRIPT_OBJECT_CALL_ARGS0(this, const_cast<char*>("onDestroy"));
	}

	if(this->hasDB())
	{
		onCellWriteToDBCompleted(0, -1);
	}
	
	eraseEntityLog();
}
예제 #2
0
파일: base.cpp 프로젝트: ihuangx/kbengine
//-------------------------------------------------------------------------------------
void Base::onDestroy(bool callScript)
{
	setDirty();
	
	if(callScript)
	{
		SCOPED_PROFILE(SCRIPTCALL_PROFILE);
		SCRIPT_OBJECT_CALL_ARGS0(this, const_cast<char*>("onDestroy"));
	}

	if(this->hasDB())
	{
		onCellWriteToDBCompleted(0, -1, -1);
	}
	
	eraseEntityLog();

	// 按照当前的设计来说,有clientMailbox_必定是proxy
	// 至于为何跑到base里来和python本身是C语言实现有关
	if(clientMailbox_)
		static_cast<Proxy*>(this)->kick();
}
예제 #3
0
//-------------------------------------------------------------------------------------
void Base::writeToDB()
{
	if(isArchiveing_)
		return;

	isArchiveing_ = true;

	if(isDestroyed())																				
	{																										
		return;																							
	}

	if(this->getCellMailbox() == NULL)
	{
		onCellWriteToDBCompleted();
	}
	else
	{
		Mercury::Bundle bundle;
		bundle.newMessage(CellappInterface::reqWriteToDBFromBaseapp);
		bundle << this->getID();
		this->getCellMailbox()->postMail(bundle);
	}
}