feat(core): Ensure that all actions are compared to fixed point in time (#1236) (#1458)

i.e. world update start
This commit is contained in:
Viste(Кирилл)
2019-02-14 21:22:17 +03:00
committed by Francesco Borzì
parent 1b7522ff0e
commit 51b8773528
108 changed files with 933 additions and 509 deletions

View File

@@ -13,6 +13,7 @@
#include "AuctionHouseMgr.h"
#include "Log.h"
#include "Language.h"
#include "GameTime.h"
#include "Opcodes.h"
#include "UpdateMask.h"
#include "Util.h"
@@ -278,7 +279,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
AH->bidder = 0;
AH->bid = 0;
AH->buyout = buyout;
AH->expire_time = time(NULL) + auctionTime;
AH->expire_time = GameTime::GetGameTime() + auctionTime;
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
@@ -320,7 +321,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
AH->bidder = 0;
AH->bid = 0;
AH->buyout = buyout;
AH->expire_time = time(NULL) + auctionTime;
AH->expire_time = GameTime::GetGameTime() + auctionTime;
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
@@ -648,7 +649,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recvData)
{
// pussywizard:
const uint32 delay = 4500;
const uint32 now = World::GetGameTimeMS();
const uint32 now = GameTime::GetGameTimeMS();
if (_lastAuctionListOwnerItemsMSTime > now) // list is pending
return;
uint32 diff = getMSTimeDiff(_lastAuctionListOwnerItemsMSTime, now);
@@ -665,7 +666,7 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(WorldPacket & recvData)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
#endif
_lastAuctionListOwnerItemsMSTime = World::GetGameTimeMS(); // pussywizard
_lastAuctionListOwnerItemsMSTime = GameTime::GetGameTimeMS(); // pussywizard
uint32 listfrom;
uint64 guid;
@@ -740,7 +741,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recvData)
// pussywizard:
const uint32 delay = 2000;
const uint32 now = World::GetGameTimeMS();
const uint32 now = GameTime::GetGameTimeMS();
uint32 diff = getMSTimeDiff(_lastAuctionListItemsMSTime, now);
if (diff > delay)
diff = delay;