diff options
author | xinef1 <w.szyszko2@gmail.com> | 2017-03-02 02:19:25 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2019-08-17 20:04:14 +0200 |
commit | 60663d1374beef3103f4787152654034fa4a8897 (patch) | |
tree | 38e07d44442ad903a9729536942e8e253a072274 /src/server/game/Handlers/CharacterHandler.cpp | |
parent | 98180ecdc179386270e93b80c0db8344b659557f (diff) |
Ensure that all actions are compared to fixed point in time (ie. world update start) (#18910)
- Actions will not be dependent on processing moment
- Increased GameObjects cooldown resolution to milliseconds, fixes arming time of traps to be exactly one second and not something from range (1000, 1999)
- Created GameTime namespace and UpdateTime class and moved there some code out of world
(cherrypicked from 7567cafec84080d26ea513242a1f540a823b8f9d)
Diffstat (limited to 'src/server/game/Handlers/CharacterHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index cc8cd627804..4861bbdeeb8 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -35,6 +35,7 @@ #include "DB2Stores.h" #include "EquipmentSetPackets.h" #include "GameObject.h" +#include "GameTime.h" #include "GitRevision.h" #include "Group.h" #include "Guild.h" @@ -920,7 +921,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) WorldPackets::ClientConfig::AccountDataTimes accountDataTimes; accountDataTimes.PlayerGuid = playerGuid; - accountDataTimes.ServerTime = uint32(sWorld->GetGameTime()); + accountDataTimes.ServerTime = uint32(GameTime::GetGameTime()); for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i) accountDataTimes.AccountTimes[i] = uint32(GetAccountData(AccountDataType(i))->Time); @@ -1030,7 +1031,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) loginStmt->setUInt32(0, GetAccountId()); LoginDatabase.Execute(loginStmt); - pCurrChar->SetInGameTime(getMSTime()); + pCurrChar->SetInGameTime(GameTime::GetGameTimeMS()); // announce group about member online (must be after add to player list to receive announce to self) if (Group* group = pCurrChar->GetGroup()) |