mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 07:53:44 +00:00
feat(Core/Time): Implement saparated manager for game time (#8630)
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "DBCEnums.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GameTime.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Group.h"
|
||||
#include "GuildMgr.h"
|
||||
@@ -464,7 +465,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequ
|
||||
GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
}
|
||||
|
||||
SetLogoutStartTime(time(nullptr));
|
||||
SetLogoutStartTime(GameTime::GetGameTime().count());
|
||||
}
|
||||
|
||||
void WorldSession::HandlePlayerLogoutOpcode(WorldPackets::Character::PlayerLogout& /*playerLogout*/)
|
||||
@@ -651,7 +652,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(time(nullptr)))
|
||||
if (time_t(corpse->GetGhostTime() + _player->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(GameTime::GetGameTime().count()))
|
||||
return;
|
||||
|
||||
if (!corpse->IsWithinDistInMap(_player, CORPSE_RECLAIM_RADIUS, true))
|
||||
@@ -1570,7 +1571,7 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/)
|
||||
LOG_DEBUG("network", "WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE");
|
||||
|
||||
WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4);
|
||||
data << uint32(time(nullptr));
|
||||
data << uint32(GameTime::GetGameTime().count());
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user