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
187 {
188 MailItemInfo mii;
189 mii.item_guid = itemGuidLow;
190 mii.item_template = item_template;
191 items.push_back(mii);
192 }
Definition: Mail.h:161
ObjectGuid::LowType item_guid
Definition: Mail.h:162
uint32 item_template
Definition: Mail.h:163
std::vector< MailItemInfo > items
Definition: Mail.h:177

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

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

◆ HasItems()

bool Mail::HasItems ( ) const
inline
207{ 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:51
uint32 checked
Definition: Mail.h:183

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:49

References checked, and MAIL_CHECK_MASK_RETURNED.

Referenced by ObjectMgr::ReturnOrDeleteOldMails().

◆ IsSentByGM()

bool Mail::IsSentByGM ( ) const
inline
209{ return stationery == MAIL_STATIONERY_GM; }
@ MAIL_STATIONERY_GM
Definition: Mail.h:60
uint8 stationery
Definition: Mail.h:171

References MAIL_STATIONERY_GM, and stationery.

Referenced by ObjectMgr::ReturnOrDeleteOldMails().

◆ IsSentByPlayer()

bool Mail::IsSentByPlayer ( ) const
inline
208{ return messageType == MAIL_NORMAL; }
@ MAIL_NORMAL
Definition: Mail.h:38
uint8 messageType
Definition: Mail.h:170

References MAIL_NORMAL, and messageType.

Referenced by ObjectMgr::ReturnOrDeleteOldMails().

◆ RemoveItem()

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

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