Replaced time(NULL) on sGameTime.GetGameTime() this is used for better performance.

Original Timer.h divided into 2 parts. Shared project has no need to know about GameTime Singleton.
2 Identical structures with different types are now replaced with one generic templated structure and 2 typedefs.

--HG--
branch : trunk
This commit is contained in:
n0n4m3 committed 2009-12-23 08:04:10 +01:00
1 parent 7ea2510980
commit 3fe0bc5254
51 files changed
+352 -364

No files matched your search

+7 -6
View File
@@ -1,6 +1,7 @@
#include "ObjectMgr.h"
#include "AuctionHouseMgr.h"
#include "AuctionHouseBot.h"
#include "TimeMgr.h"
#include <vector>
#include "Policies/SingletonImp.h"
@@ -89,9 +90,9 @@ AuctionHouseBot::AuctionHouseBot()
//End Filters
_lastrun_a = time(NULL);
_lastrun_h = time(NULL);
_lastrun_n = time(NULL);
_lastrun_a = sGameTime.GetGameTime();
_lastrun_h = sGameTime.GetGameTime();
_lastrun_n = sGameTime.GetGameTime();
AllianceConfig = AHBConfig(2);
HordeConfig = AHBConfig(6);
@@ -419,7 +420,7 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
auctionEntry->bidder = 0;
auctionEntry->bid = 0;
auctionEntry->deposit = dep;
auctionEntry->expire_time = (time_t) etime + time(NULL);
auctionEntry->expire_time = (time_t) etime + sGameTime.GetGameTime();
auctionEntry->auctionHouseEntry = ahEntry;
item->SaveToDB();
item->RemoveFromUpdateQueueOf(AHBplayer);
@@ -695,7 +696,7 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
void AuctionHouseBot::Update()
{
time_t _newrun = time(NULL);
time_t _newrun = sGameTime.GetGameTime();
if ((!AHBSeller) && (!AHBBuyer))
return;
@@ -1506,7 +1507,7 @@ void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, uint32 col, char*
{
if (itr->second->owner == AHBplayerGUID)
{
itr->second->expire_time = sWorld.GetGameTime();
itr->second->expire_time = sGameTime.GetGameTime();
uint32 id = itr->second->Id;
uint32 expire_time = itr->second->expire_time;
CharacterDatabase.PExecute("UPDATE auctionhouse SET time = '%u' WHERE id = '%u'", expire_time, id);