mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Core/Items: Removed no longer needed code for item set names and item set names locales
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DROP TABLE IF EXISTS `locales_item_set_names`;
|
||||
DROP TABLE IF EXISTS `item_set_names`;
|
||||
@@ -760,17 +760,6 @@ struct ItemLocale
|
||||
StringVector Description;
|
||||
};
|
||||
|
||||
struct ItemSetNameEntry
|
||||
{
|
||||
std::string name;
|
||||
uint32 InventoryType;
|
||||
};
|
||||
|
||||
struct ItemSetNameLocale
|
||||
{
|
||||
StringVector Name;
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack()
|
||||
|
||||
@@ -2622,118 +2622,6 @@ ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemSetNameLocales()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_itemSetNameLocaleStore.clear(); // need for reload case
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`, `name_loc1`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc5`, `name_loc6`, `name_loc7`, `name_loc8` FROM `locales_item_set_names`");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
|
||||
ItemSetNameLocale& data = _itemSetNameLocaleStore[entry];
|
||||
|
||||
for (uint8 i = 1; i < TOTAL_LOCALES; ++i)
|
||||
AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Name);
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(_itemSetNameLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemSetNames()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_itemSetNameStore.clear(); // needed for reload case
|
||||
|
||||
std::set<uint32> itemSetItems;
|
||||
|
||||
// fill item set member ids
|
||||
for (uint32 entryId = 0; entryId < sItemSetStore.GetNumRows(); ++entryId)
|
||||
{
|
||||
ItemSetEntry const* setEntry = sItemSetStore.LookupEntry(entryId);
|
||||
if (!setEntry)
|
||||
continue;
|
||||
|
||||
for (uint32 i = 0; i < MAX_ITEM_SET_ITEMS; ++i)
|
||||
if (setEntry->itemId[i])
|
||||
itemSetItems.insert(setEntry->itemId[i]);
|
||||
}
|
||||
|
||||
// 0 1 2
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outString(">> Loaded 0 item set names. DB table `item_set_names` is empty.");
|
||||
sLog->outString();
|
||||
return;
|
||||
}
|
||||
|
||||
_itemSetNameStore.rehash(result->GetRowCount());
|
||||
uint32 count = 0;
|
||||
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
if (itemSetItems.find(entry) == itemSetItems.end())
|
||||
{
|
||||
sLog->outErrorDb("Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemSetNameEntry &data = _itemSetNameStore[entry];
|
||||
data.name = fields[1].GetString();
|
||||
|
||||
uint32 invType = fields[2].GetUInt8();
|
||||
if (invType >= MAX_INVTYPE)
|
||||
{
|
||||
sLog->outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType);
|
||||
invType = INVTYPE_NON_EQUIP;
|
||||
}
|
||||
|
||||
data.InventoryType = invType;
|
||||
itemSetItems.erase(entry);
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
if (!itemSetItems.empty())
|
||||
{
|
||||
ItemTemplate const* pProto;
|
||||
for (std::set<uint32>::iterator itr = itemSetItems.begin(); itr != itemSetItems.end(); ++itr)
|
||||
{
|
||||
uint32 entry = *itr;
|
||||
// add data from item_template if available
|
||||
pProto = sObjectMgr->GetItemTemplate(entry);
|
||||
if (pProto)
|
||||
{
|
||||
sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry);
|
||||
ItemSetNameEntry &data = _itemSetNameStore[entry];
|
||||
data.name = pProto->Name1;
|
||||
data.InventoryType = pProto->InventoryType;
|
||||
++count;
|
||||
}
|
||||
else
|
||||
sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry);
|
||||
}
|
||||
}
|
||||
|
||||
sLog->outString(">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadVehicleTemplateAccessories()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
@@ -640,14 +640,6 @@ class ObjectMgr
|
||||
ItemTemplate const* GetItemTemplate(uint32 entry);
|
||||
ItemTemplateContainer const* GetItemTemplateStore() const { return &_itemTemplateStore; }
|
||||
|
||||
ItemSetNameEntry const* GetItemSetNameEntry(uint32 itemId)
|
||||
{
|
||||
ItemSetNameContainer::iterator itr = _itemSetNameStore.find(itemId);
|
||||
if (itr != _itemSetNameStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
InstanceTemplate const* GetInstanceTemplate(uint32 mapId);
|
||||
|
||||
PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const;
|
||||
@@ -864,8 +856,6 @@ class ObjectMgr
|
||||
void LoadItemTemplateAddon();
|
||||
void LoadItemScriptNames();
|
||||
void LoadItemLocales();
|
||||
void LoadItemSetNames();
|
||||
void LoadItemSetNameLocales();
|
||||
void LoadQuestLocales();
|
||||
void LoadNpcTextLocales();
|
||||
void LoadPageTextLocales();
|
||||
@@ -990,12 +980,6 @@ class ObjectMgr
|
||||
if (itr == _itemLocaleStore.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
ItemSetNameLocale const* GetItemSetNameLocale(uint32 entry) const
|
||||
{
|
||||
ItemSetNameLocaleContainer::const_iterator itr = _itemSetNameLocaleStore.find(entry);
|
||||
if (itr == _itemSetNameLocaleStore.end())return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestLocale const* GetQuestLocale(uint32 entry) const
|
||||
{
|
||||
QuestLocaleContainer::const_iterator itr = _questLocaleStore.find(entry);
|
||||
@@ -1266,9 +1250,6 @@ class ObjectMgr
|
||||
HalfNameContainer _petHalfName0;
|
||||
HalfNameContainer _petHalfName1;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, ItemSetNameEntry> ItemSetNameContainer;
|
||||
ItemSetNameContainer _itemSetNameStore;
|
||||
|
||||
MapObjectGuids _mapObjectGuidsStore;
|
||||
CreatureDataContainer _creatureDataStore;
|
||||
CreatureTemplateContainer _creatureTemplateStore;
|
||||
@@ -1284,7 +1265,6 @@ class ObjectMgr
|
||||
|
||||
ItemTemplateContainer _itemTemplateStore;
|
||||
ItemLocaleContainer _itemLocaleStore;
|
||||
ItemSetNameLocaleContainer _itemSetNameLocaleStore;
|
||||
QuestLocaleContainer _questLocaleStore;
|
||||
NpcTextLocaleContainer _npcTextLocaleStore;
|
||||
PageTextLocaleContainer _pageTextLocaleStore;
|
||||
|
||||
@@ -1041,30 +1041,6 @@ void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid,
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
uint32 itemid;
|
||||
recv_data >> itemid;
|
||||
recv_data.read_skip<uint64>(); // guid
|
||||
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid);
|
||||
ItemSetNameEntry const* pName = sObjectMgr->GetItemSetNameEntry(itemid);
|
||||
if (pName)
|
||||
{
|
||||
std::string Name = pName->name;
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
if (ItemSetNameLocale const* isnl = sObjectMgr->GetItemSetNameLocale(itemid))
|
||||
ObjectMgr::GetLocaleString(isnl->Name, loc_idx, Name);
|
||||
|
||||
WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+Name.size()+1+4));
|
||||
data << uint32(itemid);
|
||||
data << Name;
|
||||
data << uint32(pName->InventoryType);
|
||||
SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM");
|
||||
|
||||
@@ -360,7 +360,6 @@ void InitOpcodes()
|
||||
DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund );
|
||||
DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery );
|
||||
|
||||
@@ -492,7 +492,6 @@ class WorldSession
|
||||
void HandleDelIgnoreOpcode(WorldPacket& recvPacket);
|
||||
void HandleSetContactNotesOpcode(WorldPacket& recvPacket);
|
||||
void HandleBugOpcode(WorldPacket& recvPacket);
|
||||
void HandleItemNameQueryOpcode(WorldPacket& recvPacket);
|
||||
|
||||
void HandleAreaTriggerOpcode(WorldPacket& recvPacket);
|
||||
|
||||
|
||||
@@ -1304,7 +1304,6 @@ void World::SetInitialWorldSettings()
|
||||
sObjectMgr->LoadCreatureLocales();
|
||||
sObjectMgr->LoadGameObjectLocales();
|
||||
sObjectMgr->LoadItemLocales();
|
||||
sObjectMgr->LoadItemSetNameLocales();
|
||||
sObjectMgr->LoadQuestLocales();
|
||||
sObjectMgr->LoadNpcTextLocales();
|
||||
sObjectMgr->LoadPageTextLocales();
|
||||
@@ -1372,9 +1371,6 @@ void World::SetInitialWorldSettings()
|
||||
sLog->outString("Loading Item Scripts..."); // must be after LoadItemPrototypes
|
||||
sObjectMgr->LoadItemScriptNames();
|
||||
|
||||
sLog->outString("Loading Item set names..."); // must be after LoadItemPrototypes
|
||||
sObjectMgr->LoadItemSetNames();
|
||||
|
||||
sLog->outString("Loading Creature Model Based Info Data...");
|
||||
sObjectMgr->LoadCreatureModelInfo();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user