本文整理汇总了C++中CDBAgent::UpdateCharacterName方法的典型用法代码示例。如果您正苦于以下问题:C++ CDBAgent::UpdateCharacterName方法的具体用法?C++ CDBAgent::UpdateCharacterName怎么用?C++ CDBAgent::UpdateCharacterName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDBAgent
的用法示例。
在下文中一共展示了CDBAgent::UpdateCharacterName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReqChangeName
/**
* @brief Handles name change requests.
*
* @param pkt The packet.
*/
void CUser::ReqChangeName(Packet & pkt)
{
NameChangeOpcode response;
uint8 opcode;
string strName;
pkt >> opcode >> strName;
switch (opcode)
{
case NameChangePlayerRequest:
response = g_DBAgent.UpdateCharacterName(GetAccountName(), GetName(), strName);
// On success, update the name in the server & remove the scroll.
// (we checked if it existed before handling the request).
if (response == NameChangeSuccess)
{
// Replace the character's name (in both the session and the character lookup hashmap).
g_pMain->ReplaceCharacterName(this, strName);
// Take the scroll...
RobItem(ITEM_SCROLL_OF_IDENTITY);
// Remove user from others' view & make them reappear again so
// the name can be updated for those currently in range.
UserInOut(INOUT_OUT);
UserInOut(INOUT_IN);
}
break;
}
SendNameChange(response);
}