bool NFCEctypeModule::CanEntryCloneScene(const NFIDENTID self, const int nContainerID) { std::string strSceneID = boost::lexical_cast<std::string>(nContainerID); //如果没找到,就判断是否是第一个场景IsFirstCloneScene int nLevel = m_pKernelModule->GetPropertyInt(self, "Level"); if (nLevel < m_pElementInfoModule->GetPropertyInt(strSceneID, "SceneLevelLimit")) { m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "Level limit for scene:" + strSceneID, nLevel, __FUNCTION__, __LINE__); return false; } //更改后则直接看是否存在 NF_SHARE_PTR<NFIRecord> pRecord = m_pKernelModule->FindRecord(self, "EctypeList"); if (!pRecord.get()) { return false; } NFCDataList valNormalResult; pRecord->FindInt(EXTYPE_RC_SCENEID, nContainerID, valNormalResult); if (valNormalResult.GetCount() <= 0) { m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "no this scene in record", nContainerID, __FUNCTION__, __LINE__); return false; } return true; }
bool NFCEctypeModule::AddEctypeActiveState(const NFIDENTID self, const int nContainerID) { NF_SHARE_PTR<NFIRecord> pRecord = m_pKernelModule->FindRecord(self, "EctypeList"); if (pRecord.get() && nContainerID > 0) { NFCDataList valNormalResult; pRecord->FindInt(EXTYPE_RC_SCENEID, nContainerID, valNormalResult); if (valNormalResult.GetCount() <= 0) { NFCDataList valValue; valValue.AddInt(nContainerID); valValue.AddInt(ECS_HAS_OPEN); valValue.AddInt(0); pRecord->AddRow(-1, valValue); m_pLogModule->LogNormal(NFILogModule::NLL_INFO_NORMAL, self, "EctypeList AddEctypeActiveState", nContainerID); } } return true; }