diff options
Diffstat (limited to 'src')
6 files changed, 60 insertions, 61 deletions
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h index 8c1a2425f7c..04ca96dfdd9 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h @@ -168,7 +168,7 @@ enum AuctionBotConfigBoolValues class AuctionBotConfig { private: - AuctionBotConfig() {} + AuctionBotConfig(): _itemsPerCycleBoost(1000), _itemsPerCycleNormal(20) {} ~AuctionBotConfig() {} AuctionBotConfig(const AuctionBotConfig&); AuctionBotConfig& operator=(const AuctionBotConfig&); diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp index f7c8003fc76..0043482c77f 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp @@ -20,7 +20,7 @@ #include "ItemPrototype.h" #include "AuctionHouseBotBuyer.h" -AuctionBotBuyer::AuctionBotBuyer() +AuctionBotBuyer::AuctionBotBuyer(): _checkInterval(20) { // Define faction for our main data class. for (int i = 0; i < MAX_AUCTION_HOUSE_TYPE; ++i) @@ -50,7 +50,7 @@ bool AuctionBotBuyer::Initialize() //load Check interval _checkInterval = sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYER_RECHECK_INTERVAL) * MINUTE; - TC_LOG_INFO("ahbot", "AHBot buyer interval between 2 check = %u", _checkInterval); + TC_LOG_DEBUG("ahbot", "AHBot buyer interval between 2 check = %u", _checkInterval); return true; } @@ -150,8 +150,8 @@ uint32 AuctionBotBuyer::GetBuyableEntry(BuyerConfiguration& config) } } - TC_LOG_INFO("ahbot", "AHBot: %u items added to buyable vector for ah type: %u", count, config.GetHouseType()); - TC_LOG_INFO("ahbot", "AHBot: SameItemInfo size = %u", (uint32)config.SameItemInfo.size()); + TC_LOG_DEBUG("ahbot", "AHBot: %u items added to buyable vector for ah type: %u", count, config.GetHouseType()); + TC_LOG_DEBUG("ahbot", "AHBot: SameItemInfo size = %u", (uint32)config.SameItemInfo.size()); return count; } @@ -167,7 +167,7 @@ void AuctionBotBuyer::PrepareListOfEntry(BuyerConfiguration& config) ++itr; } - TC_LOG_INFO("ahbot", "AHBot: CheckedEntry size = %u", (uint32)config.CheckedEntry.size()); + TC_LOG_DEBUG("ahbot", "AHBot: CheckedEntry size = %u", (uint32)config.CheckedEntry.size()); } bool AuctionBotBuyer::IsBuyableEntry(uint32 buyoutPrice, double inGameBuyPrice, double maxBuyablePrice, uint32 minBuyPrice, uint32 maxChance, uint32 chanceRatio) @@ -227,12 +227,12 @@ bool AuctionBotBuyer::IsBuyableEntry(uint32 buyoutPrice, double inGameBuyPrice, if (urand(1, chanceRatio) <= chance) { - TC_LOG_INFO("ahbot", "AHBot: WIN BUY! Chance = %u, num = %u.", chance, chanceRatio); + TC_LOG_DEBUG("ahbot", "AHBot: WIN BUY! Chance = %u, num = %u.", chance, chanceRatio); return true; } else { - TC_LOG_INFO("ahbot", "AHBot: LOOSE BUY! Chance = %u, num = %u.", chance, chanceRatio); + TC_LOG_DEBUG("ahbot", "AHBot: LOOSE BUY! Chance = %u, num = %u.", chance, chanceRatio); return false; } } @@ -274,25 +274,25 @@ bool AuctionBotBuyer::IsBidableEntry(uint32 bidPrice, double inGameBuyPrice, dou if (urand(1, chanceRatio) <= chance) { - TC_LOG_INFO("ahbot", "AHBot: WIN BID! Chance = %u, num = %u.", chance, chanceRatio); + TC_LOG_DEBUG("ahbot", "AHBot: WIN BID! Chance = %u, num = %u.", chance, chanceRatio); return true; } else { - TC_LOG_INFO("ahbot", "AHBot: LOOSE BID! Chance = %u, num = %u.", chance, chanceRatio); + TC_LOG_DEBUG("ahbot", "AHBot: LOOSE BID! Chance = %u, num = %u.", chance, chanceRatio); return false; } } void AuctionBotBuyer::PlaceBidToEntry(AuctionEntry* auction, uint32 bidPrice) { - TC_LOG_INFO("ahbot", "AHBot: Bid placed to entry %u, %.2fg", auction->Id, float(bidPrice) / 10000.0f); + TC_LOG_DEBUG("ahbot", "AHBot: Bid placed to entry %u, %.2fg", auction->Id, float(bidPrice) / 10000.0f); auction->bid = bidPrice; } void AuctionBotBuyer::BuyEntry(AuctionEntry* auction) { - TC_LOG_INFO("ahbot", "AHBot: Entry %u bought at %.2fg", auction->Id, float(auction->buyout) / 10000.0f); + TC_LOG_DEBUG("ahbot", "AHBot: Entry %u bought at %.2fg", auction->Id, float(auction->buyout) / 10000.0f); auction->bid = auction->buyout; } @@ -307,7 +307,7 @@ void AuctionBotBuyer::AddNewAuctionBuyerBotBid(BuyerConfiguration& config) if (config.CheckedEntry.size() > sAuctionBotConfig->GetItemPerCycleBoost()) { buyCycles = sAuctionBotConfig->GetItemPerCycleBoost(); - TC_LOG_INFO("ahbot", "AHBot: Boost value used for Buyer! (if this happens often adjust both ItemsPerCycle in worldserver.conf)"); + TC_LOG_DEBUG("ahbot", "AHBot: Boost value used for Buyer! (if this happens often adjust both ItemsPerCycle in worldserver.conf)"); } else buyCycles = sAuctionBotConfig->GetItemPerCycleNormal(); @@ -317,8 +317,8 @@ void AuctionBotBuyer::AddNewAuctionBuyerBotBid(BuyerConfiguration& config) AuctionEntry* auction = auctionHouse->GetAuction(itr->second.AuctionId); if (!auction) // is auction not active now { - TC_LOG_INFO("ahbot", "AHBot: Entry %u on ah %u doesn't exists, perhaps bought already?", - itr->second.AuctionId, auction->GetHouseId()); + TC_LOG_DEBUG("ahbot", "AHBot: Entry %u doesn't exists, perhaps bought already?", + itr->second.AuctionId); config.CheckedEntry.erase(itr++); continue; @@ -326,7 +326,7 @@ void AuctionBotBuyer::AddNewAuctionBuyerBotBid(BuyerConfiguration& config) if (itr->second.LastChecked != 0 && (now - itr->second.LastChecked) <= _checkInterval) { - TC_LOG_INFO("ahbot", "AHBot: In time interval wait for entry %u!", auction->Id); + TC_LOG_DEBUG("ahbot", "AHBot: In time interval wait for entry %u!", auction->Id); ++itr; continue; } @@ -382,12 +382,12 @@ void AuctionBotBuyer::AddNewAuctionBuyerBotBid(BuyerConfiguration& config) double maxBidablePrice = maxBuyablePrice - (maxBuyablePrice / 30); // Max Bidable price defined to 70% of max buyable price - TC_LOG_INFO("ahbot", "AHBot: Auction added with data:"); - TC_LOG_INFO("ahbot", "AHBot: MaxPrice of Entry %u is %.1fg.", itr->second.AuctionId, maxBuyablePrice / 10000); - TC_LOG_INFO("ahbot", "AHBot: GamePrice buy=%.1fg, bid=%.1fg.", inGameBuyPrice / 10000, inGameBidPrice / 10000); - TC_LOG_INFO("ahbot", "AHBot: Minimal price see in AH Buy=%ug, Bid=%ug.", + TC_LOG_DEBUG("ahbot", "AHBot: Auction added with data:"); + TC_LOG_DEBUG("ahbot", "AHBot: MaxPrice of Entry %u is %.1fg.", itr->second.AuctionId, maxBuyablePrice / 10000); + TC_LOG_DEBUG("ahbot", "AHBot: GamePrice buy=%.1fg, bid=%.1fg.", inGameBuyPrice / 10000, inGameBidPrice / 10000); + TC_LOG_DEBUG("ahbot", "AHBot: Minimal price see in AH Buy=%ug, Bid=%ug.", sameItemItr->second.MinBuyPrice / 10000, sameItemItr->second.MinBidPrice / 10000); - TC_LOG_INFO("ahbot", "AHBot: Actual Entry price, Buy=%ug, Bid=%ug.", buyoutPrice / 10000, bidPrice / 10000); + TC_LOG_DEBUG("ahbot", "AHBot: Actual Entry price, Buy=%ug, Bid=%ug.", buyoutPrice / 10000, bidPrice / 10000); if (!auction->owner) // Original auction owner maxChance = maxChance / 5; // if Owner is AHBot this mean player placed bid on this auction. We divide by 5 chance for AhBuyer to place bid on it. (This make more challenge than ignore entry) @@ -422,7 +422,7 @@ bool AuctionBotBuyer::Update(AuctionHouseType houseType) { if (sAuctionBotConfig->GetConfigBuyerEnabled(houseType)) { - TC_LOG_INFO("ahbot", "AHBot: %s buying ...", AuctionBotConfig::GetHouseTypeName(houseType)); + TC_LOG_DEBUG("ahbot", "AHBot: %s buying ...", AuctionBotConfig::GetHouseTypeName(houseType)); if (GetBuyableEntry(_houseConfig[houseType]) > 0) AddNewAuctionBuyerBotBid(_houseConfig[houseType]); return true; diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h index 89be1b8b052..1148435f1c1 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h @@ -47,7 +47,7 @@ typedef std::map<uint32, BuyerAuctionEval> CheckEntryMap; struct BuyerConfiguration { - BuyerConfiguration(): _houseType(AUCTION_HOUSE_NEUTRAL) {} + BuyerConfiguration(): FactionChance(3), BuyerEnabled(false), BuyerPriceRatio(100), _houseType(AUCTION_HOUSE_NEUTRAL) {} void Initialize(AuctionHouseType houseType) { diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp index 053b110e525..13aa1f22fa3 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp @@ -39,7 +39,7 @@ bool AuctionBotSeller::Initialize() std::vector<uint32> includeItems; std::vector<uint32> excludeItems; - TC_LOG_INFO("ahbot", "AHBot seller filters:"); + TC_LOG_DEBUG("ahbot", "AHBot seller filters:"); { std::stringstream includeStream(sAuctionBotConfig->GetAHBotIncludes()); @@ -55,10 +55,10 @@ bool AuctionBotSeller::Initialize() excludeItems.push_back(atoi(temp.c_str())); } - TC_LOG_INFO("ahbot", "Forced Inclusion %u items", (uint32)includeItems.size()); - TC_LOG_INFO("ahbot", "Forced Exclusion %u items", (uint32)excludeItems.size()); + TC_LOG_DEBUG("ahbot", "Forced Inclusion %u items", (uint32)includeItems.size()); + TC_LOG_DEBUG("ahbot", "Forced Exclusion %u items", (uint32)excludeItems.size()); - TC_LOG_INFO("ahbot", "Loading npc vendor items for filter.."); + TC_LOG_DEBUG("ahbot", "Loading npc vendor items for filter.."); const CreatureTemplateContainer* creatures = sObjectMgr->GetCreatureTemplates(); std::set<uint32> tempItems; for (CreatureTemplateContainer::const_iterator it = creatures->begin(); it != creatures->end(); ++it) @@ -72,9 +72,9 @@ bool AuctionBotSeller::Initialize() for (std::set<uint32>::const_iterator it = tempItems.begin(); it != tempItems.end(); ++it) npcItems.push_back(*it); - TC_LOG_INFO("ahbot", "Npc vendor filter has %u items", (uint32)npcItems.size()); + TC_LOG_DEBUG("ahbot", "Npc vendor filter has %u items", (uint32)npcItems.size()); - TC_LOG_INFO("ahbot", "Loading loot items for filter.."); + TC_LOG_DEBUG("ahbot", "Loading loot items for filter.."); QueryResult result = WorldDatabase.PQuery( "SELECT `item` FROM `creature_loot_template` UNION " "SELECT `item` FROM `disenchant_loot_template` UNION " @@ -101,8 +101,8 @@ bool AuctionBotSeller::Initialize() } while (result->NextRow()); } - TC_LOG_INFO("ahbot", "Loot filter has %u items", (uint32)lootItems.size()); - TC_LOG_INFO("ahbot", "Sorting and cleaning items for AHBot seller..."); + TC_LOG_DEBUG("ahbot", "Loot filter has %u items", (uint32)lootItems.size()); + TC_LOG_DEBUG("ahbot", "Sorting and cleaning items for AHBot seller..."); uint32 itemsAdded = 0; @@ -382,18 +382,18 @@ bool AuctionBotSeller::Initialize() return false; } - TC_LOG_INFO("ahbot", "AuctionHouseBot seller will use %u items to fill auction house (according your config choices)", itemsAdded); + TC_LOG_DEBUG("ahbot", "AuctionHouseBot seller will use %u items to fill auction house (according your config choices)", itemsAdded); LoadConfig(); - TC_LOG_INFO("ahbot", "Items loaded \tGray\tWhite\tGreen\tBlue\tPurple\tOrange\tYellow"); + TC_LOG_DEBUG("ahbot", "Items loaded \tGray\tWhite\tGreen\tBlue\tPurple\tOrange\tYellow"); for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i) - TC_LOG_INFO("ahbot", "\t\t%u\t%u\t%u\t%u\t%u\t%u\t%u", + TC_LOG_DEBUG("ahbot", "\t\t%u\t%u\t%u\t%u\t%u\t%u\t%u", (uint32)_itemPool[0][i].size(), (uint32)_itemPool[1][i].size(), (uint32)_itemPool[2][i].size(), (uint32)_itemPool[3][i].size(), (uint32)_itemPool[4][i].size(), (uint32)_itemPool[5][i].size(), (uint32)_itemPool[6][i].size()); - TC_LOG_INFO("ahbot", "AHBot seller configuration data loaded and initialized"); + TC_LOG_DEBUG("ahbot", "AHBot seller configuration data loaded and initialized"); return true; } @@ -594,17 +594,17 @@ void AuctionBotSeller::LoadSellerValues(SellerConfiguration& config) config.SetMinTime(sAuctionBotConfig->GetConfig(CONFIG_AHBOT_MINTIME)); config.SetMaxTime(sAuctionBotConfig->GetConfig(CONFIG_AHBOT_MAXTIME)); - TC_LOG_INFO("ahbot", "AHBot: minTime = %u", config.GetMinTime()); - TC_LOG_INFO("ahbot", "AHBot: maxTime = %u", config.GetMaxTime()); - - TC_LOG_INFO("ahbot", "AHBot: For AH type %u", config.GetHouseType()); - TC_LOG_INFO("ahbot", "AHBot: GrayItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_GRAY)); - TC_LOG_INFO("ahbot", "AHBot: WhiteItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_WHITE)); - TC_LOG_INFO("ahbot", "AHBot: GreenItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_GREEN)); - TC_LOG_INFO("ahbot", "AHBot: BlueItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_BLUE)); - TC_LOG_INFO("ahbot", "AHBot: PurpleItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_PURPLE)); - TC_LOG_INFO("ahbot", "AHBot: OrangeItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_ORANGE)); - TC_LOG_INFO("ahbot", "AHBot: YellowItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_YELLOW)); + TC_LOG_DEBUG("ahbot", "AHBot: minTime = %u", config.GetMinTime()); + TC_LOG_DEBUG("ahbot", "AHBot: maxTime = %u", config.GetMaxTime()); + + TC_LOG_DEBUG("ahbot", "AHBot: For AH type %u", config.GetHouseType()); + TC_LOG_DEBUG("ahbot", "AHBot: GrayItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_GRAY)); + TC_LOG_DEBUG("ahbot", "AHBot: WhiteItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_WHITE)); + TC_LOG_DEBUG("ahbot", "AHBot: GreenItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_GREEN)); + TC_LOG_DEBUG("ahbot", "AHBot: BlueItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_BLUE)); + TC_LOG_DEBUG("ahbot", "AHBot: PurpleItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_PURPLE)); + TC_LOG_DEBUG("ahbot", "AHBot: OrangeItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_ORANGE)); + TC_LOG_DEBUG("ahbot", "AHBot: YellowItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_YELLOW)); } // Set static of items on one AH faction. @@ -637,10 +637,10 @@ uint32 AuctionBotSeller::SetStat(SellerConfiguration& config) } } - TC_LOG_INFO("ahbot", "AHBot: Missed Item \tGray\tWhite\tGreen\tBlue\tPurple\tOrange\tYellow"); + TC_LOG_DEBUG("ahbot", "AHBot: Missed Item \tGray\tWhite\tGreen\tBlue\tPurple\tOrange\tYellow"); for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i) { - TC_LOG_INFO("ahbot", "AHBot: \t\t%u\t%u\t%u\t%u\t%u\t%u\t%u", + TC_LOG_DEBUG("ahbot", "AHBot: \t\t%u\t%u\t%u\t%u\t%u\t%u\t%u", config.GetMissedItemsPerClass(AUCTION_QUALITY_GRAY, (ItemClass)i), config.GetMissedItemsPerClass(AUCTION_QUALITY_WHITE, (ItemClass)i), config.GetMissedItemsPerClass(AUCTION_QUALITY_GREEN, (ItemClass)i), @@ -899,13 +899,13 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config) if (config.LastMissedItem > sAuctionBotConfig->GetItemPerCycleBoost()) { items = sAuctionBotConfig->GetItemPerCycleBoost(); - TC_LOG_INFO("ahbot", "AHBot: Boost value used to fill AH! (if this happens often adjust both ItemsPerCycle in worldserver.conf)"); + TC_LOG_DEBUG("ahbot", "AHBot: Boost value used to fill AH! (if this happens often adjust both ItemsPerCycle in worldserver.conf)"); } else items = sAuctionBotConfig->GetItemPerCycleNormal(); - uint32 houseid; - uint32 auctioneer; + uint32 houseid = 0; + uint32 auctioneer = 0; switch (config.GetHouseType()) { case AUCTION_HOUSE_ALLIANCE: @@ -938,14 +938,14 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config) if (!itemId) { - TC_LOG_INFO("ahbot", "AHBot: Item entry 0 auction creating attempt."); + TC_LOG_DEBUG("ahbot", "AHBot: Item entry 0 auction creating attempt."); continue; } ItemTemplate const* prototype = sObjectMgr->GetItemTemplate(itemId); if (!prototype) { - TC_LOG_INFO("ahbot", "AHBot: Unknown item %u auction creating attempt.", itemId); + TC_LOG_DEBUG("ahbot", "AHBot: Unknown item %u auction creating attempt.", itemId); continue; } @@ -1012,14 +1012,14 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config) } CharacterDatabase.CommitTransaction(trans); - TC_LOG_INFO("ahbot", "AHBot: Added %u items to auction", count); + TC_LOG_DEBUG("ahbot", "AHBot: Added %u items to auction", count); } bool AuctionBotSeller::Update(AuctionHouseType houseType) { if (sAuctionBotConfig->GetConfigItemAmountRatio(houseType) > 0) { - TC_LOG_INFO("ahbot", "AHBot: %s selling ...", AuctionBotConfig::GetHouseTypeName(houseType)); + TC_LOG_DEBUG("ahbot", "AHBot: %s selling ...", AuctionBotConfig::GetHouseTypeName(houseType)); if (SetStat(_houseConfig[houseType])) AddNewAuctions(_houseConfig[houseType]); return true; diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h index a1820196dc8..014fe23f71a 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h @@ -55,7 +55,7 @@ struct SellerItemInfo class SellerConfiguration { public: - SellerConfiguration(): _houseType(AUCTION_HOUSE_NEUTRAL) + SellerConfiguration(): LastMissedItem(0), _houseType(AUCTION_HOUSE_NEUTRAL), _minTime(1), _maxTime(72) { } diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 824a1ae475e..9a78d74bb45 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2738,16 +2738,16 @@ AuctionHouseBot.LockBox.Enabled = 0 # # AuctionHouseBot.ItemsPerCycle.Boost -# Description: This value is used to fill DB faster than normal when there is more than this value on missed items (not auctioned items). -# Normaly this value is only used once on server start with empty auction table. +# Description: This value is used to fill AH faster than normal when there is more than this value on missed items (not auctioned items). +# Usually this value is only used once on server start with empty auction table. # Default: 1000 AuctionHouseBot.ItemsPerCycle.Boost = 1000 # # AuctionHouseBot.ItemsPerCycle.Normal -# Description: This value is used to fill DB with way with less cpu/db using. -# Normaly this value is used always when auction table is already initialised. +# Description: This value is used to fill AH for sold and expired items. A high value will be more resource intensive +# Usually this value is used always when auction table is already initialised. # Default: 20 AuctionHouseBot.ItemsPerCycle.Normal = 20 @@ -2785,7 +2785,6 @@ AuctionHouseBot.Neutral.Price.Ratio = 100 # AuctionHouseBot.Items.ItemLevel.* # Description: Prevent seller from listing items below/above this item level # Default: 0 - (Disabled) -# 1-80 (Levels) AuctionHouseBot.Items.ItemLevel.Min = 0 AuctionHouseBot.Items.ItemLevel.Max = 0 |