chore(Core/Handlers): Remove unused item query optimization. (#22971)
This commit is contained in:
@@ -692,7 +692,6 @@ struct ItemTemplate
|
|||||||
uint32 MinMoneyLoot;
|
uint32 MinMoneyLoot;
|
||||||
uint32 MaxMoneyLoot;
|
uint32 MaxMoneyLoot;
|
||||||
ItemFlagsCustom FlagsCu;
|
ItemFlagsCustom FlagsCu;
|
||||||
WorldPacket queryData; // pussywizard
|
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
[[nodiscard]] bool HasSignature() const
|
[[nodiscard]] bool HasSignature() const
|
||||||
@@ -826,8 +825,6 @@ struct ItemTemplate
|
|||||||
[[nodiscard]] bool HasFlag(ItemFlags flag) const { return (Flags & flag) != 0; }
|
[[nodiscard]] bool HasFlag(ItemFlags flag) const { return (Flags & flag) != 0; }
|
||||||
[[nodiscard]] bool HasFlag2(ItemFlags2 flag) const { return (Flags2 & flag) != 0; }
|
[[nodiscard]] bool HasFlag2(ItemFlags2 flag) const { return (Flags2 & flag) != 0; }
|
||||||
[[nodiscard]] bool HasFlagCu(ItemFlagsCustom flag) const { return (FlagsCu & flag) != 0; }
|
[[nodiscard]] bool HasFlagCu(ItemFlagsCustom flag) const { return (FlagsCu & flag) != 0; }
|
||||||
|
|
||||||
void InitializeQueryData();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Benchmarked: Faster than std::map (insert/find)
|
// Benchmarked: Faster than std::map (insert/find)
|
||||||
|
|||||||
@@ -3443,9 +3443,6 @@ void ObjectMgr::LoadItemTemplates()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ItemTemplateContainer::iterator itr = _itemTemplateStore.begin(); itr != _itemTemplateStore.end(); ++itr)
|
|
||||||
itr->second.InitializeQueryData();
|
|
||||||
|
|
||||||
// Check if item templates for DBC referenced character start outfit are present
|
// Check if item templates for DBC referenced character start outfit are present
|
||||||
std::set<uint32> notFoundOutfit;
|
std::set<uint32> notFoundOutfit;
|
||||||
for (uint32 i = 1; i < sCharStartOutfitStore.GetNumRows(); ++i)
|
for (uint32 i = 1; i < sCharStartOutfitStore.GetNumRows(); ++i)
|
||||||
|
|||||||
@@ -385,135 +385,6 @@ bool ItemTemplate::HasSpellPowerStat() const
|
|||||||
return invalid;
|
return invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemTemplate::InitializeQueryData()
|
|
||||||
{
|
|
||||||
queryData.Initialize(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 1);
|
|
||||||
|
|
||||||
queryData << ItemId;
|
|
||||||
queryData << Class;
|
|
||||||
queryData << SubClass;
|
|
||||||
queryData << SoundOverrideSubclass;
|
|
||||||
queryData << Name1;
|
|
||||||
queryData << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name...
|
|
||||||
queryData << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00);
|
|
||||||
queryData << uint8(0x00); //pProto->Name4; // blizz not send name there, just uint8(0x00);
|
|
||||||
queryData << DisplayInfoID;
|
|
||||||
queryData << Quality;
|
|
||||||
queryData << Flags;
|
|
||||||
queryData << Flags2;
|
|
||||||
queryData << BuyPrice;
|
|
||||||
queryData << SellPrice;
|
|
||||||
queryData << InventoryType;
|
|
||||||
queryData << AllowableClass;
|
|
||||||
queryData << AllowableRace;
|
|
||||||
queryData << ItemLevel;
|
|
||||||
queryData << RequiredLevel;
|
|
||||||
queryData << RequiredSkill;
|
|
||||||
queryData << RequiredSkillRank;
|
|
||||||
queryData << RequiredSpell;
|
|
||||||
queryData << RequiredHonorRank;
|
|
||||||
queryData << RequiredCityRank;
|
|
||||||
queryData << RequiredReputationFaction;
|
|
||||||
queryData << RequiredReputationRank;
|
|
||||||
queryData << int32(MaxCount);
|
|
||||||
queryData << int32(Stackable);
|
|
||||||
queryData << ContainerSlots;
|
|
||||||
queryData << StatsCount; // item stats count
|
|
||||||
for (uint32 i = 0; i < StatsCount; ++i)
|
|
||||||
{
|
|
||||||
queryData << ItemStat[i].ItemStatType;
|
|
||||||
queryData << ItemStat[i].ItemStatValue;
|
|
||||||
}
|
|
||||||
queryData << ScalingStatDistribution; // scaling stats distribution
|
|
||||||
queryData << ScalingStatValue; // some kind of flags used to determine stat values column
|
|
||||||
for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
|
|
||||||
{
|
|
||||||
queryData << Damage[i].DamageMin;
|
|
||||||
queryData << Damage[i].DamageMax;
|
|
||||||
queryData << Damage[i].DamageType;
|
|
||||||
}
|
|
||||||
|
|
||||||
// resistances (7)
|
|
||||||
queryData << Armor;
|
|
||||||
queryData << HolyRes;
|
|
||||||
queryData << FireRes;
|
|
||||||
queryData << NatureRes;
|
|
||||||
queryData << FrostRes;
|
|
||||||
queryData << ShadowRes;
|
|
||||||
queryData << ArcaneRes;
|
|
||||||
|
|
||||||
queryData << Delay;
|
|
||||||
queryData << AmmoType;
|
|
||||||
queryData << RangedModRange;
|
|
||||||
|
|
||||||
for (int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s)
|
|
||||||
{
|
|
||||||
// send DBC data for cooldowns in same way as it used in Spell::SendSpellCooldown
|
|
||||||
// use `item_template` or if not set then only use spell cooldowns
|
|
||||||
SpellInfo const* spell = sSpellMgr->GetSpellInfo(Spells[s].SpellId);
|
|
||||||
if (spell)
|
|
||||||
{
|
|
||||||
bool db_data = Spells[s].SpellCooldown >= 0 || Spells[s].SpellCategoryCooldown >= 0;
|
|
||||||
|
|
||||||
queryData << Spells[s].SpellId;
|
|
||||||
queryData << Spells[s].SpellTrigger;
|
|
||||||
queryData << int32(Spells[s].SpellCharges);
|
|
||||||
|
|
||||||
if (db_data)
|
|
||||||
{
|
|
||||||
queryData << uint32(Spells[s].SpellCooldown);
|
|
||||||
queryData << uint32(Spells[s].SpellCategory);
|
|
||||||
queryData << uint32(Spells[s].SpellCategoryCooldown);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
queryData << uint32(spell->RecoveryTime);
|
|
||||||
queryData << uint32(spell->GetCategory());
|
|
||||||
queryData << uint32(spell->CategoryRecoveryTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
queryData << uint32(0);
|
|
||||||
queryData << uint32(0);
|
|
||||||
queryData << uint32(0);
|
|
||||||
queryData << uint32(-1);
|
|
||||||
queryData << uint32(0);
|
|
||||||
queryData << uint32(-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queryData << Bonding;
|
|
||||||
queryData << Description;
|
|
||||||
queryData << PageText;
|
|
||||||
queryData << LanguageID;
|
|
||||||
queryData << PageMaterial;
|
|
||||||
queryData << StartQuest;
|
|
||||||
queryData << LockID;
|
|
||||||
queryData << int32(Material);
|
|
||||||
queryData << Sheath;
|
|
||||||
queryData << RandomProperty;
|
|
||||||
queryData << RandomSuffix;
|
|
||||||
queryData << Block;
|
|
||||||
queryData << ItemSet;
|
|
||||||
queryData << MaxDurability;
|
|
||||||
queryData << Area;
|
|
||||||
queryData << Map; // Added in 1.12.x & 2.0.1 client branch
|
|
||||||
queryData << BagFamily;
|
|
||||||
queryData << TotemCategory;
|
|
||||||
for (int s = 0; s < MAX_ITEM_PROTO_SOCKETS; ++s)
|
|
||||||
{
|
|
||||||
queryData << Socket[s].Color;
|
|
||||||
queryData << Socket[s].Content;
|
|
||||||
}
|
|
||||||
queryData << socketBonus;
|
|
||||||
queryData << GemProperties;
|
|
||||||
queryData << RequiredDisenchantSkill;
|
|
||||||
queryData << ArmorDamageModifier;
|
|
||||||
queryData << Duration; // added in 2.4.2.8209, duration (seconds)
|
|
||||||
queryData << ItemLimitCategory; // WotLK, ItemLimitCategory
|
|
||||||
queryData << HolidayId; // Holiday.dbc?
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only _static_ data send in this packet !!!
|
// Only _static_ data send in this packet !!!
|
||||||
void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recvData)
|
void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recvData)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user