mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
feat(Core/Time): Implement saparated manager for game time (#8630)
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GameTime.h"
|
||||
#include "GitRevision.h"
|
||||
#include "Group.h"
|
||||
#include "Guild.h"
|
||||
@@ -124,7 +125,7 @@ bool LoginQueryHolder::Initialize()
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt32(1, uint32(time(nullptr)));
|
||||
stmt->setUInt32(1, uint32(GameTime::GetGameTime().count()));
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_MAILS, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAILITEMS);
|
||||
@@ -914,7 +915,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
loginStmt->setUInt32(1, GetAccountId());
|
||||
LoginDatabase.Execute(loginStmt);
|
||||
|
||||
pCurrChar->SetInGameTime(World::GetGameTimeMS());
|
||||
pCurrChar->SetInGameTime(GameTime::GetGameTimeMS().count());
|
||||
|
||||
// announce group about member online (must be after add to player list to receive announce to self)
|
||||
if (Group* group = pCurrChar->GetGroup())
|
||||
@@ -928,7 +929,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
if (mapDiff->resetTime)
|
||||
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty()))
|
||||
{
|
||||
uint32 timeleft = uint32(timeReset - time(nullptr));
|
||||
uint32 timeleft = uint32(timeReset - GameTime::GetGameTime().count());
|
||||
pCurrChar->SendInstanceResetWarning(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty(), timeleft, true);
|
||||
}
|
||||
|
||||
@@ -1179,7 +1180,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
|
||||
uint32 currZone, currArea;
|
||||
pCurrChar->GetZoneAndAreaId(currZone, currArea);
|
||||
pCurrChar->SendInitWorldStates(currZone, currArea);
|
||||
pCurrChar->SetInGameTime(World::GetGameTimeMS());
|
||||
pCurrChar->SetInGameTime(GameTime::GetGameTimeMS().count());
|
||||
|
||||
// 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
|
||||
@@ -1224,7 +1225,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 - time(nullptr));
|
||||
uint32 timeleft = uint32(timeReset - GameTime::GetGameTime().count());
|
||||
GetPlayer()->SendInstanceResetWarning(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty(), timeleft, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user