feat(Logging): add support new logging (#49)

This commit is contained in:
Kargatum
2022-01-27 23:45:38 +07:00
committed by GitHub
parent a1b2cd5989
commit 669e505a93

View File

@@ -124,7 +124,8 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
{
if (!AHBSeller)
{
if (debug_Out) sLog->outString("AHSeller: Disabled");
if (debug_Out)
LOG_INFO("module", "AHSeller: Disabled");
return;
}
@@ -154,13 +155,15 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
if (auctions >= minItems)
{
if (debug_Out) sLog->outError( "AHSeller: Auctions above minimum");
if (debug_Out)
LOG_ERROR("module", "AHSeller: Auctions above minimum");
return;
}
if (auctions >= maxItems)
{
if (debug_Out) sLog->outError( "AHSeller: Auctions at or above maximum");
if (debug_Out)
LOG_ERROR("module", "AHSeller: Auctions at or above maximum");
return;
}
@@ -169,9 +172,11 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
else
items = (maxItems - auctions);
if (debug_Out) sLog->outString("AHSeller: Adding %u Auctions", items);
if (debug_Out)
LOG_INFO("module", "AHSeller: Adding {} Auctions", items);
if (debug_Out) sLog->outError( "AHSeller: Current house id is %u", config->GetAHID());
if (debug_Out)
LOG_ERROR("module", "AHSeller: Current house id is {}", config->GetAHID());
uint32 greyTGcount = config->GetPercents(AHB_GREY_TG);
uint32 whiteTGcount = config->GetPercents(AHB_WHITE_TG);
@@ -207,12 +212,16 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
uint32 purpleItems = config->GetItemCounts(AHB_PURPLE_I);
uint32 orangeItems = config->GetItemCounts(AHB_ORANGE_I);
uint32 yellowItems = config->GetItemCounts(AHB_YELLOW_I);
if (debug_Out) sLog->outError( "AHSeller: %u items", items);
if (debug_Out)
LOG_ERROR("module", "AHSeller: {} items", items);
// only insert a few at a time, so as not to peg the processor
for (uint32 cnt = 1; cnt <= items; cnt++)
{
if (debug_Out) sLog->outError( "AHSeller: %u count", cnt);
if (debug_Out)
LOG_ERROR("module", "AHSeller: {} count", cnt);
uint32 itemID = 0;
uint32 itemColor = 99;
uint32 loopbreaker = 0;
@@ -323,28 +332,32 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
}
default:
{
if (debug_Out) sLog->outError( "AHSeller: itemID Switch - Default Reached");
if (debug_Out)
LOG_ERROR("module", "AHSeller: itemID Switch - Default Reached");
break;
}
}
if (itemID == 0)
{
if (debug_Out) sLog->outError( "AHSeller: Item::CreateItem() - ItemID is 0");
if (debug_Out)
LOG_ERROR("module", "AHSeller: Item::CreateItem() - ItemID is 0");
continue;
}
ItemTemplate const* prototype = sObjectMgr->GetItemTemplate(itemID);
if (prototype == NULL)
{
if (debug_Out) sLog->outError( "AHSeller: Huh?!?! prototype == NULL");
if (debug_Out)
LOG_ERROR("module", "AHSeller: Huh?!?! prototype == NULL");
continue;
}
Item* item = Item::CreateItem(itemID, 1, AHBplayer);
if (item == NULL)
{
if (debug_Out) sLog->outError( "AHSeller: Item::CreateItem() returned NULL");
if (debug_Out)
LOG_ERROR("module", "AHSeller: Item::CreateItem() returned NULL");
break;
}
item->AddToUpdateQueueOf(AHBplayer);
@@ -378,7 +391,8 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
else
{
// quality is something it shouldn't be, let's get out of here
if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality);
if (debug_Out)
LOG_ERROR("module", "AHBuyer: Quality {} not Supported", prototype->Quality);
item->RemoveFromUpdateQueueOf(AHBplayer);
continue;
}
@@ -478,7 +492,8 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
{
if (!AHBBuyer)
{
if (debug_Out) sLog->outError( "AHBuyer: Disabled");
if (debug_Out)
LOG_ERROR("module", "AHBuyer: Disabled");
return;
}
@@ -528,7 +543,8 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
Item *pItem = sAuctionMgr->GetAItem(auction->item_guid);
if (!pItem)
{
if (debug_Out) sLog->outError( "AHBuyer: Item %s doesn't exist, perhaps bought already?", auction->item_guid.ToString().c_str());
if (debug_Out)
LOG_ERROR("module", "AHBuyer: Item %s doesn't exist, perhaps bought already?", auction->item_guid.ToString().c_str());
continue;
}
@@ -557,7 +573,8 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
else
{
// quality is something it shouldn't be, let's get out of here
if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality);
if (debug_Out)
LOG_ERROR("module", "AHBuyer: Quality {} not Supported", prototype->Quality);
continue;
}
}
@@ -571,7 +588,8 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
else
{
// quality is something it shouldn't be, let's get out of here
if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality);
if (debug_Out)
LOG_ERROR("module", "AHBuyer: Quality {} not Supported", prototype->Quality);
continue;
}
}
@@ -602,33 +620,34 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
if ((currentprice + auction->GetAuctionOutBid()) > bidprice)
bidprice = currentprice + auction->GetAuctionOutBid();
if (debug_Out)
{
sLog->outString("-------------------------------------------------");
sLog->outString("AHBuyer: Info for Auction #%u:", auction->Id);
sLog->outString("AHBuyer: AuctionHouse: %u", auction->GetHouseId());
sLog->outString("AHBuyer: Owner: %s", auction->owner.ToString().c_str());
sLog->outString("AHBuyer: Bidder: %s", auction->bidder.ToString().c_str());
sLog->outString("AHBuyer: Starting Bid: %u", auction->startbid);
sLog->outString("AHBuyer: Current Bid: %u", currentprice);
sLog->outString("AHBuyer: Buyout: %u", auction->buyout);
sLog->outString("AHBuyer: Deposit: %u", auction->deposit);
sLog->outString("AHBuyer: Expire Time: %u", uint32(auction->expire_time));
sLog->outString("AHBuyer: Bid Rate: %f", bidrate);
sLog->outString("AHBuyer: Bid Max: %Lf", bidMax);
sLog->outString("AHBuyer: Bid Value: %Lf", bidvalue);
sLog->outString("AHBuyer: Bid Price: %u", bidprice);
sLog->outString("AHBuyer: Item GUID: %s", auction->item_guid.ToString().c_str());
sLog->outString("AHBuyer: Item Template: %u", auction->item_template);
sLog->outString("AHBuyer: Item Info:");
sLog->outString("AHBuyer: Item ID: %u", prototype->ItemId);
sLog->outString("AHBuyer: Buy Price: %u", prototype->BuyPrice);
sLog->outString("AHBuyer: Sell Price: %u", prototype->SellPrice);
sLog->outString("AHBuyer: Bonding: %u", prototype->Bonding);
sLog->outString("AHBuyer: Quality: %u", prototype->Quality);
sLog->outString("AHBuyer: Item Level: %u", prototype->ItemLevel);
sLog->outString("AHBuyer: Ammo Type: %u", prototype->AmmoType);
sLog->outString("-------------------------------------------------");
LOG_INFO("module", "-------------------------------------------------");
LOG_INFO("module", "AHBuyer: Info for Auction #{}:", auction->Id);
LOG_INFO("module", "AHBuyer: AuctionHouse: {}", auction->GetHouseId());
LOG_INFO("module", "AHBuyer: Owner: {}", auction->owner.ToString().c_str());
LOG_INFO("module", "AHBuyer: Bidder: {}", auction->bidder.ToString().c_str());
LOG_INFO("module", "AHBuyer: Starting Bid: {}", auction->startbid);
LOG_INFO("module", "AHBuyer: Current Bid: {}", currentprice);
LOG_INFO("module", "AHBuyer: Buyout: {}", auction->buyout);
LOG_INFO("module", "AHBuyer: Deposit: {}", auction->deposit);
LOG_INFO("module", "AHBuyer: Expire Time: {}", uint32(auction->expire_time));
LOG_INFO("module", "AHBuyer: Bid Rate: {}", bidrate);
LOG_INFO("module", "AHBuyer: Bid Max: {}", bidMax);
LOG_INFO("module", "AHBuyer: Bid Value: {}", bidvalue);
LOG_INFO("module", "AHBuyer: Bid Price: {}", bidprice);
LOG_INFO("module", "AHBuyer: Item GUID: {}", auction->item_guid.ToString().c_str());
LOG_INFO("module", "AHBuyer: Item Template: {}", auction->item_template);
LOG_INFO("module", "AHBuyer: Item Info:");
LOG_INFO("module", "AHBuyer: Item ID: {}", prototype->ItemId);
LOG_INFO("module", "AHBuyer: Buy Price: {}", prototype->BuyPrice);
LOG_INFO("module", "AHBuyer: Sell Price: {}", prototype->SellPrice);
LOG_INFO("module", "AHBuyer: Bonding: {}", prototype->Bonding);
LOG_INFO("module", "AHBuyer: Quality: {}", prototype->Quality);
LOG_INFO("module", "AHBuyer: Item Level: {}", prototype->ItemLevel);
LOG_INFO("module", "AHBuyer: Ammo Type: {}", prototype->AmmoType);
LOG_INFO("module", "-------------------------------------------------");
}
// Check whether we do normal bid, or buyout
@@ -756,8 +775,8 @@ void AuctionHouseBot::Initialize()
{
QueryResult result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE account = %u AND guid = %u", AHBplayerAccount, AHBplayerGUID);
if (!result)
{
sLog->outError( "AuctionHouseBot: The account/GUID-information set for your AHBot is incorrect (account: %u guid: %u)", AHBplayerAccount, AHBplayerGUID);
{
LOG_ERROR("module", "AuctionHouseBot: The account/GUID-information set for your AHBot is incorrect (account: {} guid: {})", AHBplayerAccount, AHBplayerGUID);
return;
}
}
@@ -778,7 +797,8 @@ void AuctionHouseBot::Initialize()
}
else
{
if (debug_Out) sLog->outError( "AuctionHouseBot: \"%s\" failed", npcQuery);
if (debug_Out)
LOG_ERROR("module", "AuctionHouseBot: \"{}\" failed", npcQuery);
}
char lootQuery[] = "SELECT item FROM creature_loot_template UNION "
@@ -804,15 +824,13 @@ void AuctionHouseBot::Initialize()
}
else
{
if (debug_Out) sLog->outError( "AuctionHouseBot: \"%s\" failed", lootQuery);
if (debug_Out)
LOG_ERROR("module", "AuctionHouseBot: \"{}\" failed", lootQuery);
}
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
{
switch (itr->second.Bonding)
{
case NO_BIND:
@@ -951,259 +969,296 @@ void AuctionHouseBot::Initialize()
// Disable items by Id
if (DisableItemStore.find(itr->second.ItemId) != DisableItemStore.end())
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (PTR/Beta/Unused Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (PTR/Beta/Unused Item)", itr->second.ItemId);
continue;
}
// Disable permanent enchants items
if ((DisablePermEnchant) && (itr->second.Class == ITEM_CLASS_PERMANENT))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Permanent Enchant Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Permanent Enchant Item)", itr->second.ItemId);
continue;
}
// Disable conjured items
if ((DisableConjured) && (itr->second.IsConjuredConsumable()))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Conjured Consumable)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Conjured Consumable)", itr->second.ItemId);
continue;
}
// Disable gems
if ((DisableGems) && (itr->second.Class == ITEM_CLASS_GEM))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Gem)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Gem)", itr->second.ItemId);
continue;
}
// Disable money
if ((DisableMoney) && (itr->second.Class == ITEM_CLASS_MONEY))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Money)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Money)", itr->second.ItemId);
continue;
}
// Disable moneyloot
if ((DisableMoneyLoot) && (itr->second.MinMoneyLoot > 0))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (MoneyLoot)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (MoneyLoot)", itr->second.ItemId);
continue;
}
// Disable lootable items
if ((DisableLootable) && (itr->second.Flags & 4))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Lootable Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Lootable Item)", itr->second.ItemId);
continue;
}
// Disable Keys
if ((DisableKeys) && (itr->second.Class == ITEM_CLASS_KEY))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Quest Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Quest Item)", itr->second.ItemId);
continue;
}
// Disable items with duration
if ((DisableDuration) && (itr->second.Duration > 0))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Has a Duration)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Has a Duration)", itr->second.ItemId);
continue;
}
// Disable items which are BOP or Quest Items and have a required level lower than the item level
if ((DisableBOP_Or_Quest_NoReqLevel) && ((itr->second.Bonding == BIND_WHEN_PICKED_UP || itr->second.Bonding == BIND_QUEST_ITEM) && (itr->second.RequiredLevel < itr->second.ItemLevel)))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (BOP or BQI and Required Level is less than Item Level)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (BOP or BQI and Required Level is less than Item Level)", itr->second.ItemId);
continue;
}
// Disable items specifically for Warrior
if ((DisableWarriorItems) && (itr->second.AllowableClass == 1))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Warrior Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Warrior Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Paladin
if ((DisablePaladinItems) && (itr->second.AllowableClass == 2))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Paladin Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Paladin Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Hunter
if ((DisableHunterItems) && (itr->second.AllowableClass == 4))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Hunter Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Hunter Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Rogue
if ((DisableRogueItems) && (itr->second.AllowableClass == 8))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Rogue Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Rogue Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Priest
if ((DisablePriestItems) && (itr->second.AllowableClass == 16))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Priest Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Priest Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for DK
if ((DisableDKItems) && (itr->second.AllowableClass == 32))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (DK Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (DK Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Shaman
if ((DisableShamanItems) && (itr->second.AllowableClass == 64))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Shaman Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Shaman Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Mage
if ((DisableMageItems) && (itr->second.AllowableClass == 128))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Mage Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Mage Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Warlock
if ((DisableWarlockItems) && (itr->second.AllowableClass == 256))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Warlock Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Warlock Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Unused Class
if ((DisableUnusedClassItems) && (itr->second.AllowableClass == 512))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Unused Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Unused Item)", itr->second.ItemId);
continue;
}
// Disable items specifically for Druid
if ((DisableDruidItems) && (itr->second.AllowableClass == 1024))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Druid Item)", itr->second.ItemId);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Druid Item)", itr->second.ItemId);
continue;
}
// Disable Items below level X
if ((DisableItemsBelowLevel) && (itr->second.Class != ITEM_CLASS_TRADE_GOODS) && (itr->second.ItemLevel < DisableItemsBelowLevel))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Item Level = %u)", itr->second.ItemId, itr->second.ItemLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Item Level = {})", itr->second.ItemId, itr->second.ItemLevel);
continue;
}
// Disable Items above level X
if ((DisableItemsAboveLevel) && (itr->second.Class != ITEM_CLASS_TRADE_GOODS) && (itr->second.ItemLevel > DisableItemsAboveLevel))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Item Level = %u)", itr->second.ItemId, itr->second.ItemLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Item Level = {})", itr->second.ItemId, itr->second.ItemLevel);
continue;
}
// Disable Trade Goods below level X
if ((DisableTGsBelowLevel) && (itr->second.Class == ITEM_CLASS_TRADE_GOODS) && (itr->second.ItemLevel < DisableTGsBelowLevel))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Trade Good %u disabled (Trade Good Level = %u)", itr->second.ItemId, itr->second.ItemLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Trade Good %u disabled (Trade Good Level = {})", itr->second.ItemId, itr->second.ItemLevel);
continue;
}
// Disable Trade Goods above level X
if ((DisableTGsAboveLevel) && (itr->second.Class == ITEM_CLASS_TRADE_GOODS) && (itr->second.ItemLevel > DisableTGsAboveLevel))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Trade Good %u disabled (Trade Good Level = %u)", itr->second.ItemId, itr->second.ItemLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Trade Good {} disabled (Trade Good Level = {})", itr->second.ItemId, itr->second.ItemLevel);
continue;
}
// Disable Items below GUID X
if ((DisableItemsBelowGUID) && (itr->second.Class != ITEM_CLASS_TRADE_GOODS) && (itr->second.ItemId < DisableItemsBelowGUID))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Item Level = %u)", itr->second.ItemId, itr->second.ItemLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Item Level = {})", itr->second.ItemId, itr->second.ItemLevel);
continue;
}
// Disable Items above GUID X
if ((DisableItemsAboveGUID) && (itr->second.Class != ITEM_CLASS_TRADE_GOODS) && (itr->second.ItemId > DisableItemsAboveGUID))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Item Level = %u)", itr->second.ItemId, itr->second.ItemLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Item Level = {})", itr->second.ItemId, itr->second.ItemLevel);
continue;
}
// Disable Trade Goods below GUID X
if ((DisableTGsBelowGUID) && (itr->second.Class == ITEM_CLASS_TRADE_GOODS) && (itr->second.ItemId < DisableTGsBelowGUID))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Trade Good Level = %u)", itr->second.ItemId, itr->second.ItemLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Trade Good Level = {})", itr->second.ItemId, itr->second.ItemLevel);
continue;
}
// Disable Trade Goods above GUID X
if ((DisableTGsAboveGUID) && (itr->second.Class == ITEM_CLASS_TRADE_GOODS) && (itr->second.ItemId > DisableTGsAboveGUID))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (Trade Good Level = %u)", itr->second.ItemId, itr->second.ItemLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (Trade Good Level = {})", itr->second.ItemId, itr->second.ItemLevel);
continue;
}
// Disable Items for level lower than X
if ((DisableItemsBelowReqLevel) && (itr->second.RequiredLevel < DisableItemsBelowReqLevel))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (RequiredLevel = %u)", itr->second.ItemId, itr->second.RequiredLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (RequiredLevel = {})", itr->second.ItemId, itr->second.RequiredLevel);
continue;
}
// Disable Items for level higher than X
if ((DisableItemsAboveReqLevel) && (itr->second.RequiredLevel > DisableItemsAboveReqLevel))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (RequiredLevel = %u)", itr->second.ItemId, itr->second.RequiredLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (RequiredLevel = {})", itr->second.ItemId, itr->second.RequiredLevel);
continue;
}
// Disable Trade Goods for level lower than X
if ((DisableTGsBelowReqLevel) && (itr->second.RequiredLevel < DisableTGsBelowReqLevel))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Trade Good %u disabled (RequiredLevel = %u)", itr->second.ItemId, itr->second.RequiredLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Trade Good {} disabled (RequiredLevel = {})", itr->second.ItemId, itr->second.RequiredLevel);
continue;
}
// Disable Trade Goods for level higher than X
if ((DisableTGsAboveReqLevel) && (itr->second.RequiredLevel > DisableTGsAboveReqLevel))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Trade Good %u disabled (RequiredLevel = %u)", itr->second.ItemId, itr->second.RequiredLevel);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Trade Good {} disabled (RequiredLevel = {})", itr->second.ItemId, itr->second.RequiredLevel);
continue;
}
// Disable Items that require skill lower than X
if ((DisableItemsBelowReqSkillRank) && (itr->second.RequiredSkillRank < DisableItemsBelowReqSkillRank))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (RequiredSkillRank = %u)", itr->second.ItemId, itr->second.RequiredSkillRank);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (RequiredSkillRank = {})", itr->second.ItemId, itr->second.RequiredSkillRank);
continue;
}
// Disable Items that require skill higher than X
if ((DisableItemsAboveReqSkillRank) && (itr->second.RequiredSkillRank > DisableItemsAboveReqSkillRank))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (RequiredSkillRank = %u)", itr->second.ItemId, itr->second.RequiredSkillRank);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (RequiredSkillRank = {})", itr->second.ItemId, itr->second.RequiredSkillRank);
continue;
}
// Disable Trade Goods that require skill lower than X
if ((DisableTGsBelowReqSkillRank) && (itr->second.RequiredSkillRank < DisableTGsBelowReqSkillRank))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (RequiredSkillRank = %u)", itr->second.ItemId, itr->second.RequiredSkillRank);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (RequiredSkillRank = {})", itr->second.ItemId, itr->second.RequiredSkillRank);
continue;
}
// Disable Trade Goods that require skill higher than X
if ((DisableTGsAboveReqSkillRank) && (itr->second.RequiredSkillRank > DisableTGsAboveReqSkillRank))
{
if (debug_Out_Filters) sLog->outError( "AuctionHouseBot: Item %u disabled (RequiredSkillRank = %u)", itr->second.ItemId, itr->second.RequiredSkillRank);
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled (RequiredSkillRank = {})", itr->second.ItemId, itr->second.RequiredSkillRank);
continue;
}
@@ -1275,28 +1330,29 @@ void AuctionHouseBot::Initialize()
(orangeItemsBin.size() == 0) &&
(yellowItemsBin.size() == 0))
{
sLog->outError( "AuctionHouseBot: No items");
LOG_ERROR("module", "AuctionHouseBot: No items");
AHBSeller = 0;
}
sLog->outString("AuctionHouseBot:");
sLog->outString("%u disabled items", uint32(DisableItemStore.size()));
sLog->outString("loaded %u grey trade goods", uint32(greyTradeGoodsBin.size()));
sLog->outString("loaded %u white trade goods", uint32(whiteTradeGoodsBin.size()));
sLog->outString("loaded %u green trade goods", uint32(greenTradeGoodsBin.size()));
sLog->outString("loaded %u blue trade goods", uint32(blueTradeGoodsBin.size()));
sLog->outString("loaded %u purple trade goods", uint32(purpleTradeGoodsBin.size()));
sLog->outString("loaded %u orange trade goods", uint32(orangeTradeGoodsBin.size()));
sLog->outString("loaded %u yellow trade goods", uint32(yellowTradeGoodsBin.size()));
sLog->outString("loaded %u grey items", uint32(greyItemsBin.size()));
sLog->outString("loaded %u white items", uint32(whiteItemsBin.size()));
sLog->outString("loaded %u green items", uint32(greenItemsBin.size()));
sLog->outString("loaded %u blue items", uint32(blueItemsBin.size()));
sLog->outString("loaded %u purple items", uint32(purpleItemsBin.size()));
sLog->outString("loaded %u orange items", uint32(orangeItemsBin.size()));
sLog->outString("loaded %u yellow items", uint32(yellowItemsBin.size()));
LOG_INFO("module", "AuctionHouseBot:");
LOG_INFO("module", "{} disabled items", uint32(DisableItemStore.size()));
LOG_INFO("module", "loaded {} grey trade goods", uint32(greyTradeGoodsBin.size()));
LOG_INFO("module", "loaded {} white trade goods", uint32(whiteTradeGoodsBin.size()));
LOG_INFO("module", "loaded {} green trade goods", uint32(greenTradeGoodsBin.size()));
LOG_INFO("module", "loaded {} blue trade goods", uint32(blueTradeGoodsBin.size()));
LOG_INFO("module", "loaded {} purple trade goods", uint32(purpleTradeGoodsBin.size()));
LOG_INFO("module", "loaded {} orange trade goods", uint32(orangeTradeGoodsBin.size()));
LOG_INFO("module", "loaded {} yellow trade goods", uint32(yellowTradeGoodsBin.size()));
LOG_INFO("module", "loaded {} grey items", uint32(greyItemsBin.size()));
LOG_INFO("module", "loaded {} white items", uint32(whiteItemsBin.size()));
LOG_INFO("module", "loaded {} green items", uint32(greenItemsBin.size()));
LOG_INFO("module", "loaded {} blue items", uint32(blueItemsBin.size()));
LOG_INFO("module", "loaded {} purple items", uint32(purpleItemsBin.size()));
LOG_INFO("module", "loaded {} orange items", uint32(orangeItemsBin.size()));
LOG_INFO("module", "loaded {} yellow items", uint32(yellowItemsBin.size()));
}
sLog->outString("AuctionHouseBot and AuctionHouseBuyer have been loaded.");
LOG_INFO("module", "AuctionHouseBot and AuctionHouseBuyer have been loaded.");
}
void AuctionHouseBot::InitializeConfiguration()
@@ -1376,7 +1432,8 @@ void AuctionHouseBot::IncrementItemCounts(AuctionEntry* ah)
Item *pItem = sAuctionMgr->GetAItem(ah->item_guid);
if (!pItem)
{
if (debug_Out) sLog->outError( "AHBot: Item %s doesn't exist, perhaps bought already?", ah->item_guid.ToString().c_str());
if (debug_Out)
LOG_ERROR("module", "AHBot: Item {} doesn't exist, perhaps bought already?", ah->item_guid.ToString());
return;
}
@@ -1388,22 +1445,26 @@ void AuctionHouseBot::IncrementItemCounts(AuctionEntry* ah)
AuctionHouseEntry const* ahEntry = sAuctionHouseStore.LookupEntry(ah->GetHouseId());
if (!ahEntry)
{
if (debug_Out) sLog->outError( "AHBot: %u returned as House Faction. Neutral", ah->GetHouseId());
if (debug_Out)
LOG_ERROR("module", "AHBot: {} returned as House Faction. Neutral", ah->GetHouseId());
config = &NeutralConfig;
}
else if (ahEntry->houseId == AUCTIONHOUSE_ALLIANCE)
{
if (debug_Out) sLog->outError( "AHBot: %u returned as House Faction. Alliance", ah->GetHouseId());
if (debug_Out)
LOG_ERROR("module", "AHBot: {} returned as House Faction. Alliance", ah->GetHouseId());
config = &AllianceConfig;
}
else if (ahEntry->houseId == AUCTIONHOUSE_HORDE)
{
if (debug_Out) sLog->outError( "AHBot: %u returned as House Faction. Horde", ah->GetHouseId());
if (debug_Out)
LOG_ERROR("module", "AHBot: {} returned as House Faction. Horde", ah->GetHouseId());
config = &HordeConfig;
}
else
{
if (debug_Out) sLog->outError( "AHBot: %u returned as House Faction. Neutral", ah->GetHouseId());
if (debug_Out)
LOG_ERROR("module", "AHBot: {} returned as House Faction. Neutral", ah->GetHouseId());
config = &NeutralConfig;
}
@@ -1420,22 +1481,26 @@ void AuctionHouseBot::DecrementItemCounts(AuctionEntry* ah, uint32 itemEntry)
AuctionHouseEntry const* ahEntry = sAuctionHouseStore.LookupEntry(ah->GetHouseId());
if (!ahEntry)
{
if (debug_Out) sLog->outError( "AHBot: %u returned as House Faction. Neutral", ah->GetHouseId());
if (debug_Out)
LOG_ERROR("module", "AHBot: {} returned as House Faction. Neutral", ah->GetHouseId());
config = &NeutralConfig;
}
else if (ahEntry->houseId == AUCTIONHOUSE_ALLIANCE)
{
if (debug_Out) sLog->outError( "AHBot: %u returned as House Faction. Alliance", ah->GetHouseId());
if (debug_Out)
LOG_ERROR("module", "AHBot: {} returned as House Faction. Alliance", ah->GetHouseId());
config = &AllianceConfig;
}
else if (ahEntry->houseId == AUCTIONHOUSE_HORDE)
{
if (debug_Out) sLog->outError( "AHBot: %u returned as House Faction. Horde", ah->GetHouseId());
if (debug_Out)
LOG_ERROR("module", "AHBot: {} returned as House Faction. Horde", ah->GetHouseId());
config = &HordeConfig;
}
else
{
if (debug_Out) sLog->outError( "AHBot: %u returned as House Faction. Neutral", ah->GetHouseId());
if (debug_Out)
LOG_ERROR("module", "AHBot: {} returned as House Faction. Neutral", ah->GetHouseId());
config = &NeutralConfig;
}
@@ -1649,7 +1714,8 @@ void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, uint32 col, char*
void AuctionHouseBot::LoadValues(AHBConfig *config)
{
if (debug_Out)
sLog->outError( "Start Settings for %s Auctionhouses:", WorldDatabase.PQuery("SELECT name FROM mod_auctionhousebot WHERE auctionhouse = %u", config->GetAHID())->Fetch()->GetCString());
LOG_ERROR("module", "Start Settings for {} Auctionhouses:", WorldDatabase.PQuery("SELECT name FROM mod_auctionhousebot WHERE auctionhouse = %u", config->GetAHID())->Fetch()->GetStringView());
if (AHBSeller)
{
//load min and max items
@@ -1711,58 +1777,59 @@ void AuctionHouseBot::LoadValues(AHBConfig *config)
config->SetMaxStack(AHB_YELLOW, WorldDatabase.PQuery("SELECT maxstackyellow FROM mod_auctionhousebot WHERE auctionhouse = %u", config->GetAHID())->Fetch()->GetUInt32());
if (debug_Out)
{
sLog->outError( "minItems = %u", config->GetMinItems());
sLog->outError( "maxItems = %u", config->GetMaxItems());
sLog->outError( "percentGreyTradeGoods = %u", config->GetPercentages(AHB_GREY_TG));
sLog->outError( "percentWhiteTradeGoods = %u", config->GetPercentages(AHB_WHITE_TG));
sLog->outError( "percentGreenTradeGoods = %u", config->GetPercentages(AHB_GREEN_TG));
sLog->outError( "percentBlueTradeGoods = %u", config->GetPercentages(AHB_BLUE_TG));
sLog->outError( "percentPurpleTradeGoods = %u", config->GetPercentages(AHB_PURPLE_TG));
sLog->outError( "percentOrangeTradeGoods = %u", config->GetPercentages(AHB_ORANGE_TG));
sLog->outError( "percentYellowTradeGoods = %u", config->GetPercentages(AHB_YELLOW_TG));
sLog->outError( "percentGreyItems = %u", config->GetPercentages(AHB_GREY_I));
sLog->outError( "percentWhiteItems = %u", config->GetPercentages(AHB_WHITE_I));
sLog->outError( "percentGreenItems = %u", config->GetPercentages(AHB_GREEN_I));
sLog->outError( "percentBlueItems = %u", config->GetPercentages(AHB_BLUE_I));
sLog->outError( "percentPurpleItems = %u", config->GetPercentages(AHB_PURPLE_I));
sLog->outError( "percentOrangeItems = %u", config->GetPercentages(AHB_ORANGE_I));
sLog->outError( "percentYellowItems = %u", config->GetPercentages(AHB_YELLOW_I));
sLog->outError( "minPriceGrey = %u", config->GetMinPrice(AHB_GREY));
sLog->outError( "maxPriceGrey = %u", config->GetMaxPrice(AHB_GREY));
sLog->outError( "minPriceWhite = %u", config->GetMinPrice(AHB_WHITE));
sLog->outError( "maxPriceWhite = %u", config->GetMaxPrice(AHB_WHITE));
sLog->outError( "minPriceGreen = %u", config->GetMinPrice(AHB_GREEN));
sLog->outError( "maxPriceGreen = %u", config->GetMaxPrice(AHB_GREEN));
sLog->outError( "minPriceBlue = %u", config->GetMinPrice(AHB_BLUE));
sLog->outError( "maxPriceBlue = %u", config->GetMaxPrice(AHB_BLUE));
sLog->outError( "minPricePurple = %u", config->GetMinPrice(AHB_PURPLE));
sLog->outError( "maxPricePurple = %u", config->GetMaxPrice(AHB_PURPLE));
sLog->outError( "minPriceOrange = %u", config->GetMinPrice(AHB_ORANGE));
sLog->outError( "maxPriceOrange = %u", config->GetMaxPrice(AHB_ORANGE));
sLog->outError( "minPriceYellow = %u", config->GetMinPrice(AHB_YELLOW));
sLog->outError( "maxPriceYellow = %u", config->GetMaxPrice(AHB_YELLOW));
sLog->outError( "minBidPriceGrey = %u", config->GetMinBidPrice(AHB_GREY));
sLog->outError( "maxBidPriceGrey = %u", config->GetMaxBidPrice(AHB_GREY));
sLog->outError( "minBidPriceWhite = %u", config->GetMinBidPrice(AHB_WHITE));
sLog->outError( "maxBidPriceWhite = %u", config->GetMaxBidPrice(AHB_WHITE));
sLog->outError( "minBidPriceGreen = %u", config->GetMinBidPrice(AHB_GREEN));
sLog->outError( "maxBidPriceGreen = %u", config->GetMaxBidPrice(AHB_GREEN));
sLog->outError( "minBidPriceBlue = %u", config->GetMinBidPrice(AHB_BLUE));
sLog->outError( "maxBidPriceBlue = %u", config->GetMinBidPrice(AHB_BLUE));
sLog->outError( "minBidPricePurple = %u", config->GetMinBidPrice(AHB_PURPLE));
sLog->outError( "maxBidPricePurple = %u", config->GetMaxBidPrice(AHB_PURPLE));
sLog->outError( "minBidPriceOrange = %u", config->GetMinBidPrice(AHB_ORANGE));
sLog->outError( "maxBidPriceOrange = %u", config->GetMaxBidPrice(AHB_ORANGE));
sLog->outError( "minBidPriceYellow = %u", config->GetMinBidPrice(AHB_YELLOW));
sLog->outError( "maxBidPriceYellow = %u", config->GetMaxBidPrice(AHB_YELLOW));
sLog->outError( "maxStackGrey = %u", config->GetMaxStack(AHB_GREY));
sLog->outError( "maxStackWhite = %u", config->GetMaxStack(AHB_WHITE));
sLog->outError( "maxStackGreen = %u", config->GetMaxStack(AHB_GREEN));
sLog->outError( "maxStackBlue = %u", config->GetMaxStack(AHB_BLUE));
sLog->outError( "maxStackPurple = %u", config->GetMaxStack(AHB_PURPLE));
sLog->outError( "maxStackOrange = %u", config->GetMaxStack(AHB_ORANGE));
sLog->outError( "maxStackYellow = %u", config->GetMaxStack(AHB_YELLOW));
LOG_ERROR("module", "minItems = {}", config->GetMinItems());
LOG_ERROR("module", "maxItems = {}", config->GetMaxItems());
LOG_ERROR("module", "percentGreyTradeGoods = {}", config->GetPercentages(AHB_GREY_TG));
LOG_ERROR("module", "percentWhiteTradeGoods = {}", config->GetPercentages(AHB_WHITE_TG));
LOG_ERROR("module", "percentGreenTradeGoods = {}", config->GetPercentages(AHB_GREEN_TG));
LOG_ERROR("module", "percentBlueTradeGoods = {}", config->GetPercentages(AHB_BLUE_TG));
LOG_ERROR("module", "percentPurpleTradeGoods = {}", config->GetPercentages(AHB_PURPLE_TG));
LOG_ERROR("module", "percentOrangeTradeGoods = {}", config->GetPercentages(AHB_ORANGE_TG));
LOG_ERROR("module", "percentYellowTradeGoods = {}", config->GetPercentages(AHB_YELLOW_TG));
LOG_ERROR("module", "percentGreyItems = {}", config->GetPercentages(AHB_GREY_I));
LOG_ERROR("module", "percentWhiteItems = {}", config->GetPercentages(AHB_WHITE_I));
LOG_ERROR("module", "percentGreenItems = {}", config->GetPercentages(AHB_GREEN_I));
LOG_ERROR("module", "percentBlueItems = {}", config->GetPercentages(AHB_BLUE_I));
LOG_ERROR("module", "percentPurpleItems = {}", config->GetPercentages(AHB_PURPLE_I));
LOG_ERROR("module", "percentOrangeItems = {}", config->GetPercentages(AHB_ORANGE_I));
LOG_ERROR("module", "percentYellowItems = {}", config->GetPercentages(AHB_YELLOW_I));
LOG_ERROR("module", "minPriceGrey = {}", config->GetMinPrice(AHB_GREY));
LOG_ERROR("module", "maxPriceGrey = {}", config->GetMaxPrice(AHB_GREY));
LOG_ERROR("module", "minPriceWhite = {}", config->GetMinPrice(AHB_WHITE));
LOG_ERROR("module", "maxPriceWhite = {}", config->GetMaxPrice(AHB_WHITE));
LOG_ERROR("module", "minPriceGreen = {}", config->GetMinPrice(AHB_GREEN));
LOG_ERROR("module", "maxPriceGreen = {}", config->GetMaxPrice(AHB_GREEN));
LOG_ERROR("module", "minPriceBlue = {}", config->GetMinPrice(AHB_BLUE));
LOG_ERROR("module", "maxPriceBlue = {}", config->GetMaxPrice(AHB_BLUE));
LOG_ERROR("module", "minPricePurple = {}", config->GetMinPrice(AHB_PURPLE));
LOG_ERROR("module", "maxPricePurple = {}", config->GetMaxPrice(AHB_PURPLE));
LOG_ERROR("module", "minPriceOrange = {}", config->GetMinPrice(AHB_ORANGE));
LOG_ERROR("module", "maxPriceOrange = {}", config->GetMaxPrice(AHB_ORANGE));
LOG_ERROR("module", "minPriceYellow = {}", config->GetMinPrice(AHB_YELLOW));
LOG_ERROR("module", "maxPriceYellow = {}", config->GetMaxPrice(AHB_YELLOW));
LOG_ERROR("module", "minBidPriceGrey = {}", config->GetMinBidPrice(AHB_GREY));
LOG_ERROR("module", "maxBidPriceGrey = {}", config->GetMaxBidPrice(AHB_GREY));
LOG_ERROR("module", "minBidPriceWhite = {}", config->GetMinBidPrice(AHB_WHITE));
LOG_ERROR("module", "maxBidPriceWhite = {}", config->GetMaxBidPrice(AHB_WHITE));
LOG_ERROR("module", "minBidPriceGreen = {}", config->GetMinBidPrice(AHB_GREEN));
LOG_ERROR("module", "maxBidPriceGreen = {}", config->GetMaxBidPrice(AHB_GREEN));
LOG_ERROR("module", "minBidPriceBlue = {}", config->GetMinBidPrice(AHB_BLUE));
LOG_ERROR("module", "maxBidPriceBlue = {}", config->GetMinBidPrice(AHB_BLUE));
LOG_ERROR("module", "minBidPricePurple = {}", config->GetMinBidPrice(AHB_PURPLE));
LOG_ERROR("module", "maxBidPricePurple = {}", config->GetMaxBidPrice(AHB_PURPLE));
LOG_ERROR("module", "minBidPriceOrange = {}", config->GetMinBidPrice(AHB_ORANGE));
LOG_ERROR("module", "maxBidPriceOrange = {}", config->GetMaxBidPrice(AHB_ORANGE));
LOG_ERROR("module", "minBidPriceYellow = {}", config->GetMinBidPrice(AHB_YELLOW));
LOG_ERROR("module", "maxBidPriceYellow = {}", config->GetMaxBidPrice(AHB_YELLOW));
LOG_ERROR("module", "maxStackGrey = {}", config->GetMaxStack(AHB_GREY));
LOG_ERROR("module", "maxStackWhite = {}", config->GetMaxStack(AHB_WHITE));
LOG_ERROR("module", "maxStackGreen = {}", config->GetMaxStack(AHB_GREEN));
LOG_ERROR("module", "maxStackBlue = {}", config->GetMaxStack(AHB_BLUE));
LOG_ERROR("module", "maxStackPurple = {}", config->GetMaxStack(AHB_PURPLE));
LOG_ERROR("module", "maxStackOrange = {}", config->GetMaxStack(AHB_ORANGE));
LOG_ERROR("module", "maxStackYellow = {}", config->GetMaxStack(AHB_YELLOW));
}
//AuctionHouseEntry const* ahEntry = sAuctionMgr->GetAuctionHouseEntry(config->GetAHFID());
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(config->GetAHFID());
@@ -1829,16 +1896,17 @@ void AuctionHouseBot::LoadValues(AHBConfig *config)
}
}
}
if (debug_Out)
{
sLog->outError( "Current Settings for %s Auctionhouses:", WorldDatabase.PQuery("SELECT name FROM mod_auctionhousebot WHERE auctionhouse = %u", config->GetAHID())->Fetch()->GetCString());
sLog->outError( "Grey Trade Goods\t%u\tGrey Items\t%u", config->GetItemCounts(AHB_GREY_TG), config->GetItemCounts(AHB_GREY_I));
sLog->outError( "White Trade Goods\t%u\tWhite Items\t%u", config->GetItemCounts(AHB_WHITE_TG), config->GetItemCounts(AHB_WHITE_I));
sLog->outError( "Green Trade Goods\t%u\tGreen Items\t%u", config->GetItemCounts(AHB_GREEN_TG), config->GetItemCounts(AHB_GREEN_I));
sLog->outError( "Blue Trade Goods\t%u\tBlue Items\t%u", config->GetItemCounts(AHB_BLUE_TG), config->GetItemCounts(AHB_BLUE_I));
sLog->outError( "Purple Trade Goods\t%u\tPurple Items\t%u", config->GetItemCounts(AHB_PURPLE_TG), config->GetItemCounts(AHB_PURPLE_I));
sLog->outError( "Orange Trade Goods\t%u\tOrange Items\t%u", config->GetItemCounts(AHB_ORANGE_TG), config->GetItemCounts(AHB_ORANGE_I));
sLog->outError( "Yellow Trade Goods\t%u\tYellow Items\t%u", config->GetItemCounts(AHB_YELLOW_TG), config->GetItemCounts(AHB_YELLOW_I));
LOG_ERROR("module", "Current Settings for {} Auctionhouses:", WorldDatabase.PQuery("SELECT name FROM mod_auctionhousebot WHERE auctionhouse = %u", config->GetAHID())->Fetch()->GetCString());
LOG_ERROR("module", "Grey Trade Goods\t{}\tGrey Items\t{}", config->GetItemCounts(AHB_GREY_TG), config->GetItemCounts(AHB_GREY_I));
LOG_ERROR("module", "White Trade Goods\t{}\tWhite Items\t{}", config->GetItemCounts(AHB_WHITE_TG), config->GetItemCounts(AHB_WHITE_I));
LOG_ERROR("module", "Green Trade Goods\t{}\tGreen Items\t{}", config->GetItemCounts(AHB_GREEN_TG), config->GetItemCounts(AHB_GREEN_I));
LOG_ERROR("module", "Blue Trade Goods\t{}\tBlue Items\t{}", config->GetItemCounts(AHB_BLUE_TG), config->GetItemCounts(AHB_BLUE_I));
LOG_ERROR("module", "Purple Trade Goods\t{}\tPurple Items\t{}", config->GetItemCounts(AHB_PURPLE_TG), config->GetItemCounts(AHB_PURPLE_I));
LOG_ERROR("module", "Orange Trade Goods\t{}\tOrange Items\t{}", config->GetItemCounts(AHB_ORANGE_TG), config->GetItemCounts(AHB_ORANGE_I));
LOG_ERROR("module", "Yellow Trade Goods\t{}\tYellow Items\t{}", config->GetItemCounts(AHB_YELLOW_TG), config->GetItemCounts(AHB_YELLOW_I));
}
}
if (AHBBuyer)
@@ -1857,16 +1925,18 @@ void AuctionHouseBot::LoadValues(AHBConfig *config)
config->SetBidsPerInterval(WorldDatabase.PQuery("SELECT buyerbidsperinterval FROM mod_auctionhousebot WHERE auctionhouse = %u", config->GetAHID())->Fetch()->GetUInt32());
if (debug_Out)
{
sLog->outError( "buyerPriceGrey = %u", config->GetBuyerPrice(AHB_GREY));
sLog->outError( "buyerPriceWhite = %u", config->GetBuyerPrice(AHB_WHITE));
sLog->outError( "buyerPriceGreen = %u", config->GetBuyerPrice(AHB_GREEN));
sLog->outError( "buyerPriceBlue = %u", config->GetBuyerPrice(AHB_BLUE));
sLog->outError( "buyerPricePurple = %u", config->GetBuyerPrice(AHB_PURPLE));
sLog->outError( "buyerPriceOrange = %u", config->GetBuyerPrice(AHB_ORANGE));
sLog->outError( "buyerPriceYellow = %u", config->GetBuyerPrice(AHB_YELLOW));
sLog->outError( "buyerBiddingInterval = %u", config->GetBiddingInterval());
sLog->outError( "buyerBidsPerInterval = %u", config->GetBidsPerInterval());
LOG_ERROR("module", "buyerPriceGrey = {}", config->GetBuyerPrice(AHB_GREY));
LOG_ERROR("module", "buyerPriceWhite = {}", config->GetBuyerPrice(AHB_WHITE));
LOG_ERROR("module", "buyerPriceGreen = {}", config->GetBuyerPrice(AHB_GREEN));
LOG_ERROR("module", "buyerPriceBlue = {}", config->GetBuyerPrice(AHB_BLUE));
LOG_ERROR("module", "buyerPricePurple = {}", config->GetBuyerPrice(AHB_PURPLE));
LOG_ERROR("module", "buyerPriceOrange = {}", config->GetBuyerPrice(AHB_ORANGE));
LOG_ERROR("module", "buyerPriceYellow = {}", config->GetBuyerPrice(AHB_YELLOW));
LOG_ERROR("module", "buyerBiddingInterval = {}", config->GetBiddingInterval());
LOG_ERROR("module", "buyerBidsPerInterval = {}", config->GetBidsPerInterval());
}
}
if (debug_Out) sLog->outError( "End Settings for %s Auctionhouses:", WorldDatabase.PQuery("SELECT name FROM mod_auctionhousebot WHERE auctionhouse = %u", config->GetAHID())->Fetch()->GetCString());
if (debug_Out)
LOG_ERROR("module", "End Settings for {} Auctionhouses:", WorldDatabase.PQuery("SELECT name FROM mod_auctionhousebot WHERE auctionhouse = %u", config->GetAHID())->Fetch()->GetCString());
}