本文整理汇总了C++中PlayerPointer::chatTag方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::chatTag方法的具体用法?C++ PlayerPointer::chatTag怎么用?C++ PlayerPointer::chatTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::chatTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Say
void Channel::Say(ObjectGuid p, const char *what, uint32 lang, bool skipCheck)
{
if (!what)
return;
if (sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
lang = LANG_UNIVERSAL;
uint32 sec = 0;
PlayerPointer plr = GetPlayer(p);
if (plr)
sec = plr->GetSession()->GetSecurity();
if (!skipCheck && !IsOn(p))
{
WorldPacket data;
MakeNotMember(&data);
SendToOne(&data, p);
}
else if (!skipCheck && m_players[p].IsMuted())
{
WorldPacket data;
MakeMuted(&data);
SendToOne(&data, p);
}
else if (!skipCheck && m_moderate && !m_players[p].IsModerator() && sec < SEC_GAMEMASTER)
{
WorldPacket data;
MakeNotModerator(&data);
SendToOne(&data, p);
}
else
{
uint32 messageLength = strlen(what) + 1;
WorldPacket data(SMSG_MESSAGECHAT, 1 + 4 + 8 + 4 + m_name.size() + 1 + 8 + 4 + messageLength + 1);
data << uint8(CHAT_MSG_CHANNEL);
data << uint32(lang);
data << m_name;
data << uint32(0);
data << ObjectGuid(p);
data << uint32(messageLength);
data << what;
data << uint8(plr ? plr->chatTag() : 0);
if (!skipCheck && plr &&
plr->GetSession()->GetAccountFlags() & ACCOUNT_FLAG_MUTED_FROM_PUBLIC_CHANNELS &&
plr->GetSession()->GetAccountMaxLevel() < sWorld.getConfig(CONFIG_UINT32_PUB_CHANS_MUTE_VANISH_LEVEL))
plr->GetSession()->SendPacket(&data);
else
SendToAll(&data, (!skipCheck && !m_players[p].IsModerator()) ? p : ObjectGuid());
}
}