本文整理汇总了C++中NF_SHARE_PTR::GetPropertyInt方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetPropertyInt方法的具体用法?C++ NF_SHARE_PTR::GetPropertyInt怎么用?C++ NF_SHARE_PTR::GetPropertyInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::GetPropertyInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: OnEctypeSettleEvent
int NFCEctypeModule::OnEctypeSettleEvent(const NFIDENTID& self, int nResult, int nStar)
{
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(self);
if (!pObject.get())
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "player not exit", "", __FUNCTION__, __LINE__);
return 1;
}
int nSceneID = pObject->GetPropertyInt("SceneID");
if (nSceneID <= 0)
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "scene id error", "", __FUNCTION__, __LINE__);
return 1;
}
// 失败
if (nResult == 0)
{
int nLevel = m_pKernelModule->GetPropertyInt(self, "Level");
const std::string& strAccout = m_pKernelModule->GetPropertyString(self, "Account");
std::ostringstream stream;
stream << "[ExitEctype] Account[" << strAccout << "] Level[" << nLevel << "] Scene[" << nSceneID << "] [0]";
m_pLogModule->LogNormal(NFILogModule::NLL_INFO_NORMAL, self, stream, __FUNCTION__, __LINE__);
return 1;
}
if (!m_pSceneProcessModule->IsCloneScene(nSceneID))
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "player not int clone scene", "", __FUNCTION__, __LINE__);
return 1;
}
// 通关记录
// TODO
// 通关奖励
AddEctypeAward(self, nSceneID);
return 0;
}
示例3: ReqStation
void NFCMapModule::ReqStation(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen)
{
CLIENT_MSG_PROCESS(nSockIndex, nMsgID, msg, nLen, NFMsg::ReqHoldMapGrid);
if (!m_pElementModule->ExistElement(xMsg.map_title_id()))
{
return;
}
NFGUID xGuildID = NFINetModule::PBToNF(xMsg.guild_id());
NF_SHARE_PTR<NFIPropertyManager> xPropertyManager = m_pGuildRedisModule->GetGuildCachePropertyInfo(xGuildID);
if (!xPropertyManager)
{
return;
}
//remove form last grid
int nResourece = xPropertyManager->GetPropertyInt(NFrame::Guild::KingWarResource());
m_pBigMapRedisModule->AddGridStationInfo(xMsg.map_title_id(), xGuildID, nResourece);
}
示例4: OnEnterSceneEvent
int NFCSceneProcessModule::OnEnterSceneEvent( const NFIDENTID& self, const int nEventID, const NFIDataList& var )
{
if ( var.GetCount() != 4
|| !var.TypeEx(TDATA_TYPE::TDATA_OBJECT, TDATA_TYPE::TDATA_INT,
TDATA_TYPE::TDATA_INT, TDATA_TYPE::TDATA_INT, TDATA_TYPE::TDATA_UNKNOWN))
{
return 0;
}
NFIDENTID ident = var.Object( 0 );
int nType = var.Int( 1 );
int nTargetScene = var.Int( 2 );
int nTargetGroupID = var.Int( 3 );
int nOldSceneID = m_pKernelModule->GetPropertyInt( self, "SceneID" );
char szSceneID[MAX_PATH] = {0};
sprintf(szSceneID, "%d", nTargetScene);
#ifdef NF_USE_ACTOR
int nActorID = m_pElementInfoModule->GetPropertyInt(szSceneID, "ActorID");
int nSelfActorID = pPluginManager->GetActorID();
if (nSelfActorID != nActorID)
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, ident, "target scene not runing in this server", nTargetScene);
return 1;
#endif
if ( self != ident )
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, ident, "you are not you self, but you want to entry this scene", nTargetScene);
return 1;
}
const int nNowContainerID = m_pKernelModule->GetPropertyInt(self, "SceneID");
const int nNowGroupID = m_pKernelModule->GetPropertyInt(self, "GroupID");
if (nNowContainerID == nTargetScene
&& nNowGroupID == nTargetGroupID)
{
//本来就是这个层这个场景就别切换了
m_pLogModule->LogNormal(NFILogModule::NLL_INFO_NORMAL, ident, "in same scene and group but it not a clone scene", nTargetScene);
return 1;
}
nTargetGroupID = CreateCloneScene( nTargetScene, nTargetGroupID, "File.xml", NFCDataList() );
if ( nTargetGroupID <= 0 )
{
m_pLogModule->LogNormal(NFILogModule::NLL_INFO_NORMAL, ident, "CreateCloneScene failed", nTargetScene);
return 0;
}
//得到坐标
float fX = 0.0f;
float fY = 0.0f;
float fZ = 0.0f;
const std::string& strRelivePosList = m_pElementInfoModule->GetPropertyString(szSceneID, "RelivePos");
NFCDataList valueRelivePosList( strRelivePosList.c_str(), ";" );
if ( valueRelivePosList.GetCount() >= 1 )
{
NFCDataList valueRelivePos( valueRelivePosList.String( 0 ).c_str(), "," );
if ( valueRelivePos.GetCount() == 3 )
{
fX = boost::lexical_cast<float>( valueRelivePos.String( 0 ) );
fY = boost::lexical_cast<float>( valueRelivePos.String( 1 ) );
fZ = boost::lexical_cast<float>( valueRelivePos.String( 2 ) );
}
}
NFCDataList xSceneResult( var );
xSceneResult.Add( fX );
xSceneResult.Add( fY );
xSceneResult.Add( fZ );
m_pEventProcessModule->DoEvent( self, NFED_ON_OBJECT_ENTER_SCENE_BEFORE, xSceneResult );
if(!m_pKernelModule->SwitchScene( self, nTargetScene, nTargetGroupID, fX, fY, fZ, 0.0f, var ))
{
m_pLogModule->LogNormal(NFILogModule::NLL_INFO_NORMAL, ident, "SwitchScene failed", nTargetScene);
return 0;
}
xSceneResult.Set(3, NFINT64(nTargetGroupID));//spicial
m_pEventProcessModule->DoEvent( self, NFED_ON_OBJECT_ENTER_SCENE_RESULT, xSceneResult );
return 0;
}
int NFCSceneProcessModule::OnLeaveSceneEvent( const NFIDENTID& object, const int nEventID, const NFIDataList& var )
{
if (1 != var.GetCount()
|| !var.TypeEx(TDATA_TYPE::TDATA_INT, TDATA_TYPE::TDATA_UNKNOWN))
{
return -1;
}
NFINT32 nOldGroupID = var.Int(0);
NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(object);
if (pObject.get() && nOldGroupID > 0)
//.........这里部分代码省略.........