本文整理汇总了C++中CDBAgent::LoadKnightsInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CDBAgent::LoadKnightsInfo方法的具体用法?C++ CDBAgent::LoadKnightsInfo怎么用?C++ CDBAgent::LoadKnightsInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDBAgent
的用法示例。
在下文中一共展示了CDBAgent::LoadKnightsInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReqKnightsList
void CKnightsManager::ReqKnightsList(Packet & pkt)
{
// Okay, this effectively makes this useless in the majority of cases.
if (g_pMain->m_nServerNo != BATTLE)
return;
string strKnightsName;
uint32 nPoints;
uint16 sClanID = pkt.read<uint16>(), sMembers;
uint8 bNation, bRank;
if (!g_DBAgent.LoadKnightsInfo(sClanID, bNation, strKnightsName, sMembers, nPoints, bRank))
return;
CKnights *pKnights = g_pMain->GetClanPtr(sClanID);
if (pKnights == nullptr)
{
pKnights = new CKnights();
if (!g_pMain->m_KnightsArray.PutData(sClanID, pKnights))
{
delete pKnights;
return;
}
}
// TO-DO: Move this all to a single method, as this is done multiple times
pKnights->m_sIndex = sClanID;
pKnights->m_byNation = bNation;
pKnights->m_strName = strKnightsName;
pKnights->m_sMembers = sMembers;
pKnights->m_nPoints = nPoints;
pKnights->m_byGrade = g_pMain->GetKnightsGrade(nPoints);
pKnights->m_byRanking = bRank;
}