mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 16:16:27 +00:00
i.e. world update start
This commit is contained in:
committed by
Francesco Borzì
parent
1b7522ff0e
commit
51b8773528
@@ -18,6 +18,7 @@
|
||||
#include "Item.h"
|
||||
#include "Language.h"
|
||||
#include "Logging/Log.h"
|
||||
#include "GameTime.h"
|
||||
#include <vector>
|
||||
#include "AvgDiffTracker.h"
|
||||
#include "AsyncAuctionListing.h"
|
||||
@@ -424,7 +425,7 @@ bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction)
|
||||
|
||||
void AuctionHouseObject::Update()
|
||||
{
|
||||
time_t checkTime = sWorld->GetGameTime() + 60;
|
||||
time_t checkTime = GameTime::GetGameTime() + 60;
|
||||
///- Handle expired auctions
|
||||
|
||||
// If storage is empty, no need to update. next == NULL in this case.
|
||||
@@ -522,7 +523,7 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
||||
return true;
|
||||
}
|
||||
|
||||
time_t curTime = sWorld->GetGameTime();
|
||||
time_t curTime = GameTime::GetGameTime();
|
||||
|
||||
int loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
|
||||
int locdbc_idx = player->GetSession()->GetSessionDbcLocale();
|
||||
@@ -531,7 +532,7 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
||||
{
|
||||
if (AsyncAuctionListingMgr::IsAuctionListingAllowed() == false) // pussywizard: World::Update is waiting for us...
|
||||
if ((itrcounter++) % 100 == 0) // check condition every 100 iterations
|
||||
if (avgDiffTracker.getAverage() >= 30 || getMSTimeDiff(World::GetGameTimeMS(), getMSTime()) >= 10) // pussywizard: stop immediately if diff is high or waiting too long
|
||||
if (avgDiffTracker.getAverage() >= 30 || getMSTimeDiff(GameTime::GetGameTimeMS(), getMSTime()) >= 10) // pussywizard: stop immediately if diff is high or waiting too long
|
||||
return false;
|
||||
|
||||
AuctionEntry* Aentry = itr->second;
|
||||
@@ -669,7 +670,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
|
||||
data << uint32(bid ? GetAuctionOutBid() : 0);
|
||||
// Minimal outbid
|
||||
data << uint32(buyout); // Auction->buyout
|
||||
data << uint32((expire_time - time(NULL)) * IN_MILLISECONDS); // time left
|
||||
data << uint32((expire_time - GameTime::GetGameTime()) * IN_MILLISECONDS); // time left
|
||||
data << uint64(bidder); // auction->bidder current
|
||||
data << uint32(bid); // current bid
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user