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/AuctionHouse/AuctionHouseMgr.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/AuctionHouse/AuctionHouseMgr.cpp')
-rw-r--r-- | src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 21979199d7b..be9845258de 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -224,7 +224,7 @@ void AuctionPosting::BuildAuctionItem(WorldPackets::AuctionHouse::AuctionItem* a } // all (not optional<>) - auctionItem->DurationLeft = uint32(std::max(std::chrono::duration_cast<Milliseconds>(EndTime - GameTime::GetGameTimeSystemPoint()).count(), Milliseconds::zero().count())); + auctionItem->DurationLeft = uint32(std::max(std::chrono::duration_cast<Milliseconds>(EndTime - GameTime::GetSystemTime()).count(), Milliseconds::zero().count())); auctionItem->DeleteReason = 0; // SMSG_AUCTION_LIST_ITEMS_RESULT (only if owned) @@ -403,7 +403,7 @@ private: AuctionHouseMgr::AuctionHouseMgr() : mHordeAuctions(6), mAllianceAuctions(2), mNeutralAuctions(1), mGoblinAuctions(7), _replicateIdGenerator(0) { - _playerThrottleObjectsCleanupTime = GameTime::GetGameTimeSteadyPoint() + Hours(1); + _playerThrottleObjectsCleanupTime = GameTime::Now() + Hours(1); } AuctionHouseMgr::~AuctionHouseMgr() @@ -728,7 +728,7 @@ void AuctionHouseMgr::PendingAuctionProcess(Player* player) { PendingAuctionInfo const& pendingAuction = *itrAH; if (AuctionPosting* auction = GetAuctionsById(pendingAuction.AuctionHouseId)->GetAuction(pendingAuction.AuctionId)) - auction->EndTime = GameTime::GetGameTimeSystemPoint(); + auction->EndTime = GameTime::GetSystemTime(); CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_EXPIRATION); stmt->setUInt32(0, uint32(GameTime::GetGameTime())); @@ -771,7 +771,7 @@ void AuctionHouseMgr::UpdatePendingAuctions() for (PendingAuctionInfo const& pendingAuction : itr->second.Auctions) { if (AuctionPosting* auction = GetAuctionsById(pendingAuction.AuctionHouseId)->GetAuction(pendingAuction.AuctionId)) - auction->EndTime = GameTime::GetGameTimeSystemPoint(); + auction->EndTime = GameTime::GetSystemTime(); CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_EXPIRATION); stmt->setUInt32(0, uint32(GameTime::GetGameTime())); @@ -791,7 +791,7 @@ void AuctionHouseMgr::Update() mNeutralAuctions.Update(); mGoblinAuctions.Update(); - std::chrono::steady_clock::time_point now = GameTime::GetGameTimeSteadyPoint(); + TimePoint now = GameTime::Now(); if (now >= _playerThrottleObjectsCleanupTime) { for (auto itr = _playerThrottleObjects.begin(); itr != _playerThrottleObjects.end();) @@ -813,7 +813,7 @@ uint32 AuctionHouseMgr::GenerateReplicationId() AuctionThrottleResult AuctionHouseMgr::CheckThrottle(Player* player, bool addonTainted, AuctionCommand command /*= AuctionCommand::SellItem*/) { - std::chrono::steady_clock::time_point now = GameTime::GetGameTimeSteadyPoint(); + TimePoint now = GameTime::Now(); auto itr = _playerThrottleObjects.emplace(std::piecewise_construct, std::forward_as_tuple(player->GetGUID()), std::forward_as_tuple()); if (itr.second || now > itr.first->second.PeriodEnd) { @@ -1113,8 +1113,8 @@ void AuctionHouseObject::RemoveAuction(CharacterDatabaseTransaction trans, Aucti void AuctionHouseObject::Update() { - std::chrono::system_clock::time_point curTime = GameTime::GetGameTimeSystemPoint(); - std::chrono::steady_clock::time_point curTimeSteady = GameTime::GetGameTimeSteadyPoint(); + SystemTimePoint curTime = GameTime::GetSystemTime(); + TimePoint curTimeSteady = GameTime::Now(); ///- Handle expired auctions // Clear expired throttled players @@ -1517,7 +1517,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPackets::AuctionHouse::Aucti void AuctionHouseObject::BuildReplicate(WorldPackets::AuctionHouse::AuctionReplicateResponse& replicateResponse, Player* player, uint32 global, uint32 cursor, uint32 tombstone, uint32 count) { - std::chrono::steady_clock::time_point curTime = GameTime::GetGameTimeSteadyPoint(); + TimePoint curTime = GameTime::Now(); auto throttleItr = _replicateThrottleMap.find(player->GetGUID()); if (throttleItr != _replicateThrottleMap.end()) @@ -1598,7 +1598,7 @@ CommodityQuote const* AuctionHouseObject::CreateCommodityQuote(Player* player, u CommodityQuote* quote = &_commodityQuotes[player->GetGUID()]; quote->TotalPrice = totalPrice; quote->Quantity = quantity; - quote->ValidTo = GameTime::GetGameTimeSteadyPoint() + 30s; + quote->ValidTo = GameTime::Now() + 30s; return quote; } |