diff options
| -rw-r--r-- | sql/updates/world/3.3.5/2019_03_12_00_world.sql | 5 | ||||
| -rw-r--r-- | src/server/game/AuctionHouseBot/AuctionHouseBot.cpp | 7 | ||||
| -rw-r--r-- | src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp | 5 | ||||
| -rw-r--r-- | src/server/game/Conditions/DisableMgr.cpp | 17 | ||||
| -rw-r--r-- | src/server/game/Conditions/DisableMgr.h | 15 | ||||
| -rw-r--r-- | src/server/game/Handlers/AuctionHouseHandler.cpp | 7 | ||||
| -rw-r--r-- | src/server/worldserver/worldserver.conf.dist | 10 |
7 files changed, 52 insertions, 14 deletions
diff --git a/sql/updates/world/3.3.5/2019_03_12_00_world.sql b/sql/updates/world/3.3.5/2019_03_12_00_world.sql new file mode 100644 index 00000000000..81598e7a55a --- /dev/null +++ b/sql/updates/world/3.3.5/2019_03_12_00_world.sql @@ -0,0 +1,5 @@ +DELETE FROM `disables` WHERE `sourceType` = 9 AND `entry` IN (6343,6345,6376); +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`comment`) VALUES +(9,6343,2, 'Disable item 6343 for AH'), +(9,6345,2, 'Disable item 6345 for AH'), +(9,6376,2, 'Disable item 6376 for AH'); diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp index c3c9d33d44c..4a852ad3cd6 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp @@ -147,7 +147,12 @@ void AuctionBotConfig::GetConfigFromFile() SetConfigMax(CONFIG_AHBOT_NEUTRAL_ITEM_AMOUNT_RATIO, "AuctionHouseBot.Neutral.Items.Amount.Ratio", 100, 10000); SetAHBotIncludes(sConfigMgr->GetStringDefault("AuctionHouseBot.forceIncludeItems", "")); - SetAHBotExcludes(sConfigMgr->GetStringDefault("AuctionHouseBot.forceExcludeItems", "")); + std::string ahBotExcludes = sConfigMgr->GetStringDefault("AuctionHouseBot.forceExcludeItems", ""); + if (!ahBotExcludes.empty()) + { + TC_LOG_WARN("server.loading", "AuctionHouseBot.forceExcludeItems will be deleted soon. Please, use `disables` table instead with `sourceType`=9, `flags`=2 and `entry`=<item id>."); + SetAHBotExcludes(ahBotExcludes); + } SetConfig(CONFIG_AHBOT_BUYER_ALLIANCE_ENABLED, "AuctionHouseBot.Buyer.Alliance.Enabled", false); SetConfig(CONFIG_AHBOT_BUYER_HORDE_ENABLED, "AuctionHouseBot.Buyer.Horde.Enabled", false); diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp index d80a86fc478..f0bc80ebbf9 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp @@ -20,6 +20,7 @@ #include "Containers.h" #include "DatabaseEnv.h" #include "DBCStores.h" +#include "DisableMgr.h" #include "GameTime.h" #include "Item.h" #include "Log.h" @@ -62,7 +63,6 @@ bool AuctionBotSeller::Initialize() } TC_LOG_DEBUG("ahbot", "Forced Inclusion %u items", (uint32)includeItems.size()); - TC_LOG_DEBUG("ahbot", "Forced Exclusion %u items", (uint32)excludeItems.size()); TC_LOG_DEBUG("ahbot", "Loading npc vendor items for filter.."); CreatureTemplateContainer const& creatures = sObjectMgr->GetCreatureTemplates(); @@ -120,6 +120,9 @@ bool AuctionBotSeller::Initialize() if (excludeItems.count(itemId)) continue; + if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ITEM, itemId, nullptr, ITEM_DISABLE_AUCTIONHOUSE_BOT)) + continue; + // forced include filter if (includeItems.count(itemId)) { diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index d939db03255..c08e2a609c4 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -47,7 +47,7 @@ namespace DisableMap m_DisableMap; - uint8 MAX_DISABLE_TYPES = 9; + uint8 MAX_DISABLE_TYPES = 10; } void LoadDisables() @@ -256,6 +256,20 @@ void LoadDisables() } break; } + case DISABLE_TYPE_ITEM: + { + if (!sObjectMgr->GetItemTemplate(entry)) + { + TC_LOG_ERROR("sql.sql", "Item entry %u from `disables` doesn't exist in item_template, skipped.", entry); + continue; + } + if (!flags || flags > MAX_ITEM_DISABLE_TYPE) + { + TC_LOG_ERROR("sql.sql", "Disable flags for item %u are invalid, skipped.", entry); + continue; + } + break; + } default: break; } @@ -396,6 +410,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, WorldObject const* ref, uint8 case DISABLE_TYPE_MMAP: return true; case DISABLE_TYPE_VMAP: + case DISABLE_TYPE_ITEM: return (flags & itr->second.flags) != 0; } diff --git a/src/server/game/Conditions/DisableMgr.h b/src/server/game/Conditions/DisableMgr.h index 25da1114a6d..eece9e757ec 100644 --- a/src/server/game/Conditions/DisableMgr.h +++ b/src/server/game/Conditions/DisableMgr.h @@ -33,7 +33,8 @@ enum DisableType DISABLE_TYPE_OUTDOORPVP = 5, DISABLE_TYPE_VMAP = 6, DISABLE_TYPE_MMAP = 7, - DISABLE_TYPE_LFG_MAP = 8 + DISABLE_TYPE_LFG_MAP = 8, + DISABLE_TYPE_ITEM = 9 }; enum SpellDisableTypes @@ -54,6 +55,18 @@ enum SpellDisableTypes SPELL_DISABLE_BATTLEGROUNDS), }; +enum ItemDisableTypes +{ + ITEM_DISABLE_AUCTIONHOUSE = 0x01, + ITEM_DISABLE_AUCTIONHOUSE_BOT = 0x02, + /* @todo + ITEM_DISABLE_VENDOR = 0x04, + ITEM_DISABLE_QUEST = 0x08, + ITEM_DISABLE_DROP = 0x10, + */ + MAX_ITEM_DISABLE_TYPE = ( ITEM_DISABLE_AUCTIONHOUSE | ITEM_DISABLE_AUCTIONHOUSE_BOT /*| ITEM_DISABLE_VENDOR | ITEM_DISABLE_QUEST | ITEM_DISABLE_DROP*/) +}; + enum MMapDisableTypes { MMAP_DISABLE_PATHFINDING = 0x0 diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 5f7ef0643bf..db5c44a5bda 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -23,6 +23,7 @@ #include "Creature.h" #include "DatabaseEnv.h" #include "DBCStructure.h" +#include "DisableMgr.h" #include "GameTime.h" #include "Item.h" #include "Language.h" @@ -208,6 +209,12 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) if (itemEntry == 0) itemEntry = item->GetTemplate()->ItemId; + if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ITEM, itemEntry, nullptr, ITEM_DISABLE_AUCTIONHOUSE)) + { + SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); + return; + } + if (sAuctionMgr->GetAItem(item->GetGUID().GetCounter()) || !item->CanBeTraded() || item->IsNotEmptyBag() || (item->GetTemplate()->Flags & ITEM_FLAG_CONJURED) || item->GetUInt32Value(ITEM_FIELD_DURATION) || item->GetCount() < count[i] || itemEntry != item->GetTemplate()->ItemId) diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index eb31fc4da9a..a65ba57c33e 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -3647,16 +3647,6 @@ AuctionHouseBot.Class.Container.ItemLevel.Max = 0 AuctionHouseBot.forceIncludeItems = "" # -# AuctionHouseBot.forceExcludeItems -# Description: Exclude these items even if they would pass the filters -# List of ids with delimiter ',' -# Example: "21878,27774,27811,28117,28122,43949" (this removes old items) -# Default: "" -# - -AuctionHouseBot.forceExcludeItems = "6343,6345,6376" - -# # AuctionHouseBot.Class.RandomStackRatio.* # Description: Used to determine how often a stack of the class will be single or randomly-size stacked when posted # Value needs to be between 0 and 100, no decimal. Anything higher than 100 will be treated as 100 |
