diff options
author | Chaz Brown <iamparadox@netscape.net> | 2009-08-19 15:20:10 -0400 |
---|---|---|
committer | Chaz Brown <iamparadox@netscape.net> | 2009-08-19 15:20:10 -0400 |
commit | 4ac7a2d0720d0e7597724f2cafefbe224b5cbab7 (patch) | |
tree | 0b59d21c8f3786563ab7b2ddadd8d2157b1429f9 /src/game/AuctionHouseBot.cpp | |
parent | 69c3abfc0ba59d6f46050577d83481ea84e5055f (diff) |
AHBuyer now buys when it's supposed to.
Fixed some mails using hardcoded HOUR instead of MailTimeDelay from config.
AHBuyer once again sends out pending sale mails, and they use the correct time. (Thanks for helping, Aokromes)
Still needs some work to make the time update every second, instead of every minute.
Also, thesale pending mail doesn't get deleted when the timer runs out, but, on the next
mail cleanup.
--HG--
branch : trunk
Diffstat (limited to 'src/game/AuctionHouseBot.cpp')
-rw-r--r-- | src/game/AuctionHouseBot.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/game/AuctionHouseBot.cpp b/src/game/AuctionHouseBot.cpp index 8892b8a8cbb..6ce263ba8d0 100644 --- a/src/game/AuctionHouseBot.cpp +++ b/src/game/AuctionHouseBot.cpp @@ -71,6 +71,10 @@ AuctionHouseBot::AuctionHouseBot() //End Filters + _lastrun_a = time(NULL); + _lastrun_h = time(NULL); + _lastrun_n = time(NULL); + AllianceConfig = AHBConfig(2); HordeConfig = AHBConfig(6); NeutralConfig = AHBConfig(7); @@ -709,6 +713,7 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con auction->bid = auction->buyout; // Send mails to buyer & seller + auctionmgr.SendAuctionSalePendingMail(auction); auctionmgr.SendAuctionSuccessfulMail(auction); auctionmgr.SendAuctionWonMail(auction); @@ -738,23 +743,29 @@ void AuctionHouseBot::Update() if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) { addNewAuctions(&_AHBplayer, &AllianceConfig); - if (((_newrun - _lastrun_a) > (AllianceConfig.GetBiddingInterval() * 60)) && (AllianceConfig.GetBidsPerInterval() > 0)) + if (((_newrun - _lastrun_a) >= (AllianceConfig.GetBiddingInterval() * MINUTE)) && (AllianceConfig.GetBidsPerInterval() > 0)) { + //if (debug_Out) sLog.outString("AHBuyer: %u seconds have passed since last bid", (_newrun - _lastrun_a)); + //if (debug_Out) sLog.outString("AHBuyer: Bidding on Alliance Auctions"); addNewAuctionBuyerBotBid(&_AHBplayer, &AllianceConfig, &_session); _lastrun_a = _newrun; } addNewAuctions(&_AHBplayer, &HordeConfig); - if (((_newrun - _lastrun_h) > (HordeConfig.GetBiddingInterval() *60)) && (HordeConfig.GetBidsPerInterval() > 0)) + if (((_newrun - _lastrun_h) >= (HordeConfig.GetBiddingInterval() * MINUTE)) && (HordeConfig.GetBidsPerInterval() > 0)) { + //if (debug_Out) sLog.outString("AHBuyer: %u seconds have passed since last bid", (_newrun - _lastrun_h)); + //if (debug_Out) sLog.outString("AHBuyer: Bidding on Horde Auctions"); addNewAuctionBuyerBotBid(&_AHBplayer, &HordeConfig, &_session); _lastrun_h = _newrun; } } addNewAuctions(&_AHBplayer, &NeutralConfig); - if (((_newrun - _lastrun_n) > (NeutralConfig.GetBiddingInterval() * 60)) && (NeutralConfig.GetBidsPerInterval() > 0)) + if (((_newrun - _lastrun_n) >= (NeutralConfig.GetBiddingInterval() * MINUTE)) && (NeutralConfig.GetBidsPerInterval() > 0)) { + //if (debug_Out) sLog.outString("AHBuyer: %u seconds have passed since last bid", (_newrun - _lastrun_n)); + //if (debug_Out) sLog.outString("AHBuyer: Bidding on Neutral Auctions"); addNewAuctionBuyerBotBid(&_AHBplayer, &NeutralConfig, &_session); _lastrun_n = _newrun; } |