Created
August 27, 2014 17:18
-
-
Save DDuarte/9c5e4a1a06078345b793 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp | |
| index f7c8003..3a27f59 100644 | |
| --- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp | |
| +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp | |
| @@ -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,7 +317,7 @@ 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?", | |
| + TC_LOG_DEBUG("ahbot", "AHBot: Entry %u on ah %u doesn't exists, perhaps bought already?", | |
| itr->second.AuctionId, auction->GetHouseId()); | |
| config.CheckedEntry.erase(itr++); | |
| @@ -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/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp | |
| index 053b110..309f31b 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,7 +899,7 @@ 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(); | |
| @@ -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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment