aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/MailHandler.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
committerariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
commit85a7d5ce9ac68b30da2277cc91d4b70358f1880d (patch)
treedf3d2084ee2e35008903c03178039b9c986e2d08 /src/server/game/Handlers/MailHandler.cpp
parent052fc24315ace866ea1cf610e85df119b68100c9 (diff)
Core: ported headers cleanup from master branch
Diffstat (limited to 'src/server/game/Handlers/MailHandler.cpp')
-rw-r--r--src/server/game/Handlers/MailHandler.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp
index 1b186ae6c0a..fc283e1d3df 100644
--- a/src/server/game/Handlers/MailHandler.cpp
+++ b/src/server/game/Handlers/MailHandler.cpp
@@ -15,20 +15,21 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "DatabaseEnv.h"
-#include "Mail.h"
-#include "WorldPacket.h"
#include "WorldSession.h"
-#include "Opcodes.h"
+#include "AccountMgr.h"
+#include "CharacterCache.h"
+#include "DatabaseEnv.h"
+#include "DBCStores.h"
+#include "Item.h"
+#include "Language.h"
#include "Log.h"
-#include "World.h"
+#include "Mail.h"
+#include "ObjectAccessor.h"
#include "ObjectMgr.h"
+#include "Opcodes.h"
#include "Player.h"
-#include "Language.h"
-#include "DBCStores.h"
-#include "Item.h"
-#include "AccountMgr.h"
-#include "CharacterCache.h"
+#include "World.h"
+#include "WorldPacket.h"
bool WorldSession::CanOpenMailBox(ObjectGuid guid)
{
@@ -395,7 +396,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket& recvData)
Player* player = _player;
Mail* m = player->GetMail(mailId);
- if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
+ if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(nullptr))
{
player->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR);
return;
@@ -461,7 +462,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData)
Player* player = _player;
Mail* m = player->GetMail(mailId);
- if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
+ if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(nullptr))
{
player->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_INTERNAL_ERROR);
return;
@@ -562,7 +563,7 @@ void WorldSession::HandleMailTakeMoney(WorldPacket& recvData)
Player* player = _player;
Mail* m = player->GetMail(mailId);
- if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
+ if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(nullptr))
{
player->SendMailResult(mailId, MAIL_MONEY_TAKEN, MAIL_ERR_INTERNAL_ERROR);
return;
@@ -611,7 +612,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData)
WorldPacket data(SMSG_MAIL_LIST_RESULT, (200)); // guess size
data << uint32(0); // real mail's count
data << uint8(0); // mail's count
- time_t cur_time = time(NULL);
+ time_t cur_time = time(nullptr);
for (PlayerMails::iterator itr = player->GetMailBegin(); itr != player->GetMailEnd(); ++itr)
{
@@ -658,7 +659,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData)
data << uint32((*itr)->stationery); // stationery (Stationery.dbc)
data << uint32((*itr)->money); // Gold
data << uint32((*itr)->checked); // flags
- data << float(float((*itr)->expire_time-time(NULL))/DAY); // Time
+ data << float(float((*itr)->expire_time-time(nullptr))/DAY); // Time
data << uint32((*itr)->mailTemplateId); // mail template (MailTemplate.dbc)
data << (*itr)->subject; // Subject string - once 00, when mail type = 3, max 256
data << (*itr)->body; // message? max 8000
@@ -722,7 +723,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData)
Player* player = _player;
Mail* m = player->GetMail(mailId);
- if (!m || (m->body.empty() && !m->mailTemplateId) || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL) || (m->checked & MAIL_CHECK_MASK_COPIED))
+ if (!m || (m->body.empty() && !m->mailTemplateId) || m->state == MAIL_STATE_DELETED || m->deliver_time > time(nullptr) || (m->checked & MAIL_CHECK_MASK_COPIED))
{
player->SendMailResult(mailId, MAIL_MADE_PERMANENT, MAIL_ERR_INTERNAL_ERROR);
return;
@@ -784,7 +785,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recvData*/)
data << uint32(0); // count
uint32 count = 0;
- time_t now = time(NULL);
+ time_t now = time(nullptr);
std::set<uint32> sentSenders;
for (PlayerMails::iterator itr = _player->GetMailBegin(); itr != _player->GetMailEnd(); ++itr)
{