175 Player* pReceiver = receiver.GetPlayer();
183 time_t deliver_time = time(
NULL) + deliver_delay;
195 expire_delay = 3 *
DAY;
197 expire_delay = pSender && pSender->IsGameMaster() ? 90 *
DAY : 30 *
DAY;
200 time_t expire_time = deliver_time + expire_delay;
206 stmt->
setUInt8 (++index,
uint8(sender.GetMailMessageType()));
207 stmt->
setInt8 (++index,
int8(sender.GetStationery()));
209 stmt->
setUInt64(++index, sender.GetSenderId());
210 stmt->
setUInt64(++index, receiver.GetPlayerGUIDLow());
221 for (MailItemMap::const_iterator mailItemIter =
m_items.begin(); mailItemIter !=
m_items.end(); ++mailItemIter)
223 Item* pItem = mailItemIter->second;
227 stmt->
setUInt64(2, receiver.GetPlayerGUIDLow());
234 pReceiver->AddNewMailDeliverTime(deliver_time);
236 if (pReceiver->IsMailsLoaded())
246 for (MailItemMap::const_iterator mailItemIter =
m_items.begin(); mailItemIter !=
m_items.end(); ++mailItemIter)
248 Item* item = mailItemIter->second;
254 m->
sender = sender.GetSenderId();
255 m->
receiver = receiver.GetPlayerGUIDLow();
261 pReceiver->AddMail(m);
265 for (MailItemMap::iterator mailItemIter =
m_items.begin(); mailItemIter !=
m_items.end(); ++mailItemIter)
266 pReceiver->AddMItem(mailItemIter->second);
MailItemMap m_items
Definition: Mail.h:153
uint16 mailTemplateId
Definition: Mail.h:171
uint16 GetMailTemplateId() const
Definition: Mail.h:129
uint8 messageType
Definition: Mail.h:169
MailState state
Definition: Mail.h:183
void setUInt8(const uint8 index, const uint8 value)
Definition: PreparedStatement.cpp:97
int8_t int8
Definition: g3dmath.h:163
uint32 checked
Definition: Mail.h:182
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
uint8 stationery
Definition: Mail.h:170
arena_t NULL
Definition: jemalloc_internal.h:624
uint64 COD
Definition: Mail.h:181
ObjectGuid::LowType receiver
Definition: Mail.h:173
uint64_t uint64
Definition: g3dmath.h:170
#define sWorld
Definition: World.h:887
uint64 m_COD
Definition: Mail.h:156
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: PreparedStatement.h:74
uint64 m_money
Definition: Mail.h:155
uint64 money
Definition: Mail.h:180
std::string body
Definition: Mail.h:175
void setBool(const uint8 index, const bool value)
Definition: PreparedStatement.cpp:88
Definition: CharacterDatabase.h:128
uint64 GetMoney() const
Definition: Mail.h:131
void setUInt16(const uint8 index, const uint16 value)
Definition: PreparedStatement.cpp:106
std::string const & GetBody() const
Definition: Mail.h:133
uint32_t uint32
Definition: Define.h:150
void deleteIncludedItems(SQLTransaction &trans, bool inDB=false)
Definition: Mail.cpp:111
time_t deliver_time
Definition: Mail.h:179
Definition: CharacterDatabase.h:126
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
std::string const & GetSubject() const
Definition: Mail.h:130
void setInt8(const uint8 index, const int8 value)
Definition: PreparedStatement.cpp:133
uint8_t uint8
Definition: g3dmath.h:164
ObjectGuid const & GetGUID() const
Definition: Object.h:105
time_t expire_time
Definition: Mail.h:178
std::string subject
Definition: Mail.h:174
void AddItem(ObjectGuid::LowType itemGuidLow, uint32 item_template)
Definition: Mail.h:185
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
uint8_t uint8
Definition: Define.h:152
void prepareItems(Player *receiver, SQLTransaction &trans)
Definition: Mail.cpp:85
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
uint32 GetEntry() const
Definition: Object.h:107
uint32 messageID
Definition: Mail.h:168
uint64 GetCOD() const
Definition: Mail.h:132
LowType GetCounter() const
Definition: ObjectGuid.h:221
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58
ObjectGuid::LowType sender
Definition: Mail.h:172