TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Trinity::BattlegroundChatBuilder Class Reference

Public Member Functions

 BattlegroundChatBuilder (ChatMsg msgtype, uint32 textId, Player const *source, va_list *args=NULL)
 
WorldPackets::Packetoperator() (LocaleConstant loc_idx)
 

Private Member Functions

WorldPackets::Packetdo_helper (char const *text)
 

Private Attributes

ChatMsg _msgtype
 
uint32 _textId
 
Player const_source
 
va_list * _args
 

Constructor & Destructor Documentation

Trinity::BattlegroundChatBuilder::BattlegroundChatBuilder ( ChatMsg  msgtype,
uint32  textId,
Player const source,
va_list *  args = NULL 
)
inline
46  : _msgtype(msgtype), _textId(textId), _source(source), _args(args) { }
Player const * _source
Definition: Battleground.cpp:77
ChatMsg _msgtype
Definition: Battleground.cpp:75
va_list * _args
Definition: Battleground.cpp:78
uint32 _textId
Definition: Battleground.cpp:76

Member Function Documentation

WorldPackets::Packet* Trinity::BattlegroundChatBuilder::do_helper ( char const text)
inlineprivate
69  {
72  return packet;
73  }
Definition: SharedDefines.h:961
Definition: ChatPackets.h:150
Player const * _source
Definition: Battleground.cpp:77
void Initialize(ChatMsg chatType, Language language, WorldObject const *sender, WorldObject const *receiver, std::string message, uint32 achievementId=0, std::string channelName="", LocaleConstant locale=DEFAULT_LOCALE, std::string addonPrefix="")
Definition: ChatPackets.cpp:104
ChatMsg _msgtype
Definition: Battleground.cpp:75

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

WorldPackets::Packet* Trinity::BattlegroundChatBuilder::operator() ( LocaleConstant  loc_idx)
inline
49  {
50  char const* text = sObjectMgr->GetTrinityString(_textId, loc_idx);
51  if (_args)
52  {
53  // we need copy va_list before use or original va_list will corrupted
54  va_list ap;
55  va_copy(ap, *_args);
56 
57  char str[2048];
58  vsnprintf(str, 2048, text, ap);
59  va_end(ap);
60 
61  return do_helper(&str[0]);
62  }
63 
64  return do_helper(text);
65  }
#define sObjectMgr
Definition: ObjectMgr.h:1567
#define vsnprintf
Definition: Common.h:78
va_list * _args
Definition: Battleground.cpp:78
WorldPackets::Packet * do_helper(char const *text)
Definition: Battleground.cpp:68
uint32 _textId
Definition: Battleground.cpp:76

+ Here is the call graph for this function:

Member Data Documentation

va_list* Trinity::BattlegroundChatBuilder::_args
private
ChatMsg Trinity::BattlegroundChatBuilder::_msgtype
private
Player const* Trinity::BattlegroundChatBuilder::_source
private
uint32 Trinity::BattlegroundChatBuilder::_textId
private

The documentation for this class was generated from the following file: