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


C++ NFCDataList类代码示例

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


在下文中一共展示了NFCDataList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例2: 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

示例3: SetValue

void NFCProperty::SetValue(const NFIDataList::TData& TData)
{
    if (eType != TData.nType)
    {
        return;
    }

    if (!m_pTData.get())
    {
        if (!NFIDataList::Valid(TData))
        {
            return;
        }

        m_pTData = NF_SHARE_PTR<NFIDataList::TData>(NF_NEW NFIDataList::TData());
        m_pTData->nType = TData.nType;
        m_pTData->variantData = TData.variantData;
    }

    NFCDataList oldValue;
    oldValue.Append(*m_pTData);

    m_pTData->variantData = TData.variantData;

    NFCDataList newValue;
    newValue.Append(*m_pTData);

    OnEventHandler(oldValue , newValue);
}
开发者ID:joyfish,项目名称:NoahGameFrame,代码行数:29,代码来源:NFCProperty.cpp

示例4: 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

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

示例6: 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

示例7: CheckPower

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

示例8: 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

示例9: 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

示例10: GetGroup

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

示例11: GetAroundObject

const int NFCGridModule::GetAroundObject(NFCSceneGridInfo* pGridInfo, NFIDataList& objectList, EGRID_AROUND eAround /*= EGRID_AROUND_9 */)
{
    if (!pGridInfo)
    {
        return 0;
    }

    NFCDataList gridList;
    if (GetAroundGrid(pGridInfo, gridList, eAround) > 0)
    {
        for (int i = 0; i < gridList.GetCount(); i++)
        {
            NFCSceneGridInfo* pGridInfo = (NFCSceneGridInfo*)(gridList.Pointer(i));
            if (pGridInfo)
            {
                NFIDENTID ident;
                bool bRet = pGridInfo->First(ident);
                while (bRet)
                {
                    objectList.Add(ident);
                    bRet = pGridInfo->Next(ident);
                }
            }
        }
    }

    return objectList.GetCount();
}
开发者ID:ming871,项目名称:NoahGameFrame,代码行数:28,代码来源:NFCGridModule.cpp

示例12: MemberOffeline

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


    NF_SHARE_PTR<NFIRecord> pMemberRecord = m_pKernelModule->FindRecord(xGuild, "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);
    pMemberRecord->SetInt(nRow, NFMsg::GuildMemberList_Online, 0);
    pMemberRecord->SetInt(nRow, NFMsg::GuildMemberList_GameID, 0);
    return true;
}
开发者ID:joyfish,项目名称:NoahGameFrame,代码行数:27,代码来源:NFCWorldGuildModule.cpp

示例13: 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

示例14: GetOnlineMember

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

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

    for (int i = 0; i< pMemberRecord->GetRows(); i++)
    {
        if (!pMemberRecord->IsUsed(i))
        {
            continue;
        }

        const NFINT64 nOnline = pMemberRecord->GetInt(i, NFMsg::GuildMemberList_Online);
        const NFINT64 nGameID = pMemberRecord->GetInt(i, NFMsg::GuildMemberList_GameID);
        const NFIDENTID& xID = pMemberRecord->GetObject(i, NFMsg::GuildMemberList_GUID);
        if (nOnline > 0 && !xID.IsNull())
        {

            varMemberList.Add(xID);
            varGameList.Add(nGameID);
        }
    }

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

示例15: switch

int NFCPropertyTrailModule::OnObjectRecordEvent(const NFGUID& self, const RECORD_EVENT_DATA& xEventData, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar)
{
    std::ostringstream stream;
    NF_SHARE_PTR<NFIRecord> xRecord = m_pKernelModule->FindRecord(self, xEventData.strRecordName);
    if (nullptr == xRecord)
    {
        return 0;
    }

    switch (xEventData.nOpType)
    {
        case NFIRecord::RecordOptype::Add:
        {
            NFCDataList xDataList;
            bool bRet = xRecord->QueryRow(xEventData.nRow, xDataList);
            if (bRet)
            {
                stream << " Trail Add Row[" << xEventData.nRow << "]";

                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__);
            }
        }
        break;
        case NFIRecord::RecordOptype::Del:
        {
            stream << " Trail Del Row[" << xEventData.nRow << "]";
            m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(),  __FUNCTION__, __LINE__);
        }
        break;
        case NFIRecord::RecordOptype::Swap:
        {
            stream << " Trail Swap Row[" << xEventData.nRow << "] Row[" << xEventData.nCol << "]";
            m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(),  __FUNCTION__, __LINE__);
        }
        break;
        case NFIRecord::RecordOptype::Create:
            break;
        case NFIRecord::RecordOptype::Update:
        {
            stream << " Trail UpData Row[" << xEventData.nRow << "] Col[" << xEventData.nCol << "]";
            stream << " [Old] " << oldVar.StringValEx();
            stream << " [New] " << newVar.StringValEx();
            m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(),  __FUNCTION__, __LINE__);
        }
        break;
        case NFIRecord::RecordOptype::Cleared:
            break;
        case NFIRecord::RecordOptype::Sort:
            break;
        default:
            break;
    }

    return 0;
}
开发者ID:zh423328,项目名称:NFServer,代码行数:60,代码来源:NFCPropertyTrailModule.cpp


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