本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}