aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/AuctionHouseBot.cpp17
-rw-r--r--src/game/AuctionHouseMgr.cpp4
-rw-r--r--src/game/Mail.cpp2
3 files changed, 17 insertions, 6 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;
}
diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp
index ba412dea8be..85bc815efd1 100644
--- a/src/game/AuctionHouseMgr.cpp
+++ b/src/game/AuctionHouseMgr.cpp
@@ -209,7 +209,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
std::ostringstream msgAuctionSalePendingBody;
uint32 auctionCut = auction->GetAuctionCut();
- time_t distrTime = time(NULL) + HOUR;
+ time_t distrTime = time(NULL) + sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY);
msgAuctionSalePendingBody.width(16);
msgAuctionSalePendingBody << std::right << std::hex << auction->bidder;
@@ -263,7 +263,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
owner->GetSession()->SendAuctionOwnerNotification( auction );
}
- WorldSession::SendMailTo(owner, MAIL_AUCTION, MAIL_STATIONERY_AUCTION, auction->GetHouseId(), auction->owner, msgAuctionSuccessfulSubject.str(), itemTextId, NULL, profit, 0, MAIL_CHECK_MASK_AUCTION, HOUR);
+ WorldSession::SendMailTo(owner, MAIL_AUCTION, MAIL_STATIONERY_AUCTION, auction->GetHouseId(), auction->owner, msgAuctionSuccessfulSubject.str(), itemTextId, NULL, profit, 0, MAIL_CHECK_MASK_AUCTION, sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY));
}
}
diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
index f0af479374c..39ed3d4f9f0 100644
--- a/src/game/Mail.cpp
+++ b/src/game/Mail.cpp
@@ -857,7 +857,7 @@ void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 station
//expire time if COD 3 days, if no COD 30 days, if auction sale pending 1 hour
uint32 expire_delay;
if(messageType == MAIL_AUCTION && !mi && !money) // auction mail without any items and money
- expire_delay = HOUR;
+ expire_delay = sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY);
else
expire_delay = (COD > 0) ? 3*DAY : 30*DAY;