Implement player rank in defensive channels
Based on (c2613) by @Laizerox
This commit is contained in:
parent
960e2f3252
commit
15bd01600e
@ -106,6 +106,7 @@ void Channel::Join(Player* player, const char* password)
|
||||
|
||||
MakeYouJoined(&data);
|
||||
SendToOne(&data, guid);
|
||||
|
||||
JoinNotify(guid);
|
||||
|
||||
// if no owner first logged will become
|
||||
@ -151,7 +152,7 @@ void Channel::Leave(Player* player, bool send)
|
||||
SendToAll(&data);
|
||||
}
|
||||
|
||||
LeaveNotify(guid);
|
||||
LeaveNotify(guid);
|
||||
|
||||
if (changeowner)
|
||||
{
|
||||
@ -612,7 +613,7 @@ void Channel::Say(Player* player, const char* text, uint32 lang)
|
||||
if (sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
lang = LANG_UNIVERSAL;
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, text, Language(lang), player->GetChatTag(), guid, player->GetName(), ObjectGuid(), "", m_name.c_str());
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, text, Language(lang), player->GetChatTag(), guid, player->GetName(), ObjectGuid(), "", m_name.c_str(), player->GetHonorRankInfo().rank);
|
||||
SendToAll(&data, !m_players[guid].IsModerator() ? guid : ObjectGuid());
|
||||
}
|
||||
|
||||
|
@ -3342,7 +3342,7 @@ void ChatHandler::LogCommand(char const* fullcmd)
|
||||
void ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg msgtype, char const* message, Language language /*= LANG_UNIVERSAL*/, ChatTagFlags chatTag /*= CHAT_TAG_NONE*/,
|
||||
ObjectGuid const& senderGuid /*= ObjectGuid()*/, char const* senderName /*= NULL*/,
|
||||
ObjectGuid const& targetGuid /*= ObjectGuid()*/, char const* targetName /*= NULL*/,
|
||||
char const* channelName /*= NULL*/)
|
||||
char const* channelName /*= NULL*/, uint8 playerRank /*= 0*/)
|
||||
{
|
||||
data.Initialize(SMSG_MESSAGECHAT);
|
||||
data << uint8(msgtype);
|
||||
@ -3379,7 +3379,7 @@ void ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg msgtype, char const
|
||||
case CHAT_MSG_CHANNEL:
|
||||
MANGOS_ASSERT(channelName);
|
||||
data << channelName;
|
||||
data << uint32(0);
|
||||
data << uint32(playerRank);
|
||||
data << ObjectGuid(senderGuid);
|
||||
break;
|
||||
|
||||
|
@ -118,12 +118,13 @@ class ChatHandler
|
||||
* \param ObjectGuid const& targetGuid : Often null, but needed for type *MONSTER* or *BATTLENET or *BATTLEGROUND* or *ACHIEVEMENT
|
||||
* \param char const* targetName : Often null, but needed for type *MONSTER* or *BATTLENET or *BATTLEGROUND*
|
||||
* \param char const* channelName : Required only for CHAT_MSG_CHANNEL
|
||||
* \param uint8 playerRank : Used only for Defensive Channels (Value over 0 will show rank name before character name in channel)
|
||||
**/
|
||||
static void BuildChatPacket(
|
||||
WorldPacket& data, ChatMsg msgtype, char const* message, Language language = LANG_UNIVERSAL, ChatTagFlags chatTag = CHAT_TAG_NONE,
|
||||
ObjectGuid const& senderGuid = ObjectGuid(), char const* senderName = NULL,
|
||||
ObjectGuid const& targetGuid = ObjectGuid(), char const* targetName = NULL,
|
||||
char const* channelName = NULL);
|
||||
char const* channelName = NULL, uint8 playerRank = 0);
|
||||
protected:
|
||||
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user