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

Public Member Functions

 Battleground2ChatBuilder (ChatMsg msgtype, uint32 textId, Player const *source, int32 arg1, int32 arg2)
 
void operator() (WorldPacket &data, LocaleConstant loc_idx)
 

Private Attributes

ChatMsg _msgtype
 
uint32 _textId
 
Player const * _source
 
uint32 _arg1
 
uint32 _arg2
 

Detailed Description

Constructor & Destructor Documentation

◆ Battleground2ChatBuilder()

Acore::Battleground2ChatBuilder::Battleground2ChatBuilder ( ChatMsg  msgtype,
uint32  textId,
Player const *  source,
int32  arg1,
int32  arg2 
)
inline
94 : _msgtype(msgtype), _textId(textId), _source(source), _arg1(arg1), _arg2(arg2) {}
uint32 _textId
Definition: Battleground.cpp:110
ChatMsg _msgtype
Definition: Battleground.cpp:109
Player const * _source
Definition: Battleground.cpp:111
uint32 _arg1
Definition: Battleground.cpp:112
uint32 _arg2
Definition: Battleground.cpp:113

Member Function Documentation

◆ operator()()

void Acore::Battleground2ChatBuilder::operator() ( WorldPacket data,
LocaleConstant  loc_idx 
)
inline
97 {
98 char const* text = sObjectMgr->GetAcoreString(_textId, loc_idx);
99 char const* arg1str = _arg1 ? sObjectMgr->GetAcoreString(_arg1, loc_idx) : "";
100 char const* arg2str = _arg2 ? sObjectMgr->GetAcoreString(_arg2, loc_idx) : "";
101
102 char str[2048];
103 snprintf(str, 2048, text, arg1str, arg2str);
104
106 }
#define sObjectMgr
Definition: ObjectMgr.h:1640
@ LANG_UNIVERSAL
Definition: SharedDefines.h:735
static size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
Definition: Chat.cpp:201

References _arg1, _arg2, _msgtype, _source, _textId, ChatHandler::BuildChatPacket(), LANG_UNIVERSAL, and sObjectMgr.

Member Data Documentation

◆ _arg1

uint32 Acore::Battleground2ChatBuilder::_arg1
private

Referenced by operator()().

◆ _arg2

uint32 Acore::Battleground2ChatBuilder::_arg2
private

Referenced by operator()().

◆ _msgtype

ChatMsg Acore::Battleground2ChatBuilder::_msgtype
private

Referenced by operator()().

◆ _source

Player const* Acore::Battleground2ChatBuilder::_source
private

Referenced by operator()().

◆ _textId

uint32 Acore::Battleground2ChatBuilder::_textId
private

Referenced by operator()().