本文整理汇总了C++中MemberSlot::SetOFFNOTE方法的典型用法代码示例。如果您正苦于以下问题:C++ MemberSlot::SetOFFNOTE方法的具体用法?C++ MemberSlot::SetOFFNOTE怎么用?C++ MemberSlot::SetOFFNOTE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberSlot
的用法示例。
在下文中一共展示了MemberSlot::SetOFFNOTE方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleGuildSetNoteOpcode
void WorldSession::HandleGuildSetNoteOpcode(WorldPacket& recvPacket)
{
DEBUG_LOG("WORLD: Received opcode CMSG_GUILD_SET_NOTE");
bool officer;
uint32 noteLen;
std::string name, note;
ObjectGuid targetGuid;
recvPacket.ReadGuidMask<1, 4, 5, 3, 0, 7>(targetGuid);
officer = !recvPacket.ReadBit();
recvPacket.ReadGuidMask<6>(targetGuid);
noteLen = recvPacket.ReadBits(8);
recvPacket.ReadGuidMask<2>(targetGuid);
recvPacket.ReadGuidBytes<4, 5, 0, 3, 1, 6, 7>(targetGuid);
note = recvPacket.ReadString(noteLen);
recvPacket.ReadGuidBytes<2>(targetGuid);
Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId());
if (!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
return;
}
if (!guild->HasRankRight(GetPlayer()->GetRank(), officer ? GR_RIGHT_EOFFNOTE : GR_RIGHT_EPNOTE))
{
SendGuildCommandResult(GUILD_INVITE_S, "", ERR_GUILD_PERMISSIONS);
return;
}
if (!sObjectMgr.GetPlayerNameByGUID(targetGuid, name))
return;
MemberSlot* slot = guild->GetMemberSlot(targetGuid);
if (!slot)
{
SendGuildCommandResult(GUILD_INVITE_S, name, ERR_GUILD_PLAYER_NOT_IN_GUILD_S);
return;
}
if (officer)
slot->SetOFFNOTE(note);
else
slot->SetPNOTE(note);
guild->Roster(this);
}