本文整理汇总了C++中NF_SHARE_PTR::GetRecordManager方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetRecordManager方法的具体用法?C++ NF_SHARE_PTR::GetRecordManager怎么用?C++ NF_SHARE_PTR::GetRecordManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::GetRecordManager方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DressEquipForHero
bool NFCEquipModule::DressEquipForHero(const NFGUID& self, const NFGUID& hero, const NFGUID& id)
{
if (id.IsNull() || self.IsNull() || hero.IsNull())
{
return false;
}
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(self);
if (NULL == pObject)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pBagRecord = pObject->GetRecordManager()->GetElement(NFrame::Player::R_BagEquipList());
if (!pBagRecord)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pHeroRecord = pObject->GetRecordManager()->GetElement(NFrame::Player::R_PlayerHero());
if (!pHeroRecord)
{
return false;
}
NFCDataList xEquipDataList;
pBagRecord->FindObject(NFrame::Player::BagEquipList_GUID, id, xEquipDataList);
if (xEquipDataList.GetCount() != 1)
{
return false;
}
NFCDataList xHeroDataList;
pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, hero, xHeroDataList);
if (xHeroDataList.GetCount() != 1)
{
return false;
}
const int nEquipRow = xEquipDataList.Int(0);
const int nHeroRow = xHeroDataList.Int(0);
const std::string& strEquipID = pBagRecord->GetString(nEquipRow, NFrame::Player::BagEquipList_ConfigID);
const int nEquipPos = m_pElementModule->GetPropertyInt(strEquipID, NFrame::Equip::ItemSubType());
if (nEquipRow < 0
|| nHeroRow < 0
|| strEquipID.empty()
|| nEquipPos < 0
|| nEquipPos > (NFrame::Player::PlayerHero_Equip6 - NFrame::Player::PlayerHero_Equip1))
{
return false;
}
//so there have any bind?
//hero, position
pHeroRecord->SetObject(nHeroRow, nEquipPos + NFrame::Player::PlayerHero_Equip1, id);
pBagRecord->SetObject(nEquipRow, NFrame::Player::BagEquipList_WearGUID, hero);
return false;
}
示例2: JoinGroup
bool NFCWorldChatGroupModule::JoinGroup( const NFGUID& self, const NFGUID& xGroupID )
{
NF_SHARE_PTR<NFIObject> pGroup = GetGroup(xGroupID);
if (NULL == pGroup)
{
return false;
}
NF_SHARE_PTR<NFIRecord>pRecord = pGroup->GetRecordManager()->GetElement("GroupMemberList");
if (NULL == pRecord)
{
return false;
}
NFCDataList varFind;
if (pRecord->FindObject(0, self, varFind) > 0)
{
return false;
}
NFCDataList varRow;
varRow << self << 0 << 0;
int nRet = pRecord->AddRow(-1, varRow);
if (nRet >= 0)
{
return true;
}
return false;
}
示例3: GetEquipElementLevel
int NFCEquipModule::GetEquipElementLevel(const NFGUID & self, const NFGUID & id, NFrame::Player::BagEquipList eIndex)
{
if (id.IsNull() || self.IsNull())
{
return -1;
}
if (eIndex > NFrame::Player::BagEquipList_ElementLevel5_POISON
|| eIndex < NFrame::Player::BagEquipList_ElementLevel1_FIRE)
{
return -1;
}
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(self);
if (NULL == pObject)
{
return -1;
}
NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement(NFrame::Player::R_BagEquipList());
if (!pRecord)
{
return -1;
}
NFCDataList xDataList;
pRecord->FindObject(NFrame::Player::BagEquipList_GUID, id, xDataList);
if (xDataList.GetCount() != 1)
{
return -1;
}
const int nRow = xDataList.Int(0);
return pRecord->GetInt(nRow, eIndex);
}
示例4: AddEquipIntensifyLevel
bool NFCEquipModule::AddEquipIntensifyLevel(const NFGUID& self, const NFGUID& id)
{
if (id.IsNull() || self.IsNull())
{
return false;
}
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(self);
if (NULL == pObject)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement(NFrame::Player::R_BagEquipList());
if (!pRecord)
{
return false;
}
NFCDataList xDataList;
pRecord->FindObject(NFrame::Player::BagEquipList_GUID, id, xDataList);
if (xDataList.GetCount() != 1)
{
return false;
}
const int nRow = xDataList.Int(0);
const int nLevel = pRecord->GetInt(nRow, NFrame::Player::BagEquipList_IntensifyLevel);
pRecord->SetInt(nRow, NFrame::Player::BagEquipList_IntensifyLevel, nLevel + 1);
return true;
}
示例5: NFCDataList
bool HelloWorld6Module::AfterInit()
{
//初始化完毕
std::cout << "Hello, world6, AfterInit" << std::endl;
m_pKernelModule = pPluginManager->FindModule<NFIKernelModule>("NFCKernelModule");
m_pEventProcessModule = pPluginManager->FindModule<NFIEventProcessModule>("NFCEventProcessModule");
m_pElementInfoModule = pPluginManager->FindModule<NFIElementInfoModule>("NFCElementInfoModule");
m_pLuaScriptModule = pPluginManager->FindModule<NFILuaScriptModule>("NFCLuaScriptModule");
//assert( NULL != m_pLuaScriptModule);
m_pKernelModule->CreateScene(1, "");
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->CreateObject(NFGUID(), 1, 0, "Player", "", NFCDataList());
if ( !pObject.get() )
{
return false;
}
NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement("TaskList");
if ( pRecord.get() )
{
NFCDataList var;
var << "Task_From_C++";
var << 0;
pRecord->AddRow(-1, var);
}
pObject->SetPropertyInt("MAXHP",100);
m_pEventProcessModule->DoEvent(pObject->Self(), 2222, NFCDataList());
return true;
}
示例6: GetEquipHoleCount
int NFCEquipModule::GetEquipHoleCount(const NFGUID & self, const NFGUID & id)
{
if (id.IsNull() || self.IsNull())
{
return false;
}
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(self);
if (NULL == pObject)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement(NFrame::Player::R_BagEquipList());
if (!pRecord)
{
return false;
}
NFCDataList xDataList;
pRecord->FindObject(NFrame::Player::BagEquipList_GUID, id, xDataList);
if (xDataList.GetCount() != 1)
{
return false;
}
const int nRow = xDataList.Int(0);
return pRecord->GetInt(nRow, NFrame::Player::BagEquipList_SlotCount);
}
示例7: TrailObjectData
int NFCPropertyTrailModule::TrailObjectData(const NFGUID& self)
{
NF_SHARE_PTR<NFIObject> xObject = m_pKernelModule->GetObject(self);
if (nullptr == xObject)
{
return -1;
}
NF_SHARE_PTR<NFIPropertyManager> xPropertyManager = xObject->GetPropertyManager();
if (nullptr != xPropertyManager)
{
NF_SHARE_PTR<NFIProperty> xProperty = xPropertyManager->First();
while (nullptr != xProperty)
{
m_pKernelModule->AddPropertyCallBack(self, xProperty->GetKey(), this, &NFCPropertyTrailModule::OnObjectPropertyEvent);
xProperty = xPropertyManager->Next();
}
}
NF_SHARE_PTR<NFIRecordManager> xRecordManager = xObject->GetRecordManager();
if (nullptr != xRecordManager)
{
NF_SHARE_PTR<NFIRecord> xRecord = xRecordManager->First();
while (nullptr != xRecord)
{
m_pKernelModule->AddRecordCallBack(self, xRecord->GetName(), this, &NFCPropertyTrailModule::OnObjectRecordEvent);
xRecord = xRecordManager->Next();
}
}
return 0;
}
示例8: AttachData
void NFCCreateRoleModule::AttachData(const NFGUID & self)
{
auto it = mxObjectDataCache.find(self);
if (it != mxObjectDataCache.end())
{
NF_SHARE_PTR<NFIObject> xObject = m_pKernelModule->GetObject(self);
if (xObject)
{
NF_SHARE_PTR<NFIPropertyManager> xPropManager = xObject->GetPropertyManager();
NF_SHARE_PTR<NFIRecordManager> xRecordManager = xObject->GetRecordManager();
if (xPropManager)
{
ConvertPBToPropertyManager(it->second.property(), xPropManager);
}
if (xRecordManager)
{
ConvertPBToRecordManager(it->second.record(), xRecordManager);
}
mxObjectDataCache.erase(it);
}
}
}
示例9: SaveData
void NFCCreateRoleModule::SaveData(const NFGUID & self)
{
NF_SHARE_PTR<NFIObject> xObject = m_pKernelModule->GetObject(self);
if (xObject)
{
NF_SHARE_PTR<NFIPropertyManager> xPropManager = xObject->GetPropertyManager();
NF_SHARE_PTR<NFIRecordManager> xRecordManager = xObject->GetRecordManager();
NFMsg::RoleDataPack xDataPack;
*xDataPack.mutable_id() = NFINetModule::NFToPB(self);
*(xDataPack.mutable_property()->mutable_player_id()) = NFINetModule::NFToPB(self);
*(xDataPack.mutable_record()->mutable_player_id()) = NFINetModule::NFToPB(self);
if (xPropManager)
{
ConvertPropertyManagerToPB(xPropManager, xDataPack.mutable_property());
}
if (xRecordManager)
{
ConvertRecordManagerToPB(xRecordManager, xDataPack.mutable_record());
}
m_pNetClientModule->SendSuitByPB(NF_SERVER_TYPES::NF_ST_DB, self.GetData(), NFMsg::EGMI_REQ_SAVE_ROLE_DATA, xDataPack);
}
}
示例10: DeleteEquip
bool NFCPackModule::DeleteEquip( const NFGUID& self, const NFGUID& id )
{
if (id.IsNull())
{
return false;
}
//删除3个地方,背包,英雄穿戴,玩家穿戴
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject( self );
if (nullptr == pObject)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement( NFrame::Player::R_BagEquipList() );
if (nullptr == pRecord)
{
return false;
}
NFCDataList varFindResult;
int nFindRowCount = pRecord->FindObject(NFrame::Player::BagItemList_ConfigID, id, varFindResult);
if (nFindRowCount > 0)
{
int nTotalCount = 0;
for (int i = 0; i < varFindResult.GetCount(); ++i)
{
int nFindRow = varFindResult.Int(i);
pRecord->Remove(nFindRow);
}
}
return true;
}
示例11: DeleteItem
bool NFCPackModule::DeleteItem( const NFGUID& self, const std::string& strItemConfigID, const int nCount )
{
if(nCount <= 0)
{
return false;
}
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject( self );
if ( NULL == pObject )
{
return false;
}
//还得确定有这个装备
if (!m_pElementModule->ExistElement(NFrame::Item::ThisName(), strItemConfigID))
{
return false;
}
NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement( NFrame::Player::R_BagItemList() );
if (!pRecord)
{
return false;
}
NFCDataList varFindResult;
int nFindRowCount = pRecord->FindString(NFrame::Player::BagItemList_ConfigID, strItemConfigID, varFindResult);
if (nFindRowCount > 0)
{
int nNeedDelCount = nCount;
for (int i = 0; i < varFindResult.GetCount(); ++i)
{
int nFindRow = varFindResult.Int(i);
int nOldCount = pRecord->GetInt(nFindRow, NFrame::Player::BagItemList_ItemCount);
if (nOldCount > nNeedDelCount)
{
int nNewCount = nOldCount - nNeedDelCount;
pRecord->SetInt(nFindRow, NFrame::Player::BagItemList_ItemCount, nNewCount);
nNeedDelCount = 0;
}
else if (nOldCount == nNeedDelCount)
{
pRecord->Remove(nFindRow);
nNeedDelCount = 0;
}
else if (nOldCount < nNeedDelCount)
{
pRecord->Remove(nFindRow);
nNeedDelCount -= nOldCount;
}
}
if (nNeedDelCount <= 0)
{
return true;
}
}
return false;
}
示例12: Offeline
bool NFCWorldChatGroupModule::Offeline( const NFGUID& self, const NFGUID& xGroupID )
{
NF_SHARE_PTR<NFIObject> pGroup = GetGroup(xGroupID);
if (NULL == pGroup)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pRecord = pGroup->GetRecordManager()->GetElement("GroupMemberList");
if (NULL == pRecord)
{
return false;
}
NFCDataList varList;
if (pRecord->FindObject(NFrame::ChatGroup::GroupMemberList_GUID, self, varList) <= 0)
{
return false;
}
const int nRow = varList.Int(0);
pRecord->SetInt(nRow, NFrame::ChatGroup::GroupMemberList_Online, 0);
pRecord->SetInt(nRow, NFrame::ChatGroup::GroupMemberList_GameID, 0);
return true;
}
示例13: GetElement
NF_SHARE_PTR<NFIRecordManager> NFCElementInfoModule::GetRecordManager(const std::string& strConfigName)
{
NF_SHARE_PTR<ElementConfigInfo> pElementInfo = GetElement(strConfigName);
if (pElementInfo.get())
{
return pElementInfo->GetRecordManager();
}
return NULL;
}
示例14: GetElement
NF_SHARE_PTR<NFIRecordManager> NFCClassModule::GetClassRecordManager(const std::string& strClassName)
{
NF_SHARE_PTR<NFIClass> pClass = GetElement(strClassName);
if (pClass)
{
return pClass->GetRecordManager();
}
return NULL;
}
示例15: LogObjectData
int NFCPropertyTrailModule::LogObjectData(const NFGUID& self)
{
NF_SHARE_PTR<NFIObject> xObject = m_pKernelModule->GetObject(self);
if (nullptr == xObject)
{
return -1;
}
NF_SHARE_PTR<NFIPropertyManager> xPropertyManager = xObject->GetPropertyManager();
if (nullptr != xPropertyManager)
{
NF_SHARE_PTR<NFIProperty> xProperty = xPropertyManager->First();
while (nullptr != xProperty)
{
std::ostringstream stream;
stream << " Start trail ";
stream << xProperty->ToString();
m_pLogModule->LogProperty(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xProperty->GetKey(), stream.str(), __FUNCTION__, __LINE__);
xProperty = xPropertyManager->Next();
}
}
NF_SHARE_PTR<NFIRecordManager> xRecordManager = xObject->GetRecordManager();
if (nullptr != xRecordManager)
{
NF_SHARE_PTR<NFIRecord> xRecord = xRecordManager->First();
while (nullptr != xRecord)
{
for (int i = 0; i < xRecord->GetRows(); ++i)
{
NFCDataList xDataList;
bool bRet = xRecord->QueryRow(i, xDataList);
if (bRet)
{
std::ostringstream stream;
stream << " Start trail Row[" << i << "]";
for (int j = 0; j < xDataList.GetCount(); ++j)
{
stream << " [" << j << "] " << xDataList.StringValEx(j);
}
m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(), __FUNCTION__, __LINE__);
}
}
xRecord = xRecordManager->Next();
}
}
return 0;
}