Revert "feat(core): Ensure that all actions are compared to fixed point in time (#1236) (#1458)" (#1471)

This reverts commit 51b8773528.
This commit is contained in:
Nefertumm
2019-02-15 15:14:49 -03:00
committed by GitHub
parent 23e7ae6a2f
commit c15206fc15
108 changed files with 509 additions and 933 deletions
@@ -13,7 +13,6 @@
#include "AuctionHouseMgr.h"
#include "Log.h"
#include "Language.h"
#include "GameTime.h"
#include "Opcodes.h"
#include "UpdateMask.h"
#include "Util.h"
@@ -279,7 +278,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
AH->bidder = 0;
AH->bid = 0;
AH->buyout = buyout;
AH->expire_time = GameTime::GetGameTime() + auctionTime;
AH->expire_time = time(NULL) + auctionTime;
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
@@ -321,7 +320,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
AH->bidder = 0;
AH->bid = 0;
AH->buyout = buyout;
AH->expire_time = GameTime::GetGameTime() + auctionTime;
AH->expire_time = time(NULL) + auctionTime;
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
@@ -649,7 +648,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recvData)
{
// pussywizard:
const uint32 delay = 4500;
const uint32 now = GameTime::GetGameTimeMS();
const uint32 now = World::GetGameTimeMS();
if (_lastAuctionListOwnerItemsMSTime > now) // list is pending
return;
uint32 diff = getMSTimeDiff(_lastAuctionListOwnerItemsMSTime, now);
@@ -666,7 +665,7 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(WorldPacket & recvData)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
#endif
_lastAuctionListOwnerItemsMSTime = GameTime::GetGameTimeMS(); // pussywizard
_lastAuctionListOwnerItemsMSTime = World::GetGameTimeMS(); // pussywizard
uint32 listfrom;
uint64 guid;
@@ -741,7 +740,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recvData)
// pussywizard:
const uint32 delay = 2000;
const uint32 now = GameTime::GetGameTimeMS();
const uint32 now = World::GetGameTimeMS();
uint32 diff = getMSTimeDiff(_lastAuctionListItemsMSTime, now);
if (diff > delay)
diff = delay;
@@ -14,7 +14,6 @@
#include "ArenaTeam.h"
#include "BattlegroundMgr.h"
#include "Battleground.h"
#include "GameTime.h"
#include "Chat.h"
#include "Language.h"
#include "Log.h"
@@ -536,7 +535,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/)
if (!bg)
continue;
uint32 remainingTime = (GameTime::GetGameTimeMS() < ginfo.RemoveInviteTime ? getMSTimeDiff(GameTime::GetGameTimeMS(), ginfo.RemoveInviteTime) : 1);
uint32 remainingTime = (World::GetGameTimeMS() < ginfo.RemoveInviteTime ? getMSTimeDiff(World::GetGameTimeMS(), ginfo.RemoveInviteTime) : 1);
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, i, STATUS_WAIT_JOIN, remainingTime, 0, ginfo.ArenaType, TEAM_NEUTRAL, bg->isRated(), ginfo.BgTypeId);
SendPacket(&data);
}
@@ -553,7 +552,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/)
continue;
uint32 avgWaitTime = bgQueue.GetAverageQueueWaitTime(&ginfo);
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bgt, i, STATUS_WAIT_QUEUE, avgWaitTime, getMSTimeDiff(ginfo.JoinTime, GameTime::GetGameTimeMS()), ginfo.ArenaType, TEAM_NEUTRAL, ginfo.IsRated);
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bgt, i, STATUS_WAIT_QUEUE, avgWaitTime, getMSTimeDiff(ginfo.JoinTime, World::GetGameTimeMS()), ginfo.ArenaType, TEAM_NEUTRAL, ginfo.IsRated);
SendPacket(&data);
}
}
+9 -10
View File
@@ -31,7 +31,6 @@ Copied events should probably have a new owner
#include "ObjectMgr.h"
#include "ObjectAccessor.h"
#include "DatabaseEnv.h"
#include "GameTime.h"
#include "GuildMgr.h"
#include "ArenaTeamMgr.h"
#include "WorldSession.h"
@@ -42,7 +41,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
uint64 guid = _player->GetGUID();
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_CALENDAR [" UI64FMTD "]", guid);
time_t currTime = GameTime::GetGameTime();
time_t currTime = time(NULL);
WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 1000); // Average size if no instance
@@ -229,7 +228,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData)
// prevent events in the past
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
if (time_t(eventPackedTime) < (GameTime::GetGameTime() - time_t(86400L)))
if (time_t(eventPackedTime) < (time(NULL) - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -321,7 +320,7 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recvData)
// prevent events in the past
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
if (time_t(eventPackedTime) < (GameTime::GetGameTime() - time_t(86400L)))
if (time_t(eventPackedTime) < (time(NULL) - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -378,7 +377,7 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData)
// prevent events in the past
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
if (time_t(eventTime) < (GameTime::GetGameTime() - time_t(86400L)))
if (time_t(eventTime) < (time(NULL) - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -518,7 +517,7 @@ void WorldSession::HandleCalendarEventSignup(WorldPacket& recvData)
}
CalendarInviteStatus status = tentative ? CALENDAR_STATUS_TENTATIVE : CALENDAR_STATUS_SIGNED_UP;
CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), eventId, guid, guid, GameTime::GetGameTime(), status, CALENDAR_RANK_PLAYER, "");
CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), eventId, guid, guid, time(NULL), status, CALENDAR_RANK_PLAYER, "");
sCalendarMgr->AddInvite(calendarEvent, invite);
sCalendarMgr->SendCalendarClearPendingAction(guid);
}
@@ -550,7 +549,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recvData)
if (CalendarInvite* invite = sCalendarMgr->GetInvite(inviteId))
{
invite->SetStatus(CalendarInviteStatus(status));
invite->SetStatusTime(GameTime::GetGameTime());
invite->SetStatusTime(time(NULL));
sCalendarMgr->UpdateInvite(invite);
sCalendarMgr->SendCalendarEventStatus(*calendarEvent, *invite);
@@ -614,7 +613,7 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recvData)
{
invite->SetStatus((CalendarInviteStatus)status);
// not sure if we should set response time when moderator changes invite status
//invite->SetStatusTime(GameTime::GetGameTime());
//invite->SetStatusTime(time(NULL));
sCalendarMgr->UpdateInvite(invite);
sCalendarMgr->SendCalendarEventStatus(*calendarEvent, *invite);
@@ -714,7 +713,7 @@ void WorldSession::HandleSetSavedInstanceExtend(WorldPacket& recvData)
void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED");
time_t currTime = GameTime::GetGameTime();
time_t currTime = time(NULL);
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, (add ? 4 : 0) + 4 + 4 + 4 + 8);
if (add)
@@ -732,7 +731,7 @@ void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add)
void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save, bool isExtended)
{
time_t currTime = GameTime::GetGameTime();
time_t currTime = time(NULL);
time_t resetTime = isExtended ? save->GetExtendedResetTime() : save->GetResetTime();
time_t resetTimeOp = isExtended ? save->GetResetTime() : save->GetExtendedResetTime();
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8);
@@ -13,7 +13,6 @@
#include "Chat.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "GameTime.h"
#include "Group.h"
#include "Guild.h"
#include "GuildMgr.h"
@@ -110,7 +109,7 @@ bool LoginQueryHolder::Initialize()
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILCOUNT);
stmt->setUInt32(0, lowGuid);
stmt->setUInt64(1, uint64(GameTime::GetGameTime()));
stmt->setUInt64(1, uint64(time(NULL)));
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_MAIL_COUNT, stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILDATE);
@@ -1003,7 +1002,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
stmt->setUInt32(1, GetAccountId());
LoginDatabase.Execute(stmt);
pCurrChar->SetInGameTime(GameTime::GetGameTimeMS());
pCurrChar->SetInGameTime(World::GetGameTimeMS());
// announce group about member online (must be after add to player list to receive announce to self)
if (Group* group = pCurrChar->GetGroup())
@@ -1018,7 +1017,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
if (mapDiff->resetTime)
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty()))
{
uint32 timeleft = uint32(timeReset - GameTime::GetGameTime());
uint32 timeleft = uint32(timeReset - time(NULL));
pCurrChar->SendInstanceResetWarning(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty(), timeleft, true);
}
@@ -1264,7 +1263,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
uint32 currZone, currArea;
pCurrChar->GetZoneAndAreaId(currZone, currArea, false);
pCurrChar->SendInitWorldStates(currZone, currArea);
pCurrChar->SetInGameTime(GameTime::GetGameTimeMS());
pCurrChar->SetInGameTime(World::GetGameTimeMS());
// Xinef: we need to resend all spell mods
for (uint16 Opcode = SMSG_SET_FLAT_SPELL_MODIFIER; Opcode <= SMSG_SET_PCT_SPELL_MODIFIER; ++Opcode) // PCT = FLAT+1
@@ -1309,7 +1308,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
if (mapDiff->resetTime)
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty()))
{
uint32 timeleft = uint32(timeReset - GameTime::GetGameTime());
uint32 timeleft = uint32(timeReset - time(NULL));
GetPlayer()->SendInstanceResetWarning(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty(), timeleft, true);
}
+2 -2
View File
@@ -279,7 +279,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
if (!_player->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - GameTime::GetGameTime());
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
return;
}
@@ -666,7 +666,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recvData)
if (!GetPlayer()->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - GameTime::GetGameTime());
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
return;
}
+1 -2
View File
@@ -7,7 +7,6 @@
#include "Common.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "GameTime.h"
#include "Log.h"
#include "Opcodes.h"
#include "UpdateData.h"
@@ -36,7 +35,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName().c_str());
#endif
time_t now = GameTime::GetGameTime();
time_t now = time(NULL);
player->duel->startTimer = now;
plTarget->duel->startTimer = now;
+1 -2
View File
@@ -6,7 +6,6 @@
#include "LFGMgr.h"
#include "ObjectMgr.h"
#include "GameTime.h"
#include "Group.h"
#include "Player.h"
#include "Opcodes.h"
@@ -549,7 +548,7 @@ void WorldSession::SendLfgBootProposalUpdate(lfg::LfgPlayerBoot const& boot)
lfg::LfgAnswer playerVote = boot.votes.find(guid)->second;
uint8 votesNum = 0;
uint8 agreeNum = 0;
uint32 secsleft = boot.cancelTime - GameTime::GetGameTime();
uint32 secsleft = boot.cancelTime - time(NULL);
for (lfg::LfgAnswerContainer::const_iterator it = boot.votes.begin(); it != boot.votes.end(); ++it)
{
if (it->second != lfg::LFG_ANSWER_PENDING)
+7 -8
View File
@@ -9,7 +9,6 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Opcodes.h"
#include "GameTime.h"
#include "Log.h"
#include "World.h"
#include "ObjectMgr.h"
@@ -366,7 +365,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recvData)
Player* player = _player;
Mail* m = player->GetMail(mailId);
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > GameTime::GetGameTime())
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
{
player->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR);
return;
@@ -431,7 +430,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recvData)
Player* player = _player;
Mail* m = player->GetMail(mailId);
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > GameTime::GetGameTime())
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
{
player->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_INTERNAL_ERROR);
return;
@@ -531,7 +530,7 @@ void WorldSession::HandleMailTakeMoney(WorldPacket& recvData)
Player* player = _player;
Mail* m = player->GetMail(mailId);
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > GameTime::GetGameTime())
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
{
player->SendMailResult(mailId, MAIL_MONEY_TAKEN, MAIL_ERR_INTERNAL_ERROR);
return;
@@ -580,7 +579,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 = GameTime::GetGameTime();
time_t cur_time = time(NULL);
for (PlayerMails::iterator itr = player->GetMailBegin(); itr != player->GetMailEnd(); ++itr)
{
@@ -627,7 +626,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-GameTime::GetGameTime())/DAY); // Time
data << float(float((*itr)->expire_time-time(NULL))/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
@@ -691,7 +690,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 > GameTime::GetGameTime() || (m->checked & MAIL_CHECK_MASK_COPIED))
if (!m || (m->body.empty() && !m->mailTemplateId) || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL) || (m->checked & MAIL_CHECK_MASK_COPIED))
{
player->SendMailResult(mailId, MAIL_MADE_PERMANENT, MAIL_ERR_INTERNAL_ERROR);
return;
@@ -758,7 +757,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recvData*/)
data << uint32(0); // count
uint32 count = 0;
time_t now = GameTime::GetGameTime();
time_t now = time(NULL);
std::set<uint32> sentSenders;
for (PlayerMails::iterator itr = _player->GetMailBegin(); itr != _player->GetMailEnd(); ++itr)
{
+5 -6
View File
@@ -15,7 +15,6 @@
#include "World.h"
#include "ObjectMgr.h"
#include "GuildMgr.h"
#include "GameTime.h"
#include "WorldSession.h"
#include "BigNumber.h"
#include "SHA1.h"
@@ -219,7 +218,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_WHO Message");
time_t now = GameTime::GetGameTime();
time_t now = time(NULL);
if (now < timeWhoCommandAllowed)
return;
timeWhoCommandAllowed = now + 3;
@@ -467,7 +466,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/)
GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
LogoutRequest(GameTime::GetGameTime());
LogoutRequest(time(NULL));
}
void WorldSession::HandlePlayerLogoutOpcode(WorldPacket & /*recv_data*/)
@@ -818,7 +817,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data)
return;
// prevent resurrect before 30-sec delay after body release not finished
if (time_t(corpse->GetGhostTime() + _player->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(GameTime::GetGameTime()))
if (time_t(corpse->GetGhostTime() + _player->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(time(NULL)))
return;
if (!corpse->IsWithinDistInMap(_player, CORPSE_RECLAIM_RADIUS, true))
@@ -1525,7 +1524,7 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data)
{
uint32 counter, clientTicks;
recv_data >> counter >> clientTicks;
//uint32 ourTicks = clientTicks + (GameTime::GetGameTimeMS() - _player->m_timeSyncServer);
//uint32 ourTicks = clientTicks + (World::GetGameTimeMS() - _player->m_timeSyncServer);
_player->m_timeSyncClient = clientTicks;
}
@@ -1859,7 +1858,7 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/)
#endif
WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4);
data << uint32(GameTime::GetGameTime());
data << uint32(time(NULL));
SendPacket(&data);
}
+3 -3
View File
@@ -152,7 +152,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
_player->SetIsSpectator(false);
GetPlayer()->SetPendingSpectatorForBG(0);
timeWhoCommandAllowed = GameTime::GetGameTime() + sWorld->GetNextWhoListUpdateDelaySecs() + 1; // after exiting arena Subscribe will scan for a player and cached data says he is still in arena, so disallow until next update
timeWhoCommandAllowed = time(NULL) + sWorld->GetNextWhoListUpdateDelaySecs() + 1; // after exiting arena Subscribe will scan for a player and cached data says he is still in arena, so disallow until next update
if (uint32 inviteInstanceId = _player->GetPendingSpectatorInviteInstanceId())
{
@@ -193,7 +193,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if (mapDiff->resetTime)
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->MapID, diff))
{
uint32 timeleft = uint32(timeReset - GameTime::GetGameTime());
uint32 timeleft = uint32(timeReset - time(NULL));
GetPlayer()->SendInstanceResetWarning(mEntry->MapID, diff, timeleft, true);
}
allowMount = mInstance->AllowMount;
@@ -408,7 +408,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
if (mover->GetGUID() != _player->GetGUID())
movementInfo.flags &= ~MOVEMENTFLAG_WALKING;
uint32 mstime = GameTime::GetGameTimeMS();
uint32 mstime = World::GetGameTimeMS();
/*----------------------*/
if(m_clientTimeDelay == 0)
m_clientTimeDelay = mstime > movementInfo.time ? std::min(mstime - movementInfo.time, (uint32)100) : 0;
+4 -5
View File
@@ -8,7 +8,6 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "ObjectMgr.h"
#include "GameTime.h"
#include "SpellMgr.h"
#include "Log.h"
#include "Opcodes.h"
@@ -129,7 +128,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
Map* map = owner->GetMap();
uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
Pet* pet = new Pet(owner, pet_type);
LoadPetFromDBQueryHolder* holder = new LoadPetFromDBQueryHolder(pet_number, current, uint32(GameTime::GetGameTime() - fields[14].GetUInt32()), fields[13].GetString(), savedhealth, savedmana);
LoadPetFromDBQueryHolder* holder = new LoadPetFromDBQueryHolder(pet_number, current, uint32(time(NULL) - fields[14].GetUInt32()), fields[13].GetString(), savedhealth, savedmana);
if (!pet->Create(guid, map, owner->GetPhaseMask(), petentry, pet_number) || !holder->Initialize())
{
delete pet;
@@ -199,7 +198,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
break;
}
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(GameTime::GetGameTime())); // cast can't be helped here
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped here
pet->SetCreatorGUID(owner->GetGUID());
owner->SetMinion(pet, true);
@@ -553,7 +552,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
// pussywizard:
if (Creature* creaturePet = pet->ToCreature())
if (!creaturePet->_CanDetectFeignDeathOf(TargetUnit) || !creaturePet->CanCreatureAttack(TargetUnit) || creaturePet->isTargetNotAcceptableByMMaps(TargetUnit->GetGUID(), GameTime::GetGameTime(), TargetUnit))
if (!creaturePet->_CanDetectFeignDeathOf(TargetUnit) || !creaturePet->CanCreatureAttack(TargetUnit) || creaturePet->isTargetNotAcceptableByMMaps(TargetUnit->GetGUID(), sWorld->GetGameTime(), TargetUnit))
return;
// Not let attack through obstructions
@@ -1192,7 +1191,7 @@ void WorldSession::HandlePetRename(WorldPacket & recvData)
CharacterDatabase.CommitTransaction(trans);
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(GameTime::GetGameTime())); // cast can't be helped
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped
}
void WorldSession::HandlePetAbandon(WorldPacket & recvData)
+2 -3
View File
@@ -7,7 +7,6 @@
#include "Common.h"
#include "Language.h"
#include "DatabaseEnv.h"
#include "GameTime.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Opcodes.h"
@@ -73,8 +72,8 @@ void WorldSession::HandleQueryTimeOpcode(WorldPacket & /*recvData*/)
void WorldSession::SendQueryTimeResponse()
{
WorldPacket data(SMSG_QUERY_TIME_RESPONSE, 4+4);
data << uint32(GameTime::GetGameTime());
data << uint32(sWorld->GetNextDailyQuestsResetTime() - GameTime::GetGameTime());
data << uint32(time(NULL));
data << uint32(sWorld->GetNextDailyQuestsResetTime() - time(NULL));
SendPacket(&data);
}
+1 -2
View File
@@ -9,7 +9,6 @@
#include "Language.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "GameTime.h"
#include "Player.h"
#include "TicketMgr.h"
#include "Util.h"
@@ -238,7 +237,7 @@ void WorldSession::HandleReportLag(WorldPacket& recv_data)
stmt->setFloat (4, y);
stmt->setFloat (5, z);
stmt->setUInt32(6, GetLatency());
stmt->setUInt32(7, GameTime::GetGameTime());
stmt->setUInt32(7, time(NULL));
CharacterDatabase.Execute(stmt);
}