Renamed Item_Struct to ItemData

This commit is contained in:
KimLS
2015-02-17 18:06:22 -08:00
parent b75e6308dd
commit 701e194ece
69 changed files with 477 additions and 381 deletions
+5 -1
View File
@@ -30,8 +30,10 @@ SET(common_sources
faction.cpp
guild_base.cpp
guilds.cpp
inventory.cpp
ipc_mutex.cpp
item.cpp
item_instance.cpp
md5.cpp
memory_mapped_file.cpp
misc.cpp
@@ -135,10 +137,12 @@ SET(common_headers
global_define.h
guild_base.h
guilds.h
inventory.h
ipc_mutex.h
item.h
item_data.h
item_fieldlist.h
item_struct.h
item_instance.h
languages.h
linked_list.h
loottable.h
+1 -1
View File
@@ -259,7 +259,7 @@ enum AugmentationRestrictionTypes : uint8 {
/*
** Container use types
**
** This correlates to world 'object.type' (object.h/Object.cpp) as well as Item_Struct.BagType
** This correlates to world 'object.type' (object.h/Object.cpp) as well as ItemData.BagType
**
** (ref: database, web forums and eqstr_us.txt)
*/
+2 -2
View File
@@ -24,7 +24,7 @@
#include <list>
#include <time.h>
#include "../common/version.h"
//#include "../common/item_struct.h"
//#include "../common/item_data.h"
static const uint32 BUFF_COUNT = 25;
static const uint32 MAX_MERC = 100;
@@ -2082,7 +2082,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
ItemData item;
uint8 iss_unknown001[6];
};*/
+20
View File
@@ -0,0 +1,20 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "inventory.h"
+32
View File
@@ -0,0 +1,32 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_INVENTORY_H
#define COMMON_INVENTORY_H
namespace EQEmu
{
class Inventory
{
public:
private:
};
} // EQEmu
#endif
+13 -13
View File
@@ -368,7 +368,7 @@ ItemInst* InventoryOld::PopItem(int16 slot_id)
return p;
}
bool InventoryOld::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) {
bool InventoryOld::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
if (ItemToTry->Stackable) {
@@ -901,7 +901,7 @@ uint8 InventoryOld::CalcMaterialFromSlot(int16 equipslot)
}
}
bool InventoryOld::CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_Struct *Container) {
bool InventoryOld::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
if (!ItemToTry || !Container)
return false;
@@ -1429,7 +1429,7 @@ int16 InventoryOld::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
//
// class ItemInst
//
ItemInst::ItemInst(const Item_Struct* item, int16 charges) {
ItemInst::ItemInst(const ItemData* item, int16 charges) {
m_use_type = ItemInstNormal;
m_item = item;
m_charges = charges;
@@ -1539,7 +1539,7 @@ ItemInst::ItemInst(const ItemInst& copy)
m_evolveLvl = copy.m_evolveLvl;
m_activated = copy.m_activated;
if (copy.m_scaledItem)
m_scaledItem = new Item_Struct(*copy.m_scaledItem);
m_scaledItem = new ItemData(*copy.m_scaledItem);
else
m_scaledItem = nullptr;
@@ -1758,7 +1758,7 @@ void ItemInst::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
continue;
}
const Item_Struct* item = inst->GetItem();
const ItemData* item = inst->GetItem();
if (item == nullptr) {
cur = m_contents.erase(cur);
continue;
@@ -1899,7 +1899,7 @@ bool ItemInst::UpdateOrnamentationInfo() {
int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
if (GetOrnamentationAug(ornamentationAugtype))
{
const Item_Struct* ornamentItem;
const ItemData* ornamentItem;
ornamentItem = GetOrnamentationAug(ornamentationAugtype)->GetItem();
if (ornamentItem != nullptr)
{
@@ -1926,7 +1926,7 @@ bool ItemInst::UpdateOrnamentationInfo() {
return ornamentSet;
}
bool ItemInst::CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll) {
bool ItemInst::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
if (!ItemToTry || !Container) return false;
if (ItemToTry->ItemType == ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
@@ -2060,7 +2060,7 @@ bool ItemInst::IsAmmo() const
}
const Item_Struct* ItemInst::GetItem() const
const ItemData* ItemInst::GetItem() const
{
if (!m_item)
return nullptr;
@@ -2071,7 +2071,7 @@ const Item_Struct* ItemInst::GetItem() const
return m_item;
}
const Item_Struct* ItemInst::GetUnscaledItem() const
const ItemData* ItemInst::GetUnscaledItem() const
{
// No operator calls and defaults to nullptr
return m_item;
@@ -2179,10 +2179,10 @@ void ItemInst::ScaleItem() {
return;
if (m_scaledItem) {
memcpy(m_scaledItem, m_item, sizeof(Item_Struct));
memcpy(m_scaledItem, m_item, sizeof(ItemData));
}
else {
m_scaledItem = new Item_Struct(*m_item);
m_scaledItem = new ItemData(*m_item);
}
float Mult = (float)(GetExp()) / 10000; // scaling is determined by exp, with 10,000 being full stats
@@ -2326,9 +2326,9 @@ EvolveInfo::~EvolveInfo() {
//
// struct Item_Struct
// struct ItemData
//
bool Item_Struct::IsEquipable(uint16 Race, uint16 Class_) const
bool ItemData::IsEquipable(uint16 Race, uint16 Class_) const
{
bool IsRace = false;
bool IsClass = false;
+10 -10
View File
@@ -27,7 +27,7 @@ class ItemParse; // Parses item packets
class EvolveInfo; // Stores information about an evolving item family
#include "../common/eq_constants.h"
#include "../common/item_struct.h"
#include "../common/item_data.h"
#include "../common/timer.h"
#include <list>
@@ -168,7 +168,7 @@ public:
ItemInst* PopItem(int16 slot_id);
// Check whether there is space for the specified number of the specified item.
bool HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity);
bool HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
@@ -193,7 +193,7 @@ public:
static int16 CalcSlotFromMaterial(uint8 material);
static uint8 CalcMaterialFromSlot(int16 equipslot);
static bool CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_Struct *Container);
static bool CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container);
// Test for valid inventory casting slot
bool SupportsClickCasting(int16 slot_id);
@@ -270,7 +270,7 @@ public:
/////////////////////////
// Constructors/Destructor
ItemInst(const Item_Struct* item = nullptr, int16 charges = 0);
ItemInst(const ItemData* item = nullptr, int16 charges = 0);
ItemInst(SharedDatabase *db, uint32 item_id, int16 charges = 0);
@@ -331,7 +331,7 @@ public:
bool IsAugmented();
ItemInst* GetOrnamentationAug(int32 ornamentationAugtype) const;
bool UpdateOrnamentationInfo();
static bool CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll = false);
static bool CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll = false);
// Has attack/delay?
bool IsWeapon() const;
@@ -340,8 +340,8 @@ public:
// Accessors
const uint32 GetID() const { return ((m_item) ? m_item->ID : NO_ITEM); }
const uint32 GetItemScriptID() const { return ((m_item) ? m_item->ScriptFileID : NO_ITEM); }
const Item_Struct* GetItem() const;
const Item_Struct* GetUnscaledItem() const;
const ItemData* GetItem() const;
const ItemData* GetUnscaledItem() const;
int16 GetCharges() const { return m_charges; }
void SetCharges(int16 charges) { m_charges = charges; }
@@ -376,7 +376,7 @@ public:
// Allows treatment of this object as though it were a pointer to m_item
operator bool() const { return (m_item != nullptr); }
// Compare inner Item_Struct of two ItemInst objects
// Compare inner ItemData of two ItemInst objects
bool operator==(const ItemInst& right) const { return (this->m_item == right.m_item); }
bool operator!=(const ItemInst& right) const { return (this->m_item != right.m_item); }
@@ -431,7 +431,7 @@ protected:
void _PutItem(uint8 index, ItemInst* inst) { m_contents[index] = inst; }
ItemInstTypes m_use_type; // Usage type for item
const Item_Struct* m_item; // Ptr to item data
const ItemData* m_item; // Ptr to item data
int16 m_charges; // # of charges for chargeable items
uint32 m_price; // Bazaar /trader price
uint32 m_color;
@@ -443,7 +443,7 @@ protected:
uint32 m_exp;
int8 m_evolveLvl;
bool m_activated;
Item_Struct* m_scaledItem;
ItemData* m_scaledItem;
EvolveInfo* m_evolveInfo;
bool m_scaling;
uint32 m_ornamenticon;
+11 -22
View File
@@ -16,8 +16,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA
*/
#ifndef ITEM_STRUCT_H
#define ITEM_STRUCT_H
#ifndef COMMON_ITEM_DATA_H
#define COMMON_ITEM_DATA_H
/*
* Note: (Doodman)
@@ -35,7 +35,7 @@
*
* Note #3: (Doodman)
* Please take care when adding new found data fields to add them
* to the appropriate structure. Item_Struct has elements that are
* to the appropriate structure. ItemData has elements that are
* global to all types of items only.
*
* Note #4: (Doodman)
@@ -46,7 +46,7 @@
#include "eq_dictionary.h"
/*
** Child struct of Item_Struct:
** Child struct of ItemData:
** Effect data: Click, Proc, Focus, Worn, Scroll
**
*/
@@ -72,7 +72,7 @@ struct InternalSerializedItem_Struct {
// use EmuConstants::ITEM_COMMON_SIZE
//#define MAX_AUGMENT_SLOTS 5
struct Item_Struct {
struct ItemData {
bool IsEquipable(uint16 Race, uint16 Class) const;
// Non packet based fields
uint8 MinStatus;
@@ -99,17 +99,10 @@ struct Item_Struct {
uint32 Favor; // Individual favor
uint32 GuildFavor; // Guild favor
uint32 PointType;
//uint32 Unk117;
//uint32 Unk118;
//uint32 Unk121;
//uint32 Unk124;
uint8 BagType; // 0:Small Bag, 1:Large Bag, 2:Quiver, 3:Belt Pouch ... there are 50 types
uint8 BagSlots; // Number of slots: can only be 2, 4, 6, 8, or 10
uint8 BagSlots; // Number of slots
uint8 BagSize; // 0:TINY, 1:SMALL, 2:MEDIUM, 3:LARGE, 4:GIANT
uint8 BagWR; // 0->100
bool BenefitFlag;
bool Tradeskills; // Is this a tradeskill item?
int8 CR; // Save vs Cold
@@ -128,7 +121,6 @@ struct Item_Struct {
int32 Mana; // Mana
int32 AC; // AC
uint32 Deity; // Bitmask of Deities that can equip this item
//uint32 Unk033
int32 SkillModValue; // % Mod to skill specified in SkillModType
uint32 SkillModType; // Type of skill for SkillModValue to apply to
uint32 BaneDmgRace; // Bane Damage Race
@@ -150,13 +142,11 @@ struct Item_Struct {
uint32 Color; // RR GG BB 00 <-- as it appears in pc
uint32 Classes; // Bitfield of classes that can equip item (1 << class#)
uint32 Races; // Bitfield of races that can equip item (1 << race#)
//uint32 Unk054;
int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType; // Item Type/Skill (itemClass* from above)
uint8 Material; // Item material type
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
float SellRate; // Sell rate
//uint32 Unk059;
union {
uint32 Fulfilment; // Food fulfilment (How long it lasts)
int16 CastTime; // Cast Time for clicky effects, in milliseconds
@@ -211,7 +201,6 @@ struct Item_Struct {
int16 StackSize;
uint8 PotionBeltSlots;
ItemEffect_Struct Click, Proc, Worn, Focus, Scroll, Bard;
uint8 Book; // 0=Not book, 1=Book
uint32 BookType;
char Filename[33]; // Filename for book data
@@ -240,11 +229,11 @@ struct Item_Struct {
uint32 ScriptFileID;
uint16 ExpendableArrow;
uint32 Clairvoyance;
char ClickName[65];
char ProcName[65];
char WornName[65];
char FocusName[65];
char ScrollName[65];
char ClickName[65];
char ProcName[65];
char WornName[65];
char FocusName[65];
char ScrollName[65];
};
+19
View File
@@ -0,0 +1,19 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "item_instance.h"
+32
View File
@@ -0,0 +1,32 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_ITEM_INSTANCE_H
#define COMMON_ITEM_INSTANCE_H
namespace EQEmu
{
class ItemInstance
{
public:
private:
};
} // EQEmu
#endif
+1 -1
View File
@@ -4972,7 +4972,7 @@ namespace RoF
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem();
const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
RoF::structs::ItemSerializationHeader hdr;
+1 -1
View File
@@ -5136,7 +5136,7 @@ namespace RoF2
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem();
const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
RoF2::structs::ItemSerializationHeader hdr;
+1 -1
View File
@@ -2280,7 +2280,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
ItemData item;
uint8 iss_unknown001[6];
};*/
+1 -1
View File
@@ -2309,7 +2309,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
ItemData item;
uint8 iss_unknown001[6];
};*/
+1 -1
View File
@@ -3515,7 +3515,7 @@ namespace SoD
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem();
const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
SoD::structs::ItemSerializationHeader hdr;
hdr.stacksize = stackable ? charges : 1;
+1 -1
View File
@@ -1958,7 +1958,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
ItemData item;
uint8 iss_unknown001[6];
};*/
+1 -1
View File
@@ -2839,7 +2839,7 @@ namespace SoF
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem();
const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
SoF::structs::ItemSerializationHeader hdr;
hdr.stacksize = stackable ? charges : 1;
+1 -1
View File
@@ -1931,7 +1931,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
ItemData item;
uint8 iss_unknown001[6];
};*/
+1 -1
View File
@@ -1989,7 +1989,7 @@ namespace Titanium
int16 slot_id = ServerToTitaniumSlot(slot_id_in);
uint32 merchant_slot = inst->GetMerchantSlot();
int16 charges = inst->GetCharges();
const Item_Struct *item = inst->GetUnscaledItem();
const ItemData *item = inst->GetUnscaledItem();
int i;
uint32 sub_length;
+1 -1
View File
@@ -1687,7 +1687,7 @@ struct AdventureRequestResponse_Struct{
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
ItemData item;
uint8 iss_unknown001[6];
};*/
+2 -2
View File
@@ -3760,7 +3760,7 @@ namespace UF
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem();
const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
UF::structs::ItemSerializationHeader hdr;
hdr.stacksize = stackable ? charges : 1;
@@ -3798,7 +3798,7 @@ namespace UF
//ORNAMENT IDFILE / ICON -
uint16 ornaIcon = 0;
if (inst->GetOrnamentationAug(ornamentationAugtype)) {
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
const ItemData *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
ss.write((const char*)&null_term, sizeof(uint8));
ornaIcon = aug_weap->Icon;
+1 -1
View File
@@ -2016,7 +2016,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
ItemData item;
uint8 iss_unknown001[6];
};*/
+14 -14
View File
@@ -347,7 +347,7 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, InventoryOld* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
const Item_Struct* myitem;
const ItemData* myitem;
std::string query = StringFormat("SELECT itemid, item_charges, slot FROM starting_items "
"WHERE (race = %i or race = 0) AND (class = %i or class = 0) AND "
@@ -419,7 +419,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, InventoryOld *inv, bool is_charid)
aug[4] = (uint32)atoi(row[7]);
aug[5] = (uint32)atoi(row[8]);
const Item_Struct *item = GetItem(item_id);
const ItemData *item = GetItem(item_id);
if (!item) {
Log.Out(Logs::General, Logs::Error,
@@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, InventoryOld *inv)
uint32 ornament_idfile = (uint32)atoul(row[13]);
uint32 ornament_hero_model = (uint32)atoul(row[14]);
const Item_Struct *item = GetItem(item_id);
const ItemData *item = GetItem(item_id);
if (!item) {
Log.Out(Logs::General, Logs::Error,
@@ -662,7 +662,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, InventoryOld *i
uint32 ornament_idfile = (uint32)atoul(row[13]);
uint32 ornament_hero_model = (uint32)atoul(row[14]);
const Item_Struct *item = GetItem(item_id);
const ItemData *item = GetItem(item_id);
int16 put_slot_id = INVALID_INDEX;
if (!item)
continue;
@@ -806,12 +806,12 @@ bool SharedDatabase::LoadItems() {
if(items == -1) {
EQ_EXCEPT("SharedDatabase", "Database returned no result");
}
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<Item_Struct>::estimated_size(items, max_item));
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<ItemData>::estimated_size(items, max_item));
if(items_mmf->Size() != size) {
EQ_EXCEPT("SharedDatabase", "Couldn't load items because items_mmf->Size() != size");
}
items_hash = new EQEmu::FixedMemoryHashSet<Item_Struct>(reinterpret_cast<uint8*>(items_mmf->Get()), size);
items_hash = new EQEmu::FixedMemoryHashSet<ItemData>(reinterpret_cast<uint8*>(items_mmf->Get()), size);
mutex.Unlock();
} catch(std::exception& ex) {
Log.Out(Logs::General, Logs::Error, "Error Loading Items: %s", ex.what());
@@ -822,7 +822,7 @@ bool SharedDatabase::LoadItems() {
}
void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id) {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(reinterpret_cast<uint8*>(data), size, items, max_item_id);
EQEmu::FixedMemoryHashSet<ItemData> hash(reinterpret_cast<uint8*>(data), size, items, max_item_id);
char ndbuffer[4];
bool disableNoRent = false;
@@ -850,7 +850,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
}
}
Item_Struct item;
ItemData item;
const std::string query = "SELECT source,"
#define F(x) "`"#x"`,"
@@ -863,7 +863,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
}
for(auto row = results.begin(); row != results.end(); ++row) {
memset(&item, 0, sizeof(Item_Struct));
memset(&item, 0, sizeof(ItemData));
item.ItemClass = (uint8)atoi(row[ItemField::itemclass]);
strcpy(item.Name,row[ItemField::name]);
@@ -1078,7 +1078,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
}
const Item_Struct* SharedDatabase::GetItem(uint32 id) {
const ItemData* SharedDatabase::GetItem(uint32 id) {
if (id == 0)
{
return nullptr;
@@ -1097,7 +1097,7 @@ const Item_Struct* SharedDatabase::GetItem(uint32 id) {
return nullptr;
}
const Item_Struct* SharedDatabase::IterateItems(uint32* id) {
const ItemData* SharedDatabase::IterateItems(uint32* id) {
if(!items_hash || !id) {
return nullptr;
}
@@ -1255,7 +1255,7 @@ bool SharedDatabase::LoadNPCFactionLists() {
// Create appropriate ItemInst class
ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
{
const Item_Struct* item = nullptr;
const ItemData* item = nullptr;
ItemInst* inst = nullptr;
item = GetItem(item_id);
@@ -1282,7 +1282,7 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1,
// Create appropriate ItemInst class
ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
ItemInst* SharedDatabase::CreateItem(const ItemData* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
{
ItemInst* inst = nullptr;
if (item) {
@@ -1306,7 +1306,7 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin
return inst;
}
ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) {
ItemInst* SharedDatabase::CreateBaseItem(const ItemData* item, int16 charges) {
ItemInst* inst = nullptr;
if (item) {
// if maxcharges is -1 that means it is an unlimited use item.
+6 -6
View File
@@ -20,7 +20,7 @@ struct BaseDataStruct;
struct InspectMessage_Struct;
struct PlayerProfile_Struct;
struct SPDat_Spell_Struct;
struct Item_Struct;
struct ItemData;
struct NPCFactionList;
struct LootTable_Struct;
struct LootDrop_Struct;
@@ -82,8 +82,8 @@ class SharedDatabase : public Database
Item Methods
*/
ItemInst* CreateItem(uint32 item_id, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
ItemInst* CreateItem(const Item_Struct* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
ItemInst* CreateBaseItem(const Item_Struct* item, int16 charges = 0);
ItemInst* CreateItem(const ItemData* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
ItemInst* CreateBaseItem(const ItemData* item, int16 charges = 0);
/*
Shared Memory crap
@@ -93,8 +93,8 @@ class SharedDatabase : public Database
void GetItemsCount(int32 &item_count, uint32 &max_id);
void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id);
bool LoadItems();
const Item_Struct* IterateItems(uint32* id);
const Item_Struct* GetItem(uint32 id);
const ItemData* IterateItems(uint32* id);
const ItemData* GetItem(uint32 id);
const EvolveInfo* GetEvolveInfo(uint32 loregroup);
//faction lists
@@ -130,7 +130,7 @@ class SharedDatabase : public Database
EQEmu::MemoryMappedFile *skill_caps_mmf;
EQEmu::MemoryMappedFile *items_mmf;
EQEmu::FixedMemoryHashSet<Item_Struct> *items_hash;
EQEmu::FixedMemoryHashSet<ItemData> *items_hash;
EQEmu::MemoryMappedFile *faction_mmf;
EQEmu::FixedMemoryHashSet<NPCFactionList> *faction_hash;
EQEmu::MemoryMappedFile *loot_table_mmf;