Пример #1
0
//-------------------------------------------------------------------------------------
void Proxy::initClientCellPropertys()
{
	if(clientMailbox() == NULL)
		return;

	Network::Bundle* pBundle = Network::Bundle::ObjPool().createObject();
	(*pBundle).newMessage(ClientInterface::onUpdatePropertys);
	(*pBundle) << this->id();

	ENTITY_PROPERTY_UID spaceuid = ENTITY_BASE_PROPERTY_UTYPE_SPACEID;

	Network::FixedMessages::MSGInfo* msgInfo = 
		Network::FixedMessages::getSingleton().isFixed("Property::spaceID");

	if(msgInfo != NULL)
	{
		spaceuid = msgInfo->msgid;
	}
	
	if(pScriptModule()->usePropertyDescrAlias())
	{
		uint8 aliasID = ENTITY_BASE_PROPERTY_ALIASID_SPACEID;
		(*pBundle) << aliasID << this->spaceID();
	}
	else
	{
		(*pBundle) << spaceuid << this->spaceID();
	}

	MemoryStream* s = MemoryStream::ObjPool().createObject();

	// celldata获取客户端感兴趣的数据初始化客户端 如:ALL_CLIENTS
	addCellDataToStream(ED_FLAG_ALL_CLIENTS|ED_FLAG_CELL_PUBLIC_AND_OWN|ED_FLAG_OWN_CLIENT, s, true);
	(*pBundle).append(*s);
	MemoryStream::ObjPool().reclaimObject(s);
	//clientMailbox()->postMail((*pBundle));
	sendToClient(ClientInterface::onUpdatePropertys, pBundle);
}
Пример #2
0
	shouldAutoArchive_ = 0;
	shouldAutoBackup_ = 0;
}

//-------------------------------------------------------------------------------------
PyObject* Base::onScriptGetAttribute(PyObject* attr)
{
	DEBUG_OP_ATTRIBUTE("get", attr)
		
	wchar_t* PyUnicode_AsWideCharStringRet0 = PyUnicode_AsWideCharString(attr, NULL);
	char* ccattr = strutil::wchar2char(PyUnicode_AsWideCharStringRet0);
	PyMem_Free(PyUnicode_AsWideCharStringRet0);
	
	// 如果访问了def持久化类容器属性
	// 由于没有很好的监测容器类属性内部的变化,这里使用一个折中的办法进行标脏
	PropertyDescription* pPropertyDescription = const_cast<ScriptDefModule*>(pScriptModule())->findPersistentPropertyDescription(ccattr);
	if(pPropertyDescription && (pPropertyDescription->getFlags() & ENTITY_BASE_DATA_FLAGS) > 0)
	{
		setDirty();
	}
	else if (strcmp(ccattr, "cellData") == 0)
	{
		setDirty();
	}
	
	free(ccattr);
	return ScriptObject::onScriptGetAttribute(attr);
}	

//-------------------------------------------------------------------------------------
PyObject* Base::pyGetCellMailbox()