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

#include <Mail.h>

Public Member Functions

 MailSender (MailMessageType messageType, ObjectGuid::LowType sender_guidlow_or_entry, MailStationery stationery=MAIL_STATIONERY_DEFAULT)
 
 MailSender (Object *sender, MailStationery stationery=MAIL_STATIONERY_DEFAULT)
 
 MailSender (CalendarEvent *sender)
 
 MailSender (AuctionEntry *sender)
 
 MailSender (Player *sender)
 
MailMessageType GetMailMessageType () const
 
ObjectGuid::LowType GetSenderId () const
 
MailStationery GetStationery () const
 

Private Attributes

MailMessageType m_messageType
 
ObjectGuid::LowType m_senderId
 
MailStationery m_stationery
 

Constructor & Destructor Documentation

MailSender::MailSender ( MailMessageType  messageType,
ObjectGuid::LowType  sender_guidlow_or_entry,
MailStationery  stationery = MAIL_STATIONERY_DEFAULT 
)
inline
87  : m_messageType(messageType), m_senderId(sender_guidlow_or_entry), m_stationery(stationery)
88  {
89  }
ObjectGuid::LowType m_senderId
Definition: Mail.h:100
MailMessageType m_messageType
Definition: Mail.h:99
MailStationery m_stationery
Definition: Mail.h:101
MailSender::MailSender ( Object sender,
MailStationery  stationery = MAIL_STATIONERY_DEFAULT 
)
29  : m_stationery(stationery)
30 {
31  switch (sender->GetTypeId())
32  {
33  case TYPEID_UNIT:
35  m_senderId = uint64(sender->GetEntry());
36  break;
37  case TYPEID_GAMEOBJECT:
39  m_senderId = uint64(sender->GetEntry());
40  break;
41  /*case TYPEID_ITEM:
42  m_messageType = MAIL_ITEM;
43  m_senderId = sender->GetEntry();
44  break;*/
45  case TYPEID_PLAYER:
47  m_senderId = sender->GetGUID().GetCounter();
48  break;
49  default:
51  m_senderId = UI64LIT(0); // will show mail from not existed player
52  TC_LOG_ERROR("misc", "MailSender::MailSender - Mail have unexpected sender typeid (%u)", sender->GetTypeId());
53  break;
54  }
55 }
ObjectGuid::LowType m_senderId
Definition: Mail.h:100
#define UI64LIT(N)
Definition: Define.h:138
Definition: ObjectGuid.h:32
Definition: Mail.h:38
uint64_t uint64
Definition: g3dmath.h:170
TypeID GetTypeId() const
Definition: Object.h:113
Definition: Mail.h:41
Definition: ObjectGuid.h:34
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
uint32 GetEntry() const
Definition: Object.h:107
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
MailMessageType m_messageType
Definition: Mail.h:99
Definition: Mail.h:40
MailStationery m_stationery
Definition: Mail.h:101
LowType GetCounter() const
Definition: ObjectGuid.h:221

+ Here is the call graph for this function:

MailSender::MailSender ( CalendarEvent sender)
58  : m_messageType(MAIL_CALENDAR), m_senderId(sender->GetEventId()), m_stationery(MAIL_STATIONERY_DEFAULT) // what stationery we should use here?
59 {
60 }
ObjectGuid::LowType m_senderId
Definition: Mail.h:100
uint64 GetEventId() const
Definition: CalendarMgr.h:219
Definition: Mail.h:42
Definition: Mail.h:59
MailMessageType m_messageType
Definition: Mail.h:99
MailStationery m_stationery
Definition: Mail.h:101
MailSender::MailSender ( AuctionEntry sender)
Definition: Mail.h:61
Definition: Mail.h:39
ObjectGuid::LowType m_senderId
Definition: Mail.h:100
uint64_t uint64
Definition: g3dmath.h:170
uint32 GetHouseId() const
Definition: AuctionHouseMgr.h:86
MailMessageType m_messageType
Definition: Mail.h:99
MailStationery m_stationery
Definition: Mail.h:101
MailSender::MailSender ( Player sender)
66 {
68  m_stationery = sender->IsGameMaster() ? MAIL_STATIONERY_GM : MAIL_STATIONERY_DEFAULT;
69  m_senderId = sender->GetGUID().GetCounter();
70 }
ObjectGuid::LowType m_senderId
Definition: Mail.h:100
Definition: Mail.h:60
Definition: Mail.h:38
Definition: Mail.h:59
MailMessageType m_messageType
Definition: Mail.h:99
MailStationery m_stationery
Definition: Mail.h:101

Member Function Documentation

MailMessageType MailSender::GetMailMessageType ( ) const
inline
95 { return m_messageType; }
MailMessageType m_messageType
Definition: Mail.h:99

+ Here is the caller graph for this function:

ObjectGuid::LowType MailSender::GetSenderId ( ) const
inline
96 { return m_senderId; }
ObjectGuid::LowType m_senderId
Definition: Mail.h:100

+ Here is the caller graph for this function:

MailStationery MailSender::GetStationery ( ) const
inline
97 { return m_stationery; }
MailStationery m_stationery
Definition: Mail.h:101

+ Here is the caller graph for this function:

Member Data Documentation

MailMessageType MailSender::m_messageType
private
ObjectGuid::LowType MailSender::m_senderId
private
MailStationery MailSender::m_stationery
private

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