mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[12038] Use bitmask for chat tag.
Thanks to stfx for porting Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
d563c6576d
commit
fd6c2e1751
6 changed files with 28 additions and 19 deletions
|
|
@ -73,7 +73,7 @@ namespace MaNGOS
|
||||||
data << ObjectGuid(targetGuid);
|
data << ObjectGuid(targetGuid);
|
||||||
data << uint32(strlen(text)+1);
|
data << uint32(strlen(text)+1);
|
||||||
data << text;
|
data << text;
|
||||||
data << uint8(i_source ? i_source->chatTag() : uint8(0));
|
data << uint8(i_source ? i_source->GetChatTag() : CHAT_TAG_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatMsg i_msgtype;
|
ChatMsg i_msgtype;
|
||||||
|
|
@ -152,7 +152,7 @@ namespace MaNGOS
|
||||||
data << ObjectGuid(targetGuid);
|
data << ObjectGuid(targetGuid);
|
||||||
data << uint32(strlen(str)+1);
|
data << uint32(strlen(str)+1);
|
||||||
data << str;
|
data << str;
|
||||||
data << uint8(i_source ? i_source->chatTag() : uint8(0));
|
data << uint8(i_source ? i_source->GetChatTag() : CHAT_TAG_NONE);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -574,7 +574,7 @@ void Channel::Say(ObjectGuid p, const char *what, uint32 lang)
|
||||||
data << ObjectGuid(p);
|
data << ObjectGuid(p);
|
||||||
data << uint32(messageLength);
|
data << uint32(messageLength);
|
||||||
data << what;
|
data << what;
|
||||||
data << uint8(plr ? plr->chatTag() : 0);
|
data << uint8(plr ? plr->GetChatTag() : CHAT_TAG_NONE);
|
||||||
|
|
||||||
SendToAll(&data, !m_players[p].IsModerator() ? p : ObjectGuid());
|
SendToAll(&data, !m_players[p].IsModerator() ? p : ObjectGuid());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2116,7 +2116,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin
|
||||||
*data << uint32(messageLength);
|
*data << uint32(messageLength);
|
||||||
*data << message;
|
*data << message;
|
||||||
if(session != 0 && type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_DND && type != CHAT_MSG_AFK)
|
if(session != 0 && type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_DND && type != CHAT_MSG_AFK)
|
||||||
*data << uint8(session->GetPlayer()->chatTag());
|
*data << uint8(session->GetPlayer()->GetChatTag());
|
||||||
else
|
else
|
||||||
*data << uint8(0);
|
*data << uint8(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1606,23 +1606,22 @@ void Player::ToggleDND()
|
||||||
ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND);
|
ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Player::chatTag() const
|
uint8 Player::GetChatTag() const
|
||||||
{
|
{
|
||||||
// it's bitmask
|
uint8 tag = CHAT_TAG_NONE;
|
||||||
// 0x1 - afk
|
|
||||||
// 0x2 - dnd
|
|
||||||
// 0x4 - gm
|
|
||||||
// 0x8 - ??
|
|
||||||
|
|
||||||
if (isGMChat()) // Always show GM icons if activated
|
|
||||||
return 4;
|
|
||||||
|
|
||||||
if (isAFK())
|
if (isAFK())
|
||||||
return 1;
|
tag |= CHAT_TAG_AFK;
|
||||||
if (isDND())
|
if (isDND())
|
||||||
return 3;
|
tag |= CHAT_TAG_DND;
|
||||||
|
if (isGMChat())
|
||||||
|
tag |= CHAT_TAG_GM;
|
||||||
|
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_COMMENTATOR))
|
||||||
|
tag |= CHAT_TAG_COM;
|
||||||
|
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER))
|
||||||
|
tag |= CHAT_TAG_DEV;
|
||||||
|
|
||||||
return 0;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options)
|
bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options)
|
||||||
|
|
@ -18431,7 +18430,7 @@ void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string
|
||||||
*data << ObjectGuid(GetObjectGuid());
|
*data << ObjectGuid(GetObjectGuid());
|
||||||
*data << uint32(text.length()+1);
|
*data << uint32(text.length()+1);
|
||||||
*data << text;
|
*data << text;
|
||||||
*data << uint8(chatTag());
|
*data << uint8(GetChatTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Say(const std::string& text, const uint32 language)
|
void Player::Say(const std::string& text, const uint32 language)
|
||||||
|
|
|
||||||
|
|
@ -795,6 +795,16 @@ enum EnviromentalDamage
|
||||||
DAMAGE_FALL_TO_VOID = 6 // custom case for fall without durability loss
|
DAMAGE_FALL_TO_VOID = 6 // custom case for fall without durability loss
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum PlayerChatTag
|
||||||
|
{
|
||||||
|
CHAT_TAG_NONE = 0x00,
|
||||||
|
CHAT_TAG_AFK = 0x01,
|
||||||
|
CHAT_TAG_DND = 0x02,
|
||||||
|
CHAT_TAG_GM = 0x04,
|
||||||
|
CHAT_TAG_COM = 0x08, // Commentator
|
||||||
|
CHAT_TAG_DEV = 0x10, // Developer
|
||||||
|
};
|
||||||
|
|
||||||
enum PlayedTimeIndex
|
enum PlayedTimeIndex
|
||||||
{
|
{
|
||||||
PLAYED_TIME_TOTAL = 0,
|
PLAYED_TIME_TOTAL = 0,
|
||||||
|
|
@ -1071,7 +1081,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void ToggleDND();
|
void ToggleDND();
|
||||||
bool isAFK() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); }
|
bool isAFK() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); }
|
||||||
bool isDND() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); }
|
bool isDND() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); }
|
||||||
uint8 chatTag() const;
|
uint8 GetChatTag() const;
|
||||||
std::string autoReplyMsg;
|
std::string autoReplyMsg;
|
||||||
|
|
||||||
uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint32 newskintone);
|
uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint32 newskintone);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "12037"
|
#define REVISION_NR "12038"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue