mirror of
https://github.com/NathanHandley/mod-ah-bot-plus.git
synced 2026-01-13 01:08:37 +00:00
Adjust debug logging to catch more data
This commit is contained in:
@@ -851,79 +851,79 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player* AHBplayer, AHBConfig *con
|
|||||||
else if (auction->startbid < willingToPayForStackPrice && auction->GetAuctionOutBid() < willingToPayForStackPrice)
|
else if (auction->startbid < willingToPayForStackPrice && auction->GetAuctionOutBid() < willingToPayForStackPrice)
|
||||||
doBid = true;
|
doBid = true;
|
||||||
|
|
||||||
if (doBuyout == true || doBid == true)
|
if (debug_Out)
|
||||||
{
|
{
|
||||||
if (debug_Out)
|
LOG_INFO("module", "-------------------------------------------------");
|
||||||
{
|
LOG_INFO("module", "AHBuyer: Info for Auction #{}:", auction->Id);
|
||||||
LOG_INFO("module", "-------------------------------------------------");
|
LOG_INFO("module", "AHBuyer: AuctionHouse: {}", auction->GetHouseId());
|
||||||
LOG_INFO("module", "AHBuyer: Info for Auction #{}:", auction->Id);
|
LOG_INFO("module", "AHBuyer: Owner: {}", auction->owner.ToString());
|
||||||
LOG_INFO("module", "AHBuyer: AuctionHouse: {}", auction->GetHouseId());
|
LOG_INFO("module", "AHBuyer: Bidder: {}", auction->bidder.ToString());
|
||||||
LOG_INFO("module", "AHBuyer: Owner: {}", auction->owner.ToString());
|
LOG_INFO("module", "AHBuyer: Expire Time: {}", uint32(auction->expire_time));
|
||||||
LOG_INFO("module", "AHBuyer: Bidder: {}", auction->bidder.ToString());
|
LOG_INFO("module", "AHBuyer: Item GUID: {}", auction->item_guid.ToString());
|
||||||
LOG_INFO("module", "AHBuyer: Starting Bid: {}", auction->startbid);
|
LOG_INFO("module", "AHBuyer: Item Template: {}", auction->item_template);
|
||||||
LOG_INFO("module", "AHBuyer: Current Bid: {}", auction->bid);
|
LOG_INFO("module", "AHBuyer: Item Info:");
|
||||||
LOG_INFO("module", "AHBuyer: Buyout: {}", auction->buyout);
|
LOG_INFO("module", "AHBuyer: Item ID: {}", prototype->ItemId);
|
||||||
LOG_INFO("module", "AHBuyer: Deposit: {}", auction->deposit);
|
LOG_INFO("module", "AHBuyer: Vendor Buy Price: {}", prototype->BuyPrice);
|
||||||
LOG_INFO("module", "AHBuyer: Expire Time: {}", uint32(auction->expire_time));
|
LOG_INFO("module", "AHBuyer: Vendor Sell Price: {}", prototype->SellPrice);
|
||||||
LOG_INFO("module", "AHBuyer: Willing To Pay For Stack Price: {}", willingToPayForStackPrice);
|
LOG_INFO("module", "AHBuyer: Deposit: {}", auction->deposit);
|
||||||
LOG_INFO("module", "AHBuyer: Item GUID: {}", auction->item_guid.ToString());
|
LOG_INFO("module", "AHBuyer: Bonding: {}", prototype->Bonding);
|
||||||
LOG_INFO("module", "AHBuyer: Item Template: {}", auction->item_template);
|
LOG_INFO("module", "AHBuyer: Quality: {}", prototype->Quality);
|
||||||
LOG_INFO("module", "AHBuyer: Item Info:");
|
LOG_INFO("module", "AHBuyer: Item Level: {}", prototype->ItemLevel);
|
||||||
LOG_INFO("module", "AHBuyer: Item ID: {}", prototype->ItemId);
|
LOG_INFO("module", "AHBuyer: Ammo Type: {}", prototype->AmmoType);
|
||||||
LOG_INFO("module", "AHBuyer: Buy Price: {}", prototype->BuyPrice);
|
LOG_INFO("module", "AHBuyer: Stack Size: {}", pItem->GetCount());
|
||||||
LOG_INFO("module", "AHBuyer: Sell Price: {}", prototype->SellPrice);
|
LOG_INFO("module", "AHBuyer: Starting Bid: {}", auction->startbid);
|
||||||
LOG_INFO("module", "AHBuyer: Bonding: {}", prototype->Bonding);
|
LOG_INFO("module", "AHBuyer: Current Bid: {}", auction->bid);
|
||||||
LOG_INFO("module", "AHBuyer: Quality: {}", prototype->Quality);
|
LOG_INFO("module", "AHBuyer: Buyout Price: {}", auction->buyout);
|
||||||
LOG_INFO("module", "AHBuyer: Item Level: {}", prototype->ItemLevel);
|
LOG_INFO("module", "AHBuyer: Willing To Pay Per Item Price: {}", willingToSpendPerItemPrice);
|
||||||
LOG_INFO("module", "AHBuyer: Ammo Type: {}", prototype->AmmoType);
|
LOG_INFO("module", "AHBuyer: Willing To Pay For Stack Price: {}", willingToPayForStackPrice);
|
||||||
LOG_INFO("module", "-------------------------------------------------");
|
LOG_INFO("module", "AHBuyer: Decided to Buyout?: {}", doBuyout);
|
||||||
}
|
LOG_INFO("module", "AHBuyer: Decided to Bid?: {}", doBid);
|
||||||
|
LOG_INFO("module", "-------------------------------------------------");
|
||||||
|
}
|
||||||
|
if (doBid)
|
||||||
|
{
|
||||||
|
auto trans = CharacterDatabase.BeginTransaction();
|
||||||
|
|
||||||
if (doBid)
|
// Perform outbid
|
||||||
{
|
uint32 bidAmount = 0;
|
||||||
auto trans = CharacterDatabase.BeginTransaction();
|
if (auction->bid == 0)
|
||||||
|
bidAmount = auction->startbid;
|
||||||
|
else
|
||||||
|
bidAmount = auction->GetAuctionOutBid();
|
||||||
|
|
||||||
// Perform outbid
|
if (auction->bidder)
|
||||||
uint32 bidAmount = 0;
|
sAuctionMgr->SendAuctionOutbiddedMail(auction, bidAmount, AHBplayer, trans);
|
||||||
if (auction->bid == 0)
|
|
||||||
bidAmount = auction->startbid;
|
|
||||||
else
|
|
||||||
bidAmount = auction->GetAuctionOutBid();
|
|
||||||
|
|
||||||
if (auction->bidder)
|
auction->bidder = AHBplayer->GetGUID();
|
||||||
sAuctionMgr->SendAuctionOutbiddedMail(auction, bidAmount, AHBplayer, trans);
|
auction->bid = bidAmount;
|
||||||
|
|
||||||
auction->bidder = AHBplayer->GetGUID();
|
sAuctionMgr->GetAuctionHouseSearcher()->UpdateBid(auction);
|
||||||
auction->bid = bidAmount;
|
|
||||||
|
|
||||||
sAuctionMgr->GetAuctionHouseSearcher()->UpdateBid(auction);
|
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
|
||||||
|
stmt->SetData(0, auction->bidder.GetCounter());
|
||||||
|
stmt->SetData(1, auction->bid);
|
||||||
|
stmt->SetData(2, auction->Id);
|
||||||
|
trans->Append(stmt);
|
||||||
|
|
||||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
|
CharacterDatabase.CommitTransaction(trans);
|
||||||
stmt->SetData(0, auction->bidder.GetCounter());
|
}
|
||||||
stmt->SetData(1, auction->bid);
|
else if (doBuyout)
|
||||||
stmt->SetData(2, auction->Id);
|
{
|
||||||
trans->Append(stmt);
|
auto trans = CharacterDatabase.BeginTransaction();
|
||||||
|
|
||||||
CharacterDatabase.CommitTransaction(trans);
|
if ((auction->bidder) && (AHBplayer->GetGUID() != auction->bidder))
|
||||||
}
|
sAuctionMgr->SendAuctionOutbiddedMail(auction, auction->buyout, AHBplayer, trans);
|
||||||
else if (doBuyout)
|
auction->bidder = AHBplayer->GetGUID();
|
||||||
{
|
auction->bid = auction->buyout;
|
||||||
auto trans = CharacterDatabase.BeginTransaction();
|
|
||||||
|
|
||||||
if ((auction->bidder) && (AHBplayer->GetGUID() != auction->bidder))
|
// Send mails to buyer & seller
|
||||||
sAuctionMgr->SendAuctionOutbiddedMail(auction, auction->buyout, AHBplayer, trans);
|
sAuctionMgr->SendAuctionSuccessfulMail(auction, trans);
|
||||||
auction->bidder = AHBplayer->GetGUID();
|
sAuctionMgr->SendAuctionWonMail(auction, trans);
|
||||||
auction->bid = auction->buyout;
|
auction->DeleteFromDB(trans);
|
||||||
|
|
||||||
// Send mails to buyer & seller
|
sAuctionMgr->RemoveAItem(auction->item_guid);
|
||||||
sAuctionMgr->SendAuctionSuccessfulMail(auction, trans);
|
auctionHouse->RemoveAuction(auction);
|
||||||
sAuctionMgr->SendAuctionWonMail(auction, trans);
|
CharacterDatabase.CommitTransaction(trans);
|
||||||
auction->DeleteFromDB(trans);
|
|
||||||
|
|
||||||
sAuctionMgr->RemoveAItem(auction->item_guid);
|
|
||||||
auctionHouse->RemoveAuction(auction);
|
|
||||||
CharacterDatabase.CommitTransaction(trans);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1372,4 +1372,4 @@ const char* AuctionHouseBot::GetCategoryName(ItemClass category)
|
|||||||
case ITEM_CLASS_GLYPH: return "Glyph";
|
case ITEM_CLASS_GLYPH: return "Glyph";
|
||||||
default: return "Unknown";
|
default: return "Unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user