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
86 : m_messageType(messageType), m_senderId(sender_guidlow_or_entry), m_stationery(stationery)
87 {
88 }
uint32 m_senderId
Definition: Mail.h:100
MailStationery m_stationery
Definition: Mail.h:101
MailMessageType m_messageType
Definition: Mail.h:99

◆ MailSender() [2/6]

MailSender::MailSender ( Object sender,
MailStationery  stationery = MAIL_STATIONERY_DEFAULT 
)
32 : m_stationery(stationery)
33{
34 switch (sender->GetTypeId())
35 {
36 case TYPEID_UNIT:
38 m_senderId = sender->GetEntry();
39 break;
42 m_senderId = sender->GetEntry();
43 break;
44 /*case TYPEID_ITEM:
45 m_messageType = MAIL_ITEM;
46 m_senderId = sender->GetEntry();
47 break;*/
48 case TYPEID_PLAYER:
50 m_senderId = sender->GetGUID().GetCounter();
51 break;
52 default:
54 m_senderId = 0; // will show mail from not existed player
55 LOG_ERROR("mail", "MailSender::MailSender - Mail have unexpected sender typeid ({})", sender->GetTypeId());
56 break;
57 }
58}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
@ TYPEID_GAMEOBJECT
Definition: ObjectGuid.h:37
@ TYPEID_UNIT
Definition: ObjectGuid.h:35
@ TYPEID_PLAYER
Definition: ObjectGuid.h:36
@ MAIL_GAMEOBJECT
Definition: Mail.h:40
@ MAIL_CREATURE
Definition: Mail.h:39
@ MAIL_NORMAL
Definition: Mail.h:37
TypeID GetTypeId() const
Definition: Object.h:127
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
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)
61 : m_messageType(MAIL_CALENDAR), m_senderId(sender->GetEventId()), m_stationery(MAIL_STATIONERY_DEFAULT) // what stationery we should use here?
62{
63}
@ MAIL_STATIONERY_DEFAULT
Definition: Mail.h:58
@ MAIL_CALENDAR
Definition: Mail.h:41
uint64 GetEventId() const
Definition: CalendarMgr.h:223

◆ MailSender() [4/6]

MailSender::MailSender ( AuctionEntry sender)
67{
68}
@ MAIL_STATIONERY_AUCTION
Definition: Mail.h:60
@ MAIL_AUCTION
Definition: Mail.h:38
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
95{ return m_messageType; }

References m_messageType.

Referenced by MailDraft::SendMailTo().

◆ GetSenderId()

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

References m_senderId.

Referenced by MailDraft::SendMailTo().

◆ GetStationery()

MailStationery MailSender::GetStationery ( ) const
inline
97{ 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().