AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::EmoteChatBuilder Class Reference

Public Member Functions

 EmoteChatBuilder (Player const &player, uint32 text_emote, uint32 emote_num, Unit const *target)
 
void operator() (WorldPacket &data, LocaleConstant loc_idx)
 

Private Attributes

Player const & i_player
 
uint32 i_text_emote
 
uint32 i_emote_num
 
Unit const * i_target
 

Detailed Description

Constructor & Destructor Documentation

◆ EmoteChatBuilder()

Acore::EmoteChatBuilder::EmoteChatBuilder ( Player const &  player,
uint32  text_emote,
uint32  emote_num,
Unit const *  target 
)
inline
702 : i_player(player), i_text_emote(text_emote), i_emote_num(emote_num), i_target(target) {}
uint32 i_emote_num
Definition: ChatHandler.cpp:723
Unit const * i_target
Definition: ChatHandler.cpp:724
uint32 i_text_emote
Definition: ChatHandler.cpp:722
Player const & i_player
Definition: ChatHandler.cpp:721

Member Function Documentation

◆ operator()()

void Acore::EmoteChatBuilder::operator() ( WorldPacket data,
LocaleConstant  loc_idx 
)
inline
705 {
706 std::string const name(i_target ? i_target->GetNameForLocaleIdx(loc_idx) : "");
707 uint32 namlen = name.size();
708
709 data.Initialize(SMSG_TEXT_EMOTE, 20 + namlen);
710 data << i_player.GetGUID();
711 data << uint32(i_text_emote);
712 data << uint32(i_emote_num);
713 data << uint32(namlen);
714 if (namlen > 1)
715 data << name;
716 else
717 data << uint8(0x00);
718 }
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
@ SMSG_TEXT_EMOTE
Definition: Opcodes.h:291
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
virtual std::string const & GetNameForLocaleIdx(LocaleConstant) const
Definition: Object.h:466
void Initialize(uint16 opcode, std::size_t newres=200)
Definition: WorldPacket.h:68

References Object::GetGUID(), WorldObject::GetNameForLocaleIdx(), i_emote_num, i_player, i_target, i_text_emote, WorldPacket::Initialize(), and SMSG_TEXT_EMOTE.

Member Data Documentation

◆ i_emote_num

uint32 Acore::EmoteChatBuilder::i_emote_num
private

Referenced by operator()().

◆ i_player

Player const& Acore::EmoteChatBuilder::i_player
private

Referenced by operator()().

◆ i_target

Unit const* Acore::EmoteChatBuilder::i_target
private

Referenced by operator()().

◆ i_text_emote

uint32 Acore::EmoteChatBuilder::i_text_emote
private

Referenced by operator()().