当前位置: 首页>>代码示例>>C++>>正文


C++ NFCDataList::Int方法代码示例

本文整理汇总了C++中NFCDataList::Int方法的典型用法代码示例。如果您正苦于以下问题:C++ NFCDataList::Int方法的具体用法?C++ NFCDataList::Int怎么用?C++ NFCDataList::Int使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NFCDataList的用法示例。


在下文中一共展示了NFCDataList::Int方法的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;
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:60,代码来源:NFCEquipModule.cpp

示例2: CalHeroAllProperty

bool NFCHeroPropertyModule::CalHeroAllProperty(const NFGUID& self, const NFGUID& xHeroGUID, NFIDataList& xDataList)
{
	NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_PlayerHero());
	if (nullptr == pHeroRecord)
	{
		return false;
	}

	NFCDataList varFind;
	if (pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, xHeroGUID, varFind) != 1)
	{
		return false;
	}

	const int nRow = varFind.Int(0);

	NF_SHARE_PTR<NFIRecord> pHeroPropertyRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_HeroPropertyValue());
	if (nullptr == pHeroPropertyRecord)
	{
		return false;
	}

	NFCDataList xHeroPropertyValue;
	CalHeroBaseProperty(self, xHeroGUID, xHeroPropertyValue);

	NFCDataList xHeroTalentValue;
	CalHeroTalentProperty(self, xHeroGUID, xHeroTalentValue);

	NFCDataList xHeroEquipValue;
	CalHeroEquipProperty(self, xHeroGUID, xHeroEquipValue);

	for (int i = 0; i < pHeroPropertyRecord->GetCols(); ++i)
	{
		int nPropertyValue = 0;
		int nTalentValue = 0;
		int nEquipValue = 0;

		if (xHeroPropertyValue.GetCount() == pHeroPropertyRecord->GetCols())
		{
			nPropertyValue = xHeroPropertyValue.Int(i);
		}
		if (xHeroTalentValue.GetCount() == pHeroPropertyRecord->GetCols())
		{
			nTalentValue = xHeroTalentValue.Int(i);
		}
		if (xHeroEquipValue.GetCount() == pHeroPropertyRecord->GetCols())
		{
			nEquipValue = xHeroEquipValue.Int(i);
		}

		int nAllValue = nPropertyValue + nTalentValue + nEquipValue;

		xDataList.AddInt(nAllValue);
	}

	return true;
}
开发者ID:zh423328,项目名称:NFServer,代码行数:57,代码来源:NFCHeroPropertyModule.cpp

示例3: CalHeroEquipProperty

bool NFCHeroPropertyModule::CalHeroEquipProperty(const NFGUID& self, const NFGUID& xHeroGUID, NFIDataList& xDataList)
{
	NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_PlayerHero());
	if (nullptr == pHeroRecord)
	{
		return false;
	}

	NFCDataList varFind;
	if (pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, xHeroGUID, varFind) != 1)
	{
		return false;
	}

	const int nRow = varFind.Int(0);

	NF_SHARE_PTR<NFIRecord> pHeroPropertyRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_HeroPropertyValue());
	if (nullptr == pHeroPropertyRecord)
	{
		return false;
	}

	////////////////////Equip//////////////////////////////////////////////////////
	xDataList.Clear();

	for (int i = 0; i < pHeroPropertyRecord->GetCols(); ++i)
	{
		xDataList.AddInt(0);
	}

	for (int i = NFrame::Player::PlayerHero_Equip1; i <= NFrame::Player::PlayerHero_Equip6; ++i)
	{
		NFCDataList EquipDataList;
		const NFGUID xEquipID = pHeroRecord->GetObject(nRow, i);
		if (!xEquipID.IsNull() && m_pEquipPropertyModule->CalEquipProperty(self, xEquipID, EquipDataList))
		{
			//one equip
			for (int j = 0; j < pHeroPropertyRecord->GetCols(); ++j)
			{
				int nOldValue = xDataList.Int(j);
				int nEquipValue = EquipDataList.Int(j);

				xDataList.SetInt(j, nOldValue + nEquipValue);
			}
		}
	}

	return true;
}
开发者ID:zh423328,项目名称:NFServer,代码行数:49,代码来源:NFCHeroPropertyModule.cpp

示例4: 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;
}
开发者ID:zh423328,项目名称:NFServer,代码行数:60,代码来源:NFCPackModule.cpp

示例5: Upgrade

int NFCSLGBuildingModule::Upgrade(const NFGUID& self, const NFGUID& xBuilID)
{
    NF_SHARE_PTR<NFIRecord> pRecord = m_pKernelModule->FindRecord(self, "BuildingList");
    if (NULL == pRecord.get())
    {
        m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "this is no [BuildingList] Record!", "", __FUNCTION__, __LINE__);
        return 1;
    }

    NFCDataList var;
    pRecord->FindObject("BuildingGUID", xBuilID, var);
    if (var.GetCount() <= 0)
    {
        m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "there are no the building", xBuilID.ToString(), __FUNCTION__, __LINE__);
        return 1;
    }

    const int nRow = var.Int(0);
    const int nNeedTime = 20;
    const std::string strBuildID = pRecord->GetString(nRow, "BuildingID");

    //NFCDataList varHeart;
    //varHeart << xBuilID;
    m_pScheduleModule->AddSchedule(self, "OnUpgradeHeartBeat", this, &NFCSLGBuildingModule::OnUpgradeHeartBeat, /*varHeart,*/ nNeedTime, 1);

    
    pRecord->SetInt(nRow, "State", NFMsg::EBS_UPGRADE);
    pRecord->SetInt(nRow, "StateStartTime", pPluginManager->GetNowTime());
    pRecord->SetInt(nRow, "StateEndTime", pPluginManager->GetNowTime() + nNeedTime);

    return 0;
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:32,代码来源:NFCSLGBuildingModule.cpp

示例6: LeaveGuild

bool NFCWorldGuildModule::LeaveGuild( const NFIDENTID& self, const NFIDENTID& xGuildID )
{
    NF_SHARE_PTR<NFIObject> pGuildObject = m_pWorldGuildDataModule->GetGuild(xGuildID);
    if (!pGuildObject.get())
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList");
    if (!pMemberRecord.get())
    {
        return false;
    }

    NFCDataList varList;
    pMemberRecord->FindObject(NFMsg::GuildMemberList_GUID, self, varList);
    if (varList.GetCount() == 0)
    {
        return false;
    }

    const int nRow = varList.Int(0);
    
    return pMemberRecord->Remove(nRow);
}
开发者ID:joyfish,项目名称:NoahGameFrame,代码行数:25,代码来源:NFCWorldGuildModule.cpp

示例7: 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;
}
开发者ID:huimiao638,项目名称:NoahGameFrame,代码行数:25,代码来源:NFCWorldChatGroupModule.cpp

示例8: Boost

int NFCSLGBuildingModule::Boost(const NFGUID& self, const NFGUID& xBuilID)
{
    NF_SHARE_PTR<NFIRecord> pRecord = m_pKernelModule->FindRecord(self, "BuildingList");
    if (NULL == pRecord.get())
    {
        m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "this is no [BuildingList] Record!", "", __FUNCTION__, __LINE__);
        return 1;
    }

    NFCDataList var;
    pRecord->FindObject("BuildingGUID", xBuilID, var);
    if (var.GetCount() <= 0)
    {
        m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "there are no the building", xBuilID.ToString(), __FUNCTION__, __LINE__);
        return 1;
    }

    const int nRow = var.Int(0);
    const int nBoostTime = 20;//加速时间 // TO ADD
    const std::string strBuildID = pRecord->GetString(nRow, "BuildingID");

    //NFCDataList varHeart;
    //varHeart << xBuilID;
    m_pKernelModule->AddHeartBeat(self, "OnBoostHeartBeat", this, &NFCSLGBuildingModule::OnBoostHeartBeat, /*varHeart,*/ nBoostTime, 1);

    //修改建筑的状态
    pRecord->SetInt(nRow, "State", NFMsg::EBS_BOOST);
    pRecord->SetInt(nRow, "StateStartTime", NFTimeEx::GetNowTime());
    pRecord->SetInt(nRow, "StateEndTime", NFTimeEx::GetNowTime() + nBoostTime);

    return 0;
}
开发者ID:huimiao638,项目名称:NoahGameFrame,代码行数:32,代码来源:NFCSLGBuildingModule.cpp

示例9: 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;
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:32,代码来源:NFCEquipModule.cpp

示例10: 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);
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:35,代码来源:NFCEquipModule.cpp

示例11: 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);
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:29,代码来源:NFCEquipModule.cpp

示例12: KickGuildMmember

bool NFCWorldGuildModule::KickGuildMmember( const NFIDENTID& self, const NFIDENTID& xGuildID, const NFIDENTID& xMmember )
{
    NF_SHARE_PTR<NFIObject> pGuildObject = m_pWorldGuildDataModule->GetGuild(xGuildID);
    if (!pGuildObject.get())
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList");
    if (!pMemberRecord.get())
    {
        return false;
    }

    if (self == xMmember)
    {
        return false;
    }

    CheckPower(self, xGuildID, NFMsg::ReqAckOprGuildMember::EGAT_KICK);

    NFCDataList varList;
    pMemberRecord->FindObject(NFMsg::GuildMemberList_GUID, self, varList);
    if (varList.GetCount() == 0)
    {
        return false;
    }

    const int nRow = varList.Int(0);
    pMemberRecord->Remove(nRow);

    return true;
}
开发者ID:joyfish,项目名称:NoahGameFrame,代码行数:33,代码来源:NFCWorldGuildModule.cpp

示例13: OnHeroPropertyUpdate

bool NFCHeroPropertyModule::OnHeroPropertyUpdate(const NFGUID & self, const NFGUID & xHeroGUID)
{
	NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_PlayerHero());
	if (nullptr == pHeroRecord)
	{
		return false;
	}

	NFCDataList varFind;
	if (pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, xHeroGUID, varFind) != 1)
	{
		return false;
	}

	NF_SHARE_PTR<NFIRecord> pHeroPropertyRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_HeroPropertyValue());
	if (nullptr == pHeroPropertyRecord)
	{
		return false;
	}

	const int nRow = varFind.Int(0);

	NFCDataList xHeroAllValue;
	bool bRet = CalHeroAllProperty(self, xHeroGUID, xHeroAllValue);
	if (bRet)
	{
		pHeroPropertyRecord->AddRow(nRow, xHeroAllValue);
	}

	return true;
}
开发者ID:zh423328,项目名称:NFServer,代码行数:31,代码来源:NFCHeroPropertyModule.cpp

示例14: Ramdom

bool NFCEquipModule::Ramdom( const int nNowLevel , const int nMaxLevel)
{
    if (nNowLevel >= nMaxLevel)
    {
        return false;
    }

    if (nNowLevel < 0)
    {
        return false;
    }

    if (nMaxLevel <= 0)
    {
        return false;
    }

    NFCDataList varList;
    m_pKernelModule->Random(0, nMaxLevel, 1, varList);

    const NFINT64 nRandomNum = varList.Int(0);

    if (nRandomNum > nNowLevel && nRandomNum <= nMaxLevel)
    {
        return true;
    }

    return false;
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:29,代码来源:NFCEquipModule.cpp

示例15: UpGuildMmember

bool NFCWorldGuildModule::UpGuildMmember( const NFIDENTID& self, const NFIDENTID& xGuildID, const NFIDENTID& xMmember )
{
    NF_SHARE_PTR<NFIObject> pGuildObject = m_pWorldGuildDataModule->GetGuild(xGuildID);
    if (!pGuildObject.get())
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList");
    if (!pMemberRecord.get())
    {
        return false;
    }

    CheckPower(self, xGuildID, NFMsg::ReqAckOprGuildMember::EGAT_UP);

    NFCDataList varList;
    pMemberRecord->FindObject(NFMsg::GuildMemberList_GUID, self, varList);
    if (varList.GetCount() == 0)
    {
        return false;
    }

    const int nRow = varList.Int(0);

    const int nPower = pMemberRecord->GetInt(nRow, NFMsg::GuildMemberList_Power);

    if (nPower >= NFMsg::GUILD_POWER_TYPE_PRESIDENT)
    {
        return false;
    }

    pMemberRecord->SetInt(nRow, NFMsg::GuildMemberList_Power, (nPower + 1)) ;
	return true;
}
开发者ID:joyfish,项目名称:NoahGameFrame,代码行数:35,代码来源:NFCWorldGuildModule.cpp


注:本文中的NFCDataList::Int方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。