AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
MailSender Class Reference

#include "Mail.h"

Public Member Functions

 MailSender (MailMessageType messageType, uint32 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)
 
 MailSender (uint32 senderEntry)
 
MailMessageType GetMailMessageType () const
 
uint32 GetSenderId () const
 
MailStationery GetStationery () const
 

Private Attributes

MailMessageType m_messageType
 
uint32 m_senderId
 
MailStationery m_stationery
 

Detailed Description

Constructor & Destructor Documentation

◆ MailSender() [1/6]

MailSender::MailSender ( MailMessageType  messageType,
uint32  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 }
uint32 m_senderId
Definition: Mail.h:101
MailStationery m_stationery
Definition: Mail.h:102
MailMessageType m_messageType
Definition: Mail.h:100

◆ MailSender() [2/6]

MailSender::MailSender ( Object sender,
MailStationery  stationery = MAIL_STATIONERY_DEFAULT 
)
33 : m_stationery(stationery)
34{
35 switch (sender->GetTypeId())
36 {
37 case TYPEID_UNIT:
39 m_senderId = sender->GetEntry();
40 break;
43 m_senderId = sender->GetEntry();
44 break;
45 /*case TYPEID_ITEM:
46 m_messageType = MAIL_ITEM;
47 m_senderId = sender->GetEntry();
48 break;*/
49 case TYPEID_PLAYER:
51 m_senderId = sender->GetGUID().GetCounter();
52 break;
53 default:
55 m_senderId = 0; // will show mail from not existed player
56 LOG_ERROR("mail", "MailSender::MailSender - Mail have unexpected sender typeid ({})", sender->GetTypeId());
57 break;
58 }
59}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:156
@ TYPEID_GAMEOBJECT
Definition: ObjectGuid.h:37
@ TYPEID_UNIT
Definition: ObjectGuid.h:35
@ TYPEID_PLAYER
Definition: ObjectGuid.h:36
@ MAIL_GAMEOBJECT
Definition: Mail.h:41
@ MAIL_CREATURE
Definition: Mail.h:40
@ MAIL_NORMAL
Definition: Mail.h:38
TypeID GetTypeId() const
Definition: Object.h:124
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
LowType GetCounter() const
Definition: ObjectGuid.h:145

References ObjectGuid::GetCounter(), Object::GetEntry(), Object::GetGUID(), Object::GetTypeId(), LOG_ERROR, m_messageType, m_senderId, MAIL_CREATURE, MAIL_GAMEOBJECT, MAIL_NORMAL, TYPEID_GAMEOBJECT, TYPEID_PLAYER, and TYPEID_UNIT.

◆ MailSender() [3/6]

MailSender::MailSender ( CalendarEvent sender)
62 : m_messageType(MAIL_CALENDAR), m_senderId(sender->GetEventId()), m_stationery(MAIL_STATIONERY_DEFAULT) // what stationery we should use here?
63{
64}
@ MAIL_STATIONERY_DEFAULT
Definition: Mail.h:59
@ MAIL_CALENDAR
Definition: Mail.h:42
uint64 GetEventId() const
Definition: CalendarMgr.h:223

◆ MailSender() [4/6]

MailSender::MailSender ( AuctionEntry sender)
68{
69}
@ MAIL_STATIONERY_AUCTION
Definition: Mail.h:61
@ MAIL_AUCTION
Definition: Mail.h:39
uint8 GetHouseId() const
Definition: AuctionHouseMgr.h:117

◆ MailSender() [5/6]

MailSender::MailSender ( Player sender)

◆ MailSender() [6/6]

MailSender::MailSender ( uint32  senderEntry)

Member Function Documentation

◆ GetMailMessageType()

MailMessageType MailSender::GetMailMessageType ( ) const
inline
96{ return m_messageType; }

References m_messageType.

Referenced by MailDraft::SendMailTo().

◆ GetSenderId()

uint32 MailSender::GetSenderId ( ) const
inline
97{ return m_senderId; }

References m_senderId.

Referenced by MailDraft::SendMailTo().

◆ GetStationery()

MailStationery MailSender::GetStationery ( ) const
inline
98{ return m_stationery; }

References m_stationery.

Referenced by MailDraft::SendMailTo().

Member Data Documentation

◆ m_messageType

MailMessageType MailSender::m_messageType
private

Referenced by GetMailMessageType(), and MailSender().

◆ m_senderId

uint32 MailSender::m_senderId
private

Referenced by GetSenderId(), and MailSender().

◆ m_stationery

MailStationery MailSender::m_stationery
private

Referenced by GetStationery(), and MailSender().