AzeorthCore 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
693 : i_player(player), i_text_emote(text_emote), i_emote_num(emote_num), i_target(target) {}
uint32 i_emote_num
Definition: ChatHandler.cpp:714
Unit const * i_target
Definition: ChatHandler.cpp:715
uint32 i_text_emote
Definition: ChatHandler.cpp:713
Player const & i_player
Definition: ChatHandler.cpp:712

Member Function Documentation

◆ operator()()

void Acore::EmoteChatBuilder::operator() ( WorldPacket data,
LocaleConstant  loc_idx 
)
inline
696 {
697 std::string const name(i_target ? i_target->GetNameForLocaleIdx(loc_idx) : "");
698 uint32 namlen = name.size();
699
700 data.Initialize(SMSG_TEXT_EMOTE, 20 + namlen);
701 data << i_player.GetGUID();
702 data << uint32(i_text_emote);
703 data << uint32(i_emote_num);
704 data << uint32(namlen);
705 if (namlen > 1)
706 data << name;
707 else
708 data << uint8(0x00);
709 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
@ SMSG_TEXT_EMOTE
Definition: Opcodes.h:291
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
virtual std::string const & GetNameForLocaleIdx(LocaleConstant) const
Definition: Object.h:449
void Initialize(uint16 opcode, size_t newres=200)
Definition: WorldPacket.h:69

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()().