本文整理汇总了C++中NF_SHARE_PTR::HSet方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::HSet方法的具体用法?C++ NF_SHARE_PTR::HSet怎么用?C++ NF_SHARE_PTR::HSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::HSet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateRole
bool NFCAccountRedisModule::CreateRole(const std::string & strAccount, const std::string & strRoleName, const NFGUID & id)
{
std::string strAccountKey = m_pCommonRedisModule->GetAccountCacheKey(strAccount);
NF_SHARE_PTR<NFINoSqlDriver> xNoSqlDriver = m_pNoSqlModule->GetDriverBySuit(strAccount);
if (xNoSqlDriver)
{
if (xNoSqlDriver->Exists(strAccountKey) && !xNoSqlDriver->Exists(strRoleName))
{
xNoSqlDriver->HSet(strAccountKey, NFrame::Player::Name(), strRoleName);
xNoSqlDriver->HSet(strAccountKey, NFrame::Player::ID(), id.ToString());
NF_SHARE_PTR<NFINoSqlDriver> xRoleNameNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
if (xRoleNameNoSqlDriver)
{
xRoleNameNoSqlDriver->HSet(strRoleName, NFrame::Player::ID(), id.ToString());
}
/*
std::vector<std::string> vKey;
std::vector<std::string> vValue;
xNoSqlDriver->HMSet(m_pCommonRedisModule->GetPropertyCacheKey(id), vKey, vValue);
xNoSqlDriver->HMSet(m_pCommonRedisModule->GetRecordCacheKey(id), vKey, vValue);
xNoSqlDriver->HMSet(m_pCommonRedisModule->GetPropertyStorageKey(id), vKey, vValue);
xNoSqlDriver->HMSet(m_pCommonRedisModule->GetRecordStorageKey(id), vKey, vValue);
*/
return true;
}
}
return false;
}
示例2: AddAccount
bool NFCAccountRedisModule::AddAccount(const std::string & strAccount, const std::string & strPwd)
{
std::string strAccountKey = m_pCommonRedisModule->GetAccountCacheKey(strAccount);
NF_SHARE_PTR<NFINoSqlDriver> xNoSqlDriver = m_pNoSqlModule->GetDriverBySuit(strAccount);
if (xNoSqlDriver)
{
return xNoSqlDriver->HSet(strAccountKey, "Password", strPwd);
}
return false;
}
示例3: SetPlayerRoomID
bool NFCPVPMatchRedisModule::SetPlayerRoomID(const NFGUID& self, const NFGUID& xRoomID)
{
NF_SHARE_PTR<NFINoSqlDriver> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
if (pNoSqlDriver)
{
std::string strKey = MakePlayerRoomKey();
return pNoSqlDriver->HSet(strKey, self.ToString(), xRoomID.ToString());
}
return false;
}
示例4: SetStatusRoomID
bool NFCPVPMatchRedisModule::SetStatusRoomID(const int nPVPMode, const int nGrade, const int nStatus, const NFGUID& xRoomID)
{
NF_SHARE_PTR<NFINoSqlDriver> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
if (pNoSqlDriver)
{
std::string strKey = MakeStatusRoomIDRedisKey(nPVPMode, nGrade, nStatus);
std::string strData;
std::vector<std::string> valueVec;
if (pNoSqlDriver->HSet(strKey, xRoomID.ToString(), xRoomID.ToString()))
{
return true;
}
}
return false;
}
示例5: SetRoomInfo
bool NFCPVPMatchRedisModule::SetRoomInfo(const NFGUID& xRoomID, NFMsg::PVPRoomInfo& xRoomInfo)
{
NF_SHARE_PTR<NFINoSqlDriver> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
if (pNoSqlDriver)
{
std::string strKey = MakePvpRoomRedisKey();
std::string strData;
if (xRoomInfo.ParseFromString(strData))
{
if (pNoSqlDriver->HSet(strKey, xRoomID.ToString(), strData))
{
return true;
}
}
}
return false;
}