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


C++ NF_SHARE_PTR::GetPropertyObject方法代码示例

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


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

示例1: SetKingForGrid

void NFCMapModule::SetKingForGrid(const std::string& strTitleID, const NFGUID& xGuildID)
{
	if (!m_pElementModule->ExistElement(strTitleID))
	{
		return;
	}

	NFMsg::BigMapGridBaseInfo xGridBaseInfo;
	if (!m_pBigMapRedisModule->GetGridBaseInfo(strTitleID, xGridBaseInfo))
	{
		return;
	}

	//get all guild information to set in grid base info
	NF_SHARE_PTR<NFIPropertyManager> xPropertyManager = m_pGuildRedisModule->GetGuildCachePropertyInfo(xGuildID);
	const NFGUID xGUID = xPropertyManager->GetPropertyObject(NFrame::Guild::GuildID());
	const std::string& strIcon = xPropertyManager->GetPropertyString(NFrame::Guild::GuildIcon());
	const int nLevel = xPropertyManager->GetPropertyInt(NFrame::Guild::GuildLevel());
	const int nMemberCount = xPropertyManager->GetPropertyInt(NFrame::Guild::GuildMemeberCount());
	const int nResource = xPropertyManager->GetPropertyInt(NFrame::Guild::KingWarResource());

	xGridBaseInfo.mutable_guild_info()->mutable_id()->CopyFrom(NFINetModule::NFToPB(xGUID));
	xGridBaseInfo.mutable_guild_info()->set_level(nLevel);
	xGridBaseInfo.mutable_guild_info()->set_count(nMemberCount);
	xGridBaseInfo.mutable_guild_info()->set_icon(strIcon);
	xGridBaseInfo.mutable_guild_info()->set_resource(nResource);

	m_pBigMapRedisModule->SetGridBaseInfo(strTitleID, xGridBaseInfo);
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例2: KickTeamMmember

bool NFCTeamModule::KickTeamMmember( const NFGUID& self, const NFGUID& xTeamID, const NFGUID& xMmember )
{
    NF_SHARE_PTR<NFIRecordManager> pRecordManager = m_pCommonRedisModule->GetCacheRecordInfo(xTeamID, NFrame::Team::ThisName());
    if (!pRecordManager)
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = pRecordManager->GetElement(NFrame::Team::MemberList::ThisName());
    if (!pMemberRecord.get())
    {
        return false;
    }

    NF_SHARE_PTR<NFIPropertyManager> pPropertyManager = m_pCommonRedisModule->GetCachePropertyInfo(xTeamID, NFrame::Team::ThisName());
    if (!pPropertyManager)
    {
        return false;
    }

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

	const NFGUID xID = pPropertyManager->GetPropertyObject(NFrame::Team::Captain());
	if (self != xID)
	{
		return false;
	}

    NFDataList varList;
    pMemberRecord->FindObject(NFrame::Team::MemberList::GUID, self, varList);
    if (varList.GetCount() == 0)
    {
        return false;
    }

    const int nRow = varList.Int32(0);
    if (!pMemberRecord->Remove(nRow))
    {
        return false;
    }
    
    return m_pCommonRedisModule->SaveCacheRecordInfo(xTeamID, pRecordManager);
}
开发者ID:ik3210,项目名称:NoahGameFrame,代码行数:46,代码来源:NFCTeamModule.cpp

示例3: OnTeamEnterEctypeProcess

void NFCTeamModule::OnTeamEnterEctypeProcess(const NFSOCK nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen)
{
    CLIENT_MSG_PROCESS( nMsgID, msg, nLen, NFMsg::ReqTeamEnterEctype);

    NFGUID xTeam = NFINetModule::PBToNF(xMsg.team_id());
    NFGUID xSelfID = NFINetModule::PBToNF(xMsg.self_id());
    NF_SHARE_PTR<NFIPropertyManager> pPropertyManager = m_pCommonRedisModule->GetCachePropertyInfo(xTeam, NFrame::Team::ThisName());
    if (pPropertyManager)
    {
        NFGUID xCaptain = pPropertyManager->GetPropertyObject(NFrame::Team::Captain());
        if (xCaptain == xSelfID)
        {
            BroadcastMsgToTeam(nPlayerID, xTeam, NFMsg::EGMI_REQ_TEAM_ENTER_ECTYPE, xMsg);
            return;
        }
    }

	m_pNetModule->SendMsgPB(NFMsg::EGMI_ACK_TEAM_ENTER_ECTYPE, xMsg, nSockIndex, nPlayerID);
}
开发者ID:ik3210,项目名称:NoahGameFrame,代码行数:19,代码来源:NFCTeamModule.cpp

示例4: JoinGuild

bool NFCGuildModule::JoinGuild( const NFGUID& self, const NFGUID& xGuildID )
{
    NF_SHARE_PTR<NFIObject> pGuildObject = m_pGuildDataModule->GetGuild(xGuildID);
    if (!pGuildObject.get())
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = m_pKernelModule->FindRecord(xGuildID, NFrame::Guild::R_GuildMemberList());
    if (!pMemberRecord.get())
    {
        return false;
    }

    NFDataList varList;
    pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList);
    if (varList.GetCount() > 0)
    {
        return false;
    }

    const NFINT64 nCount = m_pKernelModule->GetPropertyInt(xGuildID, NFrame::Guild::GuildMemeberCount());
    if (nCount >= m_pKernelModule->GetPropertyInt(xGuildID, NFrame::Guild::GuildMemeberMaxCount()))
    {
        //limit
        return false;
    }

    NFDataList varData;

    std::string strName ;
    int nLevel = 0;
    int nJob = 0;
    int nDonation = 0;
    int nReceive = 0;
    int nVIP = 0;
    int nOnLine = 0;
    int nPower = NFMsg::GUILD_POWER_TYPE_NORMAL;

    const NFGUID& xPresident = pGuildObject->GetPropertyObject(NFrame::Guild::PresidentID());
    if (xPresident == self)
    {
        nPower = NFMsg::GUILD_POWER_TYPE_PRESIDENT;
    }
    
    int nTitle = 0;
    int nOnlineGameID = 0;

    m_pGuildDataModule->GetPlayerGameID(self, nOnlineGameID);
    m_pGuildDataModule->GetPlayerInfo(self, strName, nLevel, nJob, nDonation, nVIP);

    varData << self << strName << (NFINT64)nLevel << (NFINT64)nJob << (NFINT64)nDonation << (NFINT64)nReceive << (NFINT64)nVIP << (NFINT64)nOnLine << (NFINT64)nPower << nTitle << nOnlineGameID ;

    if (pMemberRecord->AddRow(-1, varData) < 0)
    {
        return false;
    }
    
    m_pKernelModule->SetPropertyInt(xGuildID, NFrame::Guild::GuildMemeberCount(), nCount+1);

	return true;
}
开发者ID:,项目名称:,代码行数:62,代码来源:

示例5: GetTeamInfo

bool NFCTeamModule::GetTeamInfo(const NFGUID& self, const NFGUID& xTeam, NFMsg::TeamInfo& xTeamInfo)
{
    if (xTeam.IsNull())
    {
        return false;
    }

    NF_SHARE_PTR<NFIPropertyManager> pPropertyManager = m_pCommonRedisModule->GetCachePropertyInfo(xTeam, NFrame::Team::ThisName());
    NF_SHARE_PTR<NFIRecordManager> pRecordManager = m_pCommonRedisModule->GetCacheRecordInfo(xTeam, NFrame::Team::ThisName());

    if (!pPropertyManager)
    {
        return false;
    }

    if (!pRecordManager)
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = pRecordManager->GetElement(NFrame::Team::MemberList::ThisName());
    if (!pMemberRecord.get())
    {
        return false;
    }

    NFGUID xCaptain = pPropertyManager->GetPropertyObject(NFrame::Team::Captain());
    if (!xCaptain.IsNull())
    {
        return false;
    }

    *xTeamInfo.mutable_team_id() = NFINetModule::NFToPB(xTeam);
    *xTeamInfo.mutable_captain_id() = NFINetModule::NFToPB(xCaptain);

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

        NFMsg::TeammemberInfo* pMemberinfo = xTeamInfo.add_teammemberinfo();
        if (!pMemberinfo)
        {
            continue;
        }


        std::string strName = pMemberRecord->GetString(i, NFrame::Team::MemberList::Name);
        const int nLevel = pMemberRecord->GetInt32(i, NFrame::Team::MemberList::Level);
        const int nJob = pMemberRecord->GetInt32(i, NFrame::Team::MemberList::Job);
        const NFGUID xPlayerID = pMemberRecord->GetObject(i, NFrame::Team::MemberList::GUID);

        pMemberinfo->set_name(strName);
        pMemberinfo->set_nlevel(nLevel);
        pMemberinfo->set_job(nJob);
        pMemberinfo->set_headicon("");
        *pMemberinfo->mutable_player_id() = NFINetModule::NFToPB(xPlayerID);
    }

    return true;
}
开发者ID:ik3210,项目名称:NoahGameFrame,代码行数:63,代码来源:NFCTeamModule.cpp


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