diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-07-14 01:35:25 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-23 21:36:03 +0100 |
commit | d11c3807b32d51e48ed4557972a627f6366956d9 (patch) | |
tree | 3a551793088ff8b7d1475cc1045fbab811b94188 /src/server/game/Achievements/AchievementMgr.cpp | |
parent | dfc1f08bd84503f6023d033396fc33d356220a62 (diff) |
Core/Time: Rename GetGameTime{System, Steady}Point methods
The names are a bit unhandy. Rename them (shorter but still meaningful).
GetGameTimeSystemPoint() -> GetSystemTime()
GetGameTimeSteadyPoint() -> Now()
Also add 2 new typedefs:
typedef std::chrono::steady_clock::time_point TimePoint;
typedef std::chrono::system_clock::time_point SystemTimePoint;
Closes #25042
(cherry picked from commit 896b68d5c297b06587645caebc98b704978ecaa7)
Diffstat (limited to 'src/server/game/Achievements/AchievementMgr.cpp')
-rw-r--r-- | src/server/game/Achievements/AchievementMgr.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 1f66c00786f..cbc73da75e5 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1081,17 +1081,17 @@ bool AchievementGlobalMgr::IsRealmCompleted(AchievementEntry const* achievement) if (itr == _allCompletedAchievements.end()) return false; - if (itr->second == std::chrono::system_clock::time_point::min()) + if (itr->second == SystemTimePoint ::min()) return false; - if (itr->second == std::chrono::system_clock::time_point::max()) + if (itr->second == SystemTimePoint::max()) return true; // Allow completing the realm first kill for entire minute after first person did it // it may allow more than one group to achieve it (highly unlikely) // but apparently this is how blizz handles it as well if (achievement->Flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL) - return (std::chrono::system_clock::now() - itr->second) > Minutes(1); + return (GameTime::GetSystemTime() - itr->second) > Minutes(1); return true; } @@ -1101,7 +1101,7 @@ void AchievementGlobalMgr::SetRealmCompleted(AchievementEntry const* achievement if (IsRealmCompleted(achievement)) return; - _allCompletedAchievements[achievement->ID] = std::chrono::system_clock::now(); + _allCompletedAchievements[achievement->ID] = GameTime::GetSystemTime(); } //========================================================== @@ -1148,7 +1148,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() // instead the only potential race will happen on value associated with the key for (AchievementEntry const* achievement : sAchievementStore) if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) - _allCompletedAchievements[achievement->ID] = std::chrono::system_clock::time_point::min(); + _allCompletedAchievements[achievement->ID] = SystemTimePoint::min(); QueryResult result = CharacterDatabase.Query("SELECT achievement FROM character_achievement GROUP BY achievement"); @@ -1176,7 +1176,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() continue; } else if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) - _allCompletedAchievements[achievementId] = std::chrono::system_clock::time_point::max(); + _allCompletedAchievements[achievementId] = SystemTimePoint::max(); } while (result->NextRow()); |