AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Mail Struct Reference

#include "Mail.h"

Public Member Functions

void AddItem (ObjectGuid::LowType itemGuidLow, uint32 item_template)
 
bool RemoveItem (ObjectGuid::LowType item_guid)
 
bool HasItems () const
 
bool IsSentByPlayer () const
 
bool IsSentByGM () const
 
bool IsCODPayment () const
 
bool IsReturnedMail () const
 

Public Attributes

uint32 messageID
 
uint8 messageType
 
uint8 stationery
 
uint16 mailTemplateId
 
uint32 sender
 
ObjectGuid::LowType receiver
 
std::string subject
 
std::string body
 
std::vector< MailItemInfoitems
 
std::vector< uint32removedItems
 
time_t expire_time
 
time_t deliver_time
 
uint32 money
 
uint32 COD
 
uint32 checked
 
MailState state
 

Detailed Description

Member Function Documentation

◆ AddItem()

void Mail::AddItem ( ObjectGuid::LowType  itemGuidLow,
uint32  item_template 
)
inline
186 {
187 MailItemInfo mii;
188 mii.item_guid = itemGuidLow;
189 mii.item_template = item_template;
190 items.push_back(mii);
191 }
Definition: Mail.h:160
ObjectGuid::LowType item_guid
Definition: Mail.h:161
uint32 item_template
Definition: Mail.h:162
std::vector< MailItemInfo > items
Definition: Mail.h:176

References MailItemInfo::item_guid, MailItemInfo::item_template, and items.

Referenced by Player::_LoadMailedItem(), and MailDraft::SendMailTo().

◆ HasItems()

bool Mail::HasItems ( ) const
inline
206{ return !items.empty(); }

References items.

Referenced by Player::_SaveMail(), and WorldSession::HandleMailReturnToSender().

◆ IsCODPayment()

bool Mail::IsCODPayment ( ) const
inline
@ MAIL_CHECK_MASK_COD_PAYMENT
This mail was copied. Do not allow making a copy of items in mail.
Definition: Mail.h:50
uint32 checked
Definition: Mail.h:182

References checked, and MAIL_CHECK_MASK_COD_PAYMENT.

Referenced by ObjectMgr::ReturnOrDeleteOldMails().

◆ IsReturnedMail()

bool Mail::IsReturnedMail ( ) const
inline
@ MAIL_CHECK_MASK_RETURNED
Definition: Mail.h:48

References checked, and MAIL_CHECK_MASK_RETURNED.

Referenced by ObjectMgr::ReturnOrDeleteOldMails().

◆ IsSentByGM()

bool Mail::IsSentByGM ( ) const
inline
208{ return stationery == MAIL_STATIONERY_GM; }
@ MAIL_STATIONERY_GM
Definition: Mail.h:59
uint8 stationery
Definition: Mail.h:170

References MAIL_STATIONERY_GM, and stationery.

Referenced by ObjectMgr::ReturnOrDeleteOldMails().

◆ IsSentByPlayer()

bool Mail::IsSentByPlayer ( ) const
inline
207{ return messageType == MAIL_NORMAL; }
@ MAIL_NORMAL
Definition: Mail.h:37
uint8 messageType
Definition: Mail.h:169

References MAIL_NORMAL, and messageType.

Referenced by ObjectMgr::ReturnOrDeleteOldMails().

◆ RemoveItem()

bool Mail::RemoveItem ( ObjectGuid::LowType  item_guid)
inline
194 {
195 for (MailItemInfoVec::iterator itr = items.begin(); itr != items.end(); ++itr)
196 {
197 if (itr->item_guid == item_guid)
198 {
199 items.erase(itr);
200 return true;
201 }
202 }
203 return false;
204 }

References items.

Referenced by WorldSession::HandleMailTakeItem().

Member Data Documentation

◆ body

◆ checked

◆ COD

◆ deliver_time

◆ expire_time

◆ items

◆ mailTemplateId

◆ messageID

◆ messageType

◆ money

◆ receiver

◆ removedItems

std::vector<uint32> Mail::removedItems

◆ sender

◆ state

◆ stationery

◆ subject