EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
InventoryItem Class Reference

#include "InventoryItem.h"

Inheritance diagram for InventoryItem:
Collaboration diagram for InventoryItem:

Public Member Functions

 InventoryItem (uint32 _itemID, const ItemType &_type, const ItemData &_data)
 
 InventoryItem (const InventoryItem &oth)
 
 InventoryItem (InventoryItem &&oth) noexcept
 
InventoryItemoperator= (const InventoryItem &oth)=delete
 
InventoryItemoperator= (InventoryItem &&oth)=delete
 
virtual ~InventoryItem () noexcept
 
virtual ShipItemGetShipItem ()
 
virtual ModuleItemGetModuleItem ()
 
virtual bool IsShipItem ()
 
virtual bool IsModuleItem ()
 
virtual void Rename (std::string name)
 
InventoryGetMyInventory ()
 
bool contraband () const
 
bool isSingleton () const
 
int32 quantity () const
 
uint32 itemID () const
 
uint32 ownerID () const
 
uint32 locationID () const
 
EVEItemFlags flag () const
 
const GPointposition () const
 
const ItemTypetype () const
 
const std::string & itemName () const
 
const std::string & customInfo () const
 
const char * name ()
 
uint16 typeID () const
 
uint16 groupID () const
 
double radius () const
 
uint8 categoryID () const
 
bool isGlobal () const
 
bool IsOnline ()
 
void SetPosition (const GPoint &pos)
 
void SetCustomInfo (const char *ci)
 
void ChangeOwner (uint32 new_owner, bool notify=false)
 
void Move (uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
 
void Donate (uint32 new_owner=ownerSystem, uint32 new_location=locTemp, EVEItemFlags new_flag=flagNone, bool notify=true)
 
void SendItemChange (uint32 toID, std::map< int32, PyRep * > &changes)
 
void MergeTypesInCargo (ShipItem *pShip, EVEItemFlags flag=flagNone)
 
bool ChangeSingleton (bool singleton, bool notify=false)
 
bool AlterQuantity (int32 qty, bool notify=false)
 
bool SetQuantity (int32 qty, bool notify=false, bool deleteOnZero=true)
 
bool SetFlag (EVEItemFlags flag, bool notify=false)
 
void SetOwner (uint32 ownerID)
 
void SaveItem ()
 
void UpdateLocation ()
 
void UpdateLocation (uint32 locID)
 
virtual void Delete ()
 
virtual InventoryItemRef Split (int32 qty=0, bool notify=true, bool silent=false)
 
virtual bool Merge (InventoryItemRef to_merge, int32 qty=0, bool notify=true)
 
virtual void Relocate (uint32 locID=0, EVEItemFlags flag=flagNone)
 
virtual void AddItem (InventoryItemRef iRef)
 
virtual void RemoveItem (InventoryItemRef iRef)
 
double GetPackagedVolume ()
 
virtual void SetPlayer (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 
void ToVirtual (uint32 locationID)
 
virtual bool _Load ()
 
PyRepGetItem () const
 
void GetItemRow (PyPackedRow *into) const
 
void GetItemStatusRow (PyPackedRow *into) const
 
void GetChargeStatusRow (uint32 shipID, PyPackedRow *into) const
 
bool Populate (Rsp_CommonGetInfo_Entry &into)
 
PyListGetItemInfo () const
 
PyObjectItemGetInfo ()
 
PyPackedRowGetItemRow () const
 
PyPackedRowGetItemStatusRow () const
 
PyPackedRowGetChargeStatusRow (uint32 shipID) const
 
bool SkillCheck (InventoryItemRef refItem)
 
void ClearModifiers ()
 
void AddModifier (fxData &data)
 
void RemoveModifier (fxData &data)
 
void ResetAttributes ()
 
bool HasReqSkill (const uint16 skillID)
 
AttributeMapGetAttributeMap ()
 
int64 GetTimeStamp ()
 
void SetAttribute (uint16 attrID, int num, bool notify=true)
 
void SetAttribute (uint16 attrID, uint32 num, bool notify=true)
 
void SetAttribute (uint16 attrID, int64 num, bool notify=true)
 
void SetAttribute (uint16 attrID, float num, bool notify=true)
 
void SetAttribute (uint16 attrID, double num, bool notify=true)
 
void SetAttribute (uint16 attrID, EvilNumber num, bool notify=true)
 
void MultiplyAttribute (uint16 attrID, EvilNumber num, bool notify=false)
 
bool HasAttribute (const uint16 attrID) const
 
bool HasAttribute (const uint16 attrID, EvilNumber &value) const
 
bool SaveAttributes ()
 
void ResetAttribute (uint16 attrID, bool notify=false)
 
void DeleteAttribute (uint16 attrID)
 
EvilNumber GetAttribute (const uint16 attrID) const
 
EvilNumber GetDefaultAttribute (const uint16 attrID) const
 
- Public Member Functions inherited from RefObject
 RefObject (size_t initRefCount)
 Initializes reference count. More...
 
virtual ~RefObject ()
 Destructor; must be virtual. More...
 
size_t GetCount ()
 

Static Public Member Functions

static uint32 CreateItemID (ItemData &data)
 
static uint32 CreateTempItemID (ItemData &data)
 
static InventoryItemRef Load (uint32 itemID)
 
static InventoryItemRef SpawnItem (uint32 itemID, const ItemData &data)
 
static InventoryItemRef Spawn (ItemData &data)
 
static InventoryItemRef SpawnTemp (ItemData &data)
 

Public Attributes

std::multimap< int8, fxDatam_modifiers
 

Static Protected Member Functions

template<class _Ty >
static RefPtr< _Ty > Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 itemID, const ItemType &type, const ItemData &data)
 

Protected Attributes

InventorypInventory
 
uint32 m_itemID
 
AttributeMappAttributeMap
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Private Attributes

bool m_delete
 
ItemData m_data
 
ItemType m_type
 
int64 m_timestamp
 

Additional Inherited Members

- Protected Member Functions inherited from RefObject
void IncRef () const
 Increments reference count of object by one. More...
 
void DecRef () const
 Decrements reference count of object by one. More...
 

Detailed Description

Definition at line 63 of file InventoryItem.h.

Constructor & Destructor Documentation

InventoryItem::InventoryItem ( uint32  _itemID,
const ItemType _type,
const ItemData _data 
)

Definition at line 50 of file InventoryItem.cpp.

References _log, ItemType::id(), m_data, m_itemID, m_modifiers, ItemData::name, and ItemData::typeID.

Referenced by _LoadItem(), and SpawnItem().

51 : RefObject(0),
52 pAttributeMap(new AttributeMap(*this)),
53 pInventory(nullptr), // this is created/destroyed in derived classes as needed.
54 m_data(_data),
55 m_type(_type),
56 m_itemID(_itemID),
57 m_timestamp(0), // placeholder for fx timestamp, once implemented
58 m_delete(false)
59 {
60  // assert for data consistency
61  assert(_data.typeID == _type.id());
62  m_modifiers.clear();
63 
64  _log(ITEM__TRACE, "II::C'tor - Created Generic Item %p for item %s (%u).", this, m_data.name.c_str(), m_itemID);
65 }
#define _log(type, fmt,...)
Definition: logsys.h:124
uint16 id() const
Definition: ItemType.h:63
ItemType m_type
ItemData m_data
Inventory * pInventory
std::multimap< int8, fxData > m_modifiers
uint16 typeID
Definition: ItemType.h:188
RefObject(size_t initRefCount)
Initializes reference count.
Definition: RefPtr.h:59
AttributeMap * pAttributeMap
std::string name
Definition: ItemType.h:193

Here is the call graph for this function:

Here is the caller graph for this function:

InventoryItem::InventoryItem ( const InventoryItem oth)

Definition at line 68 of file InventoryItem.cpp.

References sLog, and EvE::traceStack().

69 : RefObject(0),
72 m_itemID(oth.m_itemID),
73 m_data(oth.m_data),
74 m_type(oth.m_type),
76 m_delete(false)
77 {
78  sLog.Error("InventoryItem()", "InventoryItem copy c'tor called.");
80  assert(0);
81 }
ItemType m_type
ItemData m_data
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Inventory * pInventory
RefObject(size_t initRefCount)
Initializes reference count.
Definition: RefPtr.h:59
void traceStack(void)
Definition: misc.cpp:169
AttributeMap * pAttributeMap

Here is the call graph for this function:

InventoryItem::InventoryItem ( InventoryItem &&  oth)
noexcept

Definition at line 84 of file InventoryItem.cpp.

References sLog, and EvE::traceStack().

85 : RefObject(0),
88 m_itemID(oth.m_itemID),
89 m_data(oth.m_data),
90 m_type(oth.m_type),
92 m_delete(false)
93 {
94  sLog.Error("InventoryItem()", "InventoryItem move c'tor called.");
96  assert(0);
97 }
ItemType m_type
ItemData m_data
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Inventory * pInventory
RefObject(size_t initRefCount)
Initializes reference count.
Definition: RefPtr.h:59
void traceStack(void)
Definition: misc.cpp:169
AttributeMap * pAttributeMap

Here is the call graph for this function:

InventoryItem::~InventoryItem ( )
virtualnoexcept

Definition at line 128 of file InventoryItem.cpp.

References pAttributeMap, and SafeDelete().

129 {
131 }
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
AttributeMap * pAttributeMap

Here is the call graph for this function:

Member Function Documentation

bool InventoryItem::_Load ( )
virtual

Reimplemented in Character, WreckContainer, ShipItem, SolarSystem, StationItem, CargoContainer, StructureItem, and ModuleItem.

Definition at line 207 of file InventoryItem.cpp.

References _log, AttributeMap::Load(), m_data, m_itemID, ItemData::name, and pAttributeMap.

Referenced by ModuleItem::_Load(), StructureItem::_Load(), CargoContainer::_Load(), StationItem::_Load(), SolarSystem::_Load(), ShipItem::_Load(), WreckContainer::_Load(), Character::_Load(), and SpawnItem().

207  {
208  if (!pAttributeMap->Load()) {
209  _log(ITEM__WARNING, "II::_Load() - Failed to load attribute map for %s(%u).", m_data.name.c_str(), m_itemID);
210  return false;
211  }
212 
213  return true;
214 }
#define _log(type, fmt,...)
Definition: logsys.h:124
ItemData m_data
bool Load(bool reset=false)
AttributeMap * pAttributeMap
std::string name
Definition: ItemType.h:193

Here is the call graph for this function:

Here is the caller graph for this function:

template<class _Ty >
static RefPtr<_Ty> InventoryItem::_Load ( uint32  itemID)
inlinestaticprotected

Definition at line 241 of file InventoryItem.h.

References ItemDB::GetItem(), itemID(), sItemFactory, type(), and ItemData::typeID.

242  {
243  // pull the specific item info from db
244  ItemData data;
245  if (!ItemDB::GetItem(itemID, data))
246  return RefPtr<_Ty>();
247 
248  // obtain type
249  const ItemType *type = sItemFactory.GetType( data.typeID );
250  if( type == nullptr )
251  return RefPtr<_Ty>();
252 
253  return _Ty::template _LoadItem<_Ty>( itemID, *type, data );
254  }
const ItemType & type() const
uint16 typeID
Definition: ItemType.h:188
#define sItemFactory
Definition: ItemFactory.h:165
static bool GetItem(uint32 itemID, ItemData &into)
Definition: ItemDB.cpp:32
uint32 itemID() const
Definition: InventoryItem.h:98
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

template<class _Ty >
RefPtr< _Ty > InventoryItem::_LoadItem ( uint32  itemID,
const ItemType type,
const ItemData data 
)
staticprotected

Definition at line 217 of file InventoryItem.cpp.

References _log, EVEDB::invCategories::_System, EVEDB::invCategories::Accessories, EVEDB::invCategories::Asteroid, EVEDB::invGroups::Audit_Log_Secure_Container, EVEDB::invGroups::Billboard, EVEDB::invCategories::Blueprint, EVEDB::invCategories::Bonus, EVEDB::invGroups::Cargo_Container, ItemType::categoryID(), EVEDB::invCategories::Celestial, EVEDB::invCategories::Charge, EVEDB::invCategories::Commodity, EVEDB::invGroups::Concord_Drone, EVEDB::invGroups::Convoy, EVEDB::invGroups::Convoy_Drone, EVEDB::invGroups::Customs_Official, EVEDB::invGroups::Deadspace_Sleeper_Awakened_Sentinel, EVEDB::invGroups::Deadspace_Sleeper_Emergent_Sentinel, EVEDB::invGroups::Deadspace_Sleeper_Sleepless_Sentinel, EVEDB::invCategories::Deployable, EVEDB::invGroups::Destructible_Sentry_Gun, EVEDB::invCategories::Drone, EVEDB::invGroups::Drones, EVEDB::invCategories::Entity, EVEDB::invGroups::Force_Field, EVEDB::invGroups::Freight_Container, ItemType::groupID(), ItemType::id(), EVEDB::invCategories::Implant, EVEDB::invGroups::Incursion_Sanshas_Nation_Battleship, EVEDB::invGroups::Incursion_Sanshas_Nation_Capital, EVEDB::invGroups::Incursion_Sanshas_Nation_Cruiser, EVEDB::invGroups::Incursion_Sanshas_Nation_Frigate, EVEDB::invGroups::Incursion_Sanshas_Nation_Industrial, InventoryItem(), IsAsteroidID, itemID(), EVEDB::invCategories::Material, EVEDB::invGroups::Mission_Container, EVEDB::invGroups::Mobile_Sentry_Gun, EVEDB::invCategories::Module, EVEDB::invGroups::Obsolete_Probes, EVEDB::invCategories::Orbitals, EVEDB::invCategories::Owner, EVEDB::invGroups::Pirate_Drone, EVEDB::invCategories::PlanetaryCommodities, EVEDB::invCategories::PlanetaryInteraction, EVEDB::invCategories::PlanetaryResources, EVEDB::invGroups::Police_Drone, EVEDB::invGroups::Protective_Sentry_Gun, EVEDB::invCategories::Reaction, EVEDB::invGroups::Scanner_Probe, EVEDB::invGroups::Secure_Cargo_Container, EVEDB::invGroups::Sentry_Gun, EVEDB::invCategories::Ship, EVEDB::invCategories::Skill, EVEDB::invGroups::Solar_System, EVEDB::invCategories::SovereigntyStructure, EVEDB::invGroups::Spawn_Container, EVEDB::invCategories::Station, EVEDB::invGroups::Station, EVEDB::invGroups::Storyline_Battleship, EVEDB::invGroups::Storyline_Cruiser, EVEDB::invGroups::Storyline_Frigate, EVEDB::invGroups::Storyline_Mission_Battleship, EVEDB::invGroups::Storyline_Mission_Cruiser, EVEDB::invGroups::Storyline_Mission_Frigate, EVEDB::invCategories::Structure, EVEDB::invCategories::StructureUpgrade, EVEDB::invCategories::Subsystem, EVEDB::invGroups::Survey_Probe, EVEDB::invGroups::Temporary_Cloud, EVEDB::invCategories::Trading, EVEDB::invGroups::Tutorial_Drone, type(), EVEDB::invGroups::Warp_Disruption_Probe, and EVEDB::invGroups::Wreck.

217  {
218  switch(type.categoryID() ) {
220  case EVEDB::invCategories::Material: // includes minerals
227  case EVEDB::invCategories::Accessories: { // this is for bookmark vouchers
228  // Generic item, create one
229  return InventoryItemRef(new InventoryItem(itemID, type, data ));
230  } break;
231  case EVEDB::invCategories::Deployable: // these may need their own class. not sure yet
235  // create Generic item for now
236  return InventoryItemRef(new InventoryItem(itemID, type, data ));
237  } break;
240  return ModuleItem::_LoadItem<ModuleItem>(itemID, type, data);
241  } break;
243  return Character::_LoadItem<Character>(itemID, type, data);
244  } break;
246  return Skill::_LoadItem<Skill>(itemID, type, data);
247  } break;
249  return Blueprint::_LoadItem<Blueprint>(itemID, type, data);
250  } break;
252  if (IsAsteroidID(itemID))
253  return AsteroidItem::_LoadItem<AsteroidItem>(itemID, type, data);
254  // mined ore. create default item
255  return InventoryItemRef(new InventoryItem(itemID, type, data ));
256  } break;
258  return ShipItem::_LoadItem<ShipItem>(itemID, type, data);
259  } break;
264  return StructureItem::_LoadItem<StructureItem>(itemID, type, data);
265  } break;
266  case EVEDB::invCategories::Charge: { // probes are charges.
267  switch (type.groupID()) {
271  case EVEDB::invGroups::Obsolete_Probes: { // make error for these?
272  return ProbeItem::_LoadItem<ProbeItem>(itemID, type, data);
273  } break;
274  default: {
275  // create generic item for other charge types
276  return InventoryItemRef(new InventoryItem(itemID, type, data ));
277  } break;
278  }
279  } break;
281  // test for office first
282  if (type.id() == 27) {
283  return StationOffice::_LoadItem<StationOffice>(itemID, type, data);
284  } else if (type.groupID() != EVEDB::invGroups::Station) {
285  return StationItem::_LoadItem<StationItem>(itemID, type, data);
286  }/* else if (type.groupID() != EVEDB::invGroups::Station_Services) {
287  this isnt written yet...
288  } */
289  } break;
291  switch (type.groupID()) {
293  return SolarSystem::_LoadItem<SolarSystem>(itemID, type, data);
294  } break;
300  return CargoContainer::_LoadItem<CargoContainer>(itemID, type, data);
301  } break;
303  return WreckContainer::_LoadItem<WreckContainer>(itemID, type, data);
304  } break;
306  default: {
307  // generic Celestial Object
308  return CelestialObject::_LoadItem<CelestialObject>(itemID, type, data);
309  } break;
310  }
311  } break;
312  // there are 216 groups in the entity category. im not testing all of them.
314  switch (type.groupID()) {
316  return CargoContainer::_LoadItem<CargoContainer>(itemID, type, data);
317  } break;
319  return CelestialObject::_LoadItem<CelestialObject>(itemID, type, data);
320  } break;
322  // the rest are drones and npcs....i think
323  // they are *somewhat* separated for eventual classification into their own itemtypes
326  // added checks for all npc's -allan 26Dec14
331 
336 
339 
346 
350  /* start at EVEDB::invGroups::Deadspace_Sleeper_Sleepless_Defender:
351  end at EVEDB::invGroups::Deadspace_Sleeper_Emergent_Patroller:
352  */
358  _log(ITEM__WARNING, "item %u (type %u, group %u) defaulting to generic InventoryItem.", itemID, type.id(), type.groupID());
359  } break;
360  default: {
361  _log(ITEM__WARNING, "item %u (type %u, group %u, cat %u) is not handled in II::_LoadItem::Entity.", itemID, type.id(), type.groupID(), type.categoryID());
362  }
363  }
364  }
365  default: {
366  _log(ITEM__WARNING, "item %u (type %u, group %u, cat %u) is not handled in II::_LoadItem.", itemID, type.id(), type.groupID(), type.categoryID());
367  } break;
368  }
369  // Generic item, create one:
370  return InventoryItemRef(new InventoryItem(itemID, type, data ));
371 }
#define IsAsteroidID(itemID)
Definition: EVE_Defines.h:259
#define _log(type, fmt,...)
Definition: logsys.h:124
uint16 id() const
Definition: ItemType.h:63
uint16 groupID() const
Definition: ItemType.h:64
uint8 categoryID() const
Definition: ItemType.h:66
const ItemType & type() const
InventoryItem(uint32 _itemID, const ItemType &_type, const ItemData &_data)
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void InventoryItem::AddItem ( InventoryItemRef  iRef)
virtual

Reimplemented in Character, ShipItem, StructureItem, and StationOffice.

Definition at line 566 of file InventoryItem.cpp.

References Inventory::AddItem(), and pInventory.

Referenced by StationOffice::AddItem(), StructureItem::AddItem(), ShipItem::AddItem(), Character::AddItem(), SolarSystem::AddItemToInventory(), Donate(), SystemEntity::DropLoot(), Move(), InventoryBound::MoveItems(), and Relocate().

567 {
568  // make error for invalid inventory?
569  // only happens on char creation, when system isnt loaded yet, so we really dont need it.
570  if (pInventory != nullptr)
571  pInventory->AddItem(iRef);
572 }
void AddItem(InventoryItemRef iRef)
Definition: Inventory.cpp:203
Inventory * pInventory

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::AddModifier ( fxData data)

Definition at line 1464 of file InventoryItem.cpp.

References m_modifiers, and fxData::math.

Referenced by FxProc::ParseExpression().

1465 {
1466  m_modifiers.emplace(data.math, data);
1467 }
std::multimap< int8, fxData > m_modifiers
int8 math
Definition: EffectsData.h:70

Here is the caller graph for this function:

bool InventoryItem::AlterQuantity ( int32  qty,
bool  notify = false 
)

Definition at line 924 of file InventoryItem.cpp.

References _log, codelog, Delete(), m_data, m_itemID, ItemData::name, ItemData::ownerID, ItemData::quantity, SetQuantity(), and EvE::traceStack().

Referenced by ActiveModule::ConsumeCharge(), ActiveModule::DoCycle(), MarketMgr::ExecuteBuyOrder(), Merge(), Client::RemoveMissionItem(), and Split().

924  {
925  if (qty == 0) {
926  _log(ITEM__WARNING, "II::AlterQuantity() - Sent qty=0 for %s(%u)", m_data.name.c_str(), m_itemID);
927  EvE::traceStack();
928  return false;
929  }
930 
931  int32 new_qty = m_data.quantity + qty;
932  if (new_qty < 0) {
933  codelog(ITEM__ERROR, "II::AlterQuantity() - %s(%u): Tried to remove %i from stack of %i for ownerID %u.", \
934  m_data.name.c_str(), m_itemID, qty, m_data.quantity, m_data.ownerID);
935  // make player error msg here.....
936  Delete();
937  return false;
938  }
939 
940  return SetQuantity(new_qty, notify);
941 }
bool SetQuantity(int32 qty, bool notify=false, bool deleteOnZero=true)
#define _log(type, fmt,...)
Definition: logsys.h:124
ItemData m_data
signed __int32 int32
Definition: eve-compat.h:49
#define codelog(type, fmt,...)
Definition: logsys.h:128
uint32 quantity
Definition: ItemType.h:191
uint32 ownerID
Definition: ItemType.h:189
void traceStack(void)
Definition: misc.cpp:169
virtual void Delete()
std::string name
Definition: ItemType.h:193

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::ChangeOwner ( uint32  new_owner,
bool  notify = false 
)

Definition at line 1035 of file InventoryItem.cpp.

References m_data, Inv::Update::Owner, ItemData::ownerID, SaveItem(), sConfig, and SendItemChange().

Referenced by SystemEntity::Abandon(), TradeBound::ExchangeItems(), DroneSE::SetOwner(), and Client::SetShip().

1035  {
1036  if (new_owner == m_data.ownerID)
1037  return; //nothing to do...
1038 
1039  uint32 old_owner = m_data.ownerID;
1040  m_data.ownerID = new_owner;
1041 
1042  if (sConfig.world.saveOnUpdate)
1043  SaveItem();
1044 
1045  //notify about the changes.
1046  if (notify) {
1047  std::map<int32, PyRep *> changes;
1048  //send the notify to the new owner.
1049  changes[Inv::Update::Owner] = new PyInt(old_owner);
1050  SendItemChange(new_owner, changes); //changes is consumed
1051  //also send the notify to the old owner.
1052  changes[Inv::Update::Owner] = new PyInt(old_owner);
1053  SendItemChange(old_owner, changes); //changes is consumed
1054  }
1055 }
#define sConfig
A macro for easier access to the singleton.
void SendItemChange(uint32 toID, std::map< int32, PyRep * > &changes)
ItemData m_data
Python integer.
Definition: PyRep.h:231
unsigned __int32 uint32
Definition: eve-compat.h:50
uint32 ownerID
Definition: ItemType.h:189

Here is the call graph for this function:

Here is the caller graph for this function:

bool InventoryItem::ChangeSingleton ( bool  singleton,
bool  notify = false 
)

Definition at line 1006 of file InventoryItem.cpp.

References _log, AttrVolume, GetPackagedVolume(), m_data, m_itemID, ItemData::name, ItemData::ownerID, ItemData::quantity, SaveItem(), sConfig, SendItemChange(), SetAttribute(), Inv::Update::Singleton, and ItemData::singleton.

Referenced by ShipItem::AddItemByFlag(), ModuleManager::AddModule(), Colony::CreatePin(), ShipSE::LaunchDrone(), TowerSE::Scoop(), StructureSE::Scoop(), and Skill::VerifyAttribs().

1006  {
1007  if (singleton == m_data.singleton)
1008  return true; //nothing to do...
1009 
1010  bool old_singleton = m_data.singleton;
1011  m_data.singleton = singleton;
1012 
1013  //verify quantity is -1 for singletons
1014  if (m_data.singleton)
1015  if (m_data.quantity > 1) {
1016  _log(ITEM__WARNING, "%s(%u) is changing singleton to %s and qty is currently %u", \
1017  m_data.name.c_str(), m_itemID, singleton?"On":"Off");
1018  m_data.quantity = -1;
1019  }
1020 
1021  if (sConfig.world.saveOnUpdate)
1022  SaveItem();
1023 
1024  if (notify) {
1025  std::map<int32, PyRep *> changes;
1026  changes[Inv::Update::Singleton] = new PyInt(old_singleton);
1027  SendItemChange(m_data.ownerID, changes); //changes is consumed
1028  }
1029 
1030  // must update volume when singleton (packaged state) changes for (mostly) ship items.
1032  return true;
1033 }
#define sConfig
A macro for easier access to the singleton.
void SendItemChange(uint32 toID, std::map< int32, PyRep * > &changes)
#define _log(type, fmt,...)
Definition: logsys.h:124
ItemData m_data
double GetPackagedVolume()
Python integer.
Definition: PyRep.h:231
void SetAttribute(uint16 attrID, int num, bool notify=true)
uint32 quantity
Definition: ItemType.h:191
uint32 ownerID
Definition: ItemType.h:189
std::string name
Definition: ItemType.h:193
bool singleton
Definition: ItemType.h:186

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::ClearModifiers ( )

Definition at line 1485 of file InventoryItem.cpp.

References _log, m_data, m_modifiers, and ItemData::name.

Referenced by FxProc::ApplyEffects(), ShipItem::ProcessEffects(), ActiveModule::ReprocessCharge(), Character::ResetModifiers(), and ActiveModule::UnloadCharge().

1486 {
1487  _log(EFFECTS__TRACE, "Clearing modifier map for %s", m_data.name.c_str());
1488  m_modifiers.clear();
1489 }
#define _log(type, fmt,...)
Definition: logsys.h:124
ItemData m_data
std::multimap< int8, fxData > m_modifiers
std::string name
Definition: ItemType.h:193

Here is the caller graph for this function:

bool InventoryItem::contraband ( ) const
inline

Definition at line 95 of file InventoryItem.h.

References ItemData::contraband, and m_data.

95 { return m_data.contraband; }
ItemData m_data
bool contraband
Definition: ItemType.h:185
uint32 InventoryItem::CreateItemID ( ItemData data)
static

Definition at line 152 of file InventoryItem.cpp.

References _log, codelog, is_log_enabled, ItemData::locationID, ItemType::name(), ItemData::name, ItemDB::NewItem(), sItemFactory, EvE::traceStack(), and ItemData::typeID.

Referenced by ProbeItem::CreateItemID(), CelestialObject::CreateItemID(), CargoContainer::CreateItemID(), StationItem::CreateItemID(), Blueprint::CreateItemID(), WreckContainer::CreateItemID(), ShipItem::CreateItemID(), ModuleItem::Spawn(), StructureItem::Spawn(), ShipItem::Spawn(), Skill::Spawn(), and Spawn().

152  {
153  // obtain type of new item
154  const ItemType *iType = sItemFactory.GetType(data.typeID);
155  if (iType == nullptr) {
156  codelog(ITEM__ERROR, "II::CreateItemID() - Invalid type returned for typeID %u", data.typeID);
157  return 0;
158  }
159  // fix the name (if empty)
160  if (data.name.empty())
161  data.name = iType->name();
162 
163  if (data.locationID == 0)
164  if (is_log_enabled(ITEM__MESSAGE)) {
165  _log(ITEM__MESSAGE, "II::CreateItemID() - LocationID = 0 for item");
166  EvE::traceStack();
167  }
168 
169  // insert new entry into DB
170  return ItemDB::NewItem(data);
171 }
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 locationID
Definition: ItemType.h:190
#define is_log_enabled(type)
Definition: logsys.h:78
#define codelog(type, fmt,...)
Definition: logsys.h:128
static uint32 NewItem(const ItemData &data)
Definition: ItemDB.cpp:183
const std::string & name() const
Definition: ItemType.h:74
uint16 typeID
Definition: ItemType.h:188
void traceStack(void)
Definition: misc.cpp:169
#define sItemFactory
Definition: ItemFactory.h:165
std::string name
Definition: ItemType.h:193

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 InventoryItem::CreateTempItemID ( ItemData data)
static

Definition at line 183 of file InventoryItem.cpp.

References ItemType::categoryID(), codelog, EVEDB::invCategories::Entity, ItemData::flag, flagMissile, ItemType::name(), ItemData::name, sItemFactory, and ItemData::typeID.

Referenced by Spawn(), CargoContainer::SpawnTemp(), and SpawnTemp().

183  {
184  // obtain type of new item
185  // this also checks that the type is valid
186  const ItemType *iType = sItemFactory.GetType(data.typeID);
187  if (iType == nullptr) {
188  codelog(ITEM__ERROR, "II::CreateTempItemID() - Invalid ItemType returned for typeID %u", data.typeID);
189  return 0;
190  }
191 
192  // fix the name if empty
193  if (data.name.empty())
194  data.name = iType->name();
195 
196  // Get a new Entity ID from ItemFactory's ID Authority:
197  // may need more testing to verify that ONLY NPC's and jetcan markers use this method
199  return sItemFactory.GetNextNPCID();
200 
201  if (data.flag == EVEItemFlags::flagMissile)
202  return sItemFactory.GetNextMissileID();
203 
204  return sItemFactory.GetNextTempID();
205 }
uint8 categoryID() const
Definition: ItemType.h:66
#define codelog(type, fmt,...)
Definition: logsys.h:128
const std::string & name() const
Definition: ItemType.h:74
uint16 typeID
Definition: ItemType.h:188
EVEItemFlags flag
Definition: ItemType.h:187
#define sItemFactory
Definition: ItemFactory.h:165
std::string name
Definition: ItemType.h:193

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& InventoryItem::customInfo ( ) const
inline

Definition at line 105 of file InventoryItem.h.

References ItemData::customInfo, and m_data.

Referenced by CustomsSE::CustomsSE(), Prospector::DropSalvage(), BubbleManager::GetBubbleCenterMarkers(), and SaveItem().

105 { return m_data.customInfo; }
ItemData m_data
std::string customInfo
Definition: ItemType.h:194

Here is the caller graph for this function:

void InventoryItem::Delete ( )
virtual

Reimplemented in Character, WreckContainer, Blueprint, ShipItem, CelestialObject, CargoContainer, StructureItem, and ProbeItem.

Definition at line 580 of file InventoryItem.cpp.

References _log, ItemDB::DeleteItem(), flagNone, RefPtr< X >::get(), GetMyInventory(), IsNPCCorp, IsValidLocation, ItemData::locationID, locJunkyard, m_data, m_delete, m_itemID, Move(), ItemData::name, ItemData::ownerID, Inventory::RemoveItem(), and sItemFactory.

Referenced by Colony::AbandonColony(), AlterQuantity(), TurretModule::ApplyDamage(), Command_unspawn(), StructureItem::Delete(), CargoContainer::Delete(), CelestialObject::Delete(), ShipItem::Delete(), Blueprint::Delete(), WreckContainer::Delete(), Character::Delete(), SystemEntity::Delete(), RigModule::DestroyRig(), MarketMgr::ExecuteBuyOrder(), MiningLaser::ProcessCycle(), DroneSE::RemoveDrone(), Client::RemoveMissionItem(), NPC::RemoveNPC(), Sentry::RemoveSentry(), SetQuantity(), and SystemManager::UnloadSystem().

581 {
582  m_delete = true;
583 
584  // get out of client's sight.
585  if (!IsNPCCorp(m_data.ownerID) and (m_data.ownerID > 1)) {
586  Move(locJunkyard, flagNone, true);
587  } else {
588  // remove from current container's inventory
591  if (iRef.get() != nullptr) {
593  } else {
594  _log(ITEM__ERROR, "II::Delete() - Cant find location %u containing %s.", m_data.locationID, m_data.name.c_str());
595  }
596  }
597  }
598 
599  // remove from DB
601  // remove from factory cache
602  sItemFactory.RemoveItem(m_itemID);
603 }
#define IsNPCCorp(itemID)
Definition: EVE_Defines.h:238
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 locationID
Definition: ItemType.h:190
ItemData m_data
void RemoveItem(InventoryItemRef iRef)
Definition: Inventory.cpp:243
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
X * get() const
Definition: RefPtr.h:213
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
static bool DeleteItem(uint32 itemID)
Definition: ItemDB.cpp:348
uint32 ownerID
Definition: ItemType.h:189
#define sItemFactory
Definition: ItemFactory.h:165
Inventory * GetMyInventory()
Definition: InventoryItem.h:91
std::string name
Definition: ItemType.h:193
#define IsValidLocation(itemID)
Definition: EVE_Defines.h:209

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::DeleteAttribute ( uint16  attrID)
inline

Definition at line 321 of file InventoryItem.h.

References AttributeMap::DeleteAttribute(), and pAttributeMap.

321 { pAttributeMap->DeleteAttribute(attrID); }
void DeleteAttribute(uint16 attrID)
AttributeMap * pAttributeMap

Here is the call graph for this function:

void InventoryItem::Donate ( uint32  new_owner = ownerSystem,
uint32  new_location = locTemp,
EVEItemFlags  new_flag = flagNone,
bool  notify = true 
)

Definition at line 667 of file InventoryItem.cpp.

References _log, AddItem(), Inv::Update::Flag, ItemData::flag, RefPtr< X >::get(), IsValidLocation, IsValidOwner, Inv::Update::Location, ItemData::locationID, m_data, ItemData::name, Inv::Update::Owner, ItemData::ownerID, RemoveItem(), SaveItem(), SendItemChange(), and sItemFactory.

Referenced by MarketMgr::ExecuteBuyOrder(), MarketMgr::ExecuteSellOrder(), and InventoryBound::MoveItems().

668 {
669  if (!IsValidOwner(new_owner)) {
670  _log(ITEM__ERROR, "II::Donate() - %u is invalid owner", new_owner);
671  return;
672  }
673 
674  if (!IsValidLocation(new_location)) {
675  _log(ITEM__ERROR, "II::Donate() - %u is invalid location", new_location);
676  return;
677  }
678 
679  if ((new_location == m_data.locationID) and (new_flag == m_data.flag) and (new_owner == m_data.ownerID) and !notify)
680  return; //nothing to do...
681 
682  InventoryItemRef iRef(nullptr);
683  uint32 old_location = m_data.locationID, old_owner = m_data.ownerID;
684  EVEItemFlags old_flag = m_data.flag;
685 
686  if ((new_location != m_data.locationID) // diff container
687  or ((new_location == m_data.locationID) // or same container
688  and (new_flag != m_data.flag))) { // but different flag
689  // remove from current location
691  iRef = sItemFactory.GetItem(m_data.locationID);
692  if (iRef.get() != nullptr) {
693  iRef->RemoveItem(InventoryItemRef(this));
694  } else {
695  _log(ITEM__ERROR, "II::Donate() - Cant find location %u containing %s.", m_data.locationID, m_data.name.c_str());
696  }
697  }
698  }
699 
700  // update data
701  m_data.flag = new_flag;
702  m_data.ownerID = new_owner;
703  m_data.locationID = new_location;
704 
705  if ((old_location != m_data.locationID) // diff container
706  or ((old_location == m_data.locationID) // or same container
707  and (old_flag != m_data.flag))) { // but different flag
708  // add to new location
709  iRef = sItemFactory.GetItem(m_data.locationID);
710  if (iRef.get() != nullptr) {
711  iRef->AddItem(InventoryItemRef(this));
712  } else {
713  _log(ITEM__ERROR, "II::Donate() - Cant find location %u containing %s.", m_data.locationID, m_data.name.c_str());
714  }
715  }
716 
717  SaveItem();
718  //ItemDB::UpdateLocation(m_itemID, m_data.locationID, m_data.flag);
719 
720  // changes are cleared after sending, so make 2 sets to send to old owner and new owner
721  if (notify) {
722  std::map<int32, PyRep *> changes;
723  if (new_flag != old_flag)
724  changes[Inv::Update::Flag] = new PyInt(old_flag);
725  if (new_owner != old_owner)
726  changes[Inv::Update::Owner] = new PyInt(old_owner);
727  if (new_location != old_location)
728  changes[Inv::Update::Location] = new PyInt(old_location);
729  SendItemChange(m_data.ownerID, changes);
730  if (new_owner != old_owner) {
731  if (new_flag != old_flag)
732  changes[Inv::Update::Flag] = new PyInt(old_flag);
733  if (new_owner != old_owner)
734  changes[Inv::Update::Owner] = new PyInt(old_owner);
735  if (new_location != old_location)
736  changes[Inv::Update::Location] = new PyInt(old_location);
737  SendItemChange(old_owner, changes);
738  }
739  }
740 }
void SendItemChange(uint32 toID, std::map< int32, PyRep * > &changes)
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 locationID
Definition: ItemType.h:190
EVEItemFlags
Definition: EVE_Flags.h:13
ItemData m_data
Python integer.
Definition: PyRep.h:231
unsigned __int32 uint32
Definition: eve-compat.h:50
EVEItemFlags flag
Definition: ItemType.h:187
#define IsValidOwner(itemID)
Definition: EVE_Defines.h:214
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
uint32 ownerID
Definition: ItemType.h:189
#define sItemFactory
Definition: ItemFactory.h:165
std::string name
Definition: ItemType.h:193
#define IsValidLocation(itemID)
Definition: EVE_Defines.h:209

Here is the call graph for this function:

Here is the caller graph for this function:

EvilNumber InventoryItem::GetAttribute ( const uint16  attrID) const
inline

Definition at line 323 of file InventoryItem.h.

References AttributeMap::GetAttribute(), and pAttributeMap.

Referenced by Concord::_UpdateDamage(), ShipSE::AbandonDrones(), Prospector::Activate(), StructureSE::Activate(), ShipItem::AddItem(), ModuleManager::AddModule(), ModuleManager::addModuleRef(), AnomalyMgr::AddSignal(), Character::AddToSkillQueue(), ShipSE::ApplyBoost(), TurretModule::ApplyDamage(), SystemEntity::ApplyDamage(), DroneAIMgr::AttackTarget(), NPCAIMgr::AttackTarget(), ConcordAI::AttackTarget(), DynamicSystemEntity::AwardBounty(), SystemEntity::AwardSecurityStatus(), ReprocessingServiceBound::CalcReprocessingEfficiency(), RamMethods::Calculate(), MiningLaser::CanActivate(), ActiveModule::CanActivate(), Character::CancelSkillInTraining(), Command_cargo(), Concord::Concord(), ConcordAI::ConcordAI(), TowerSE::CreateForceField(), Colony::CreatePin(), Damage::Damage(), ModuleManager::deleteModuleRef(), ActiveModule::DoCycle(), DroneSE::DroneSE(), Skill::FitModuleSkillCheck(), ShipItem::GenerateHeat(), GenericModule::GetAttribute(), ModuleManager::GetAvailableSlotInBank(), Skill::GetCurrentSP(), TurretFormulas::GetDroneToHit(), GetItemStatusRow(), Skill::GetLevelForSP(), PIDataMgr::GetMaxOutput(), TurretFormulas::GetNPCToHit(), PIDataMgr::GetProgramResultInfo(), Skill::GetRemainingSP(), TurretFormulas::GetSentryToHit(), ShipItem::GetShipArmorHP(), ShipItem::GetShipArmorPercent(), ShipItem::GetShipCapacitorLevel(), ShipItem::GetShipCapacitorPercent(), ShipItem::GetShipCPULevel(), ShipItem::GetShipCPUPercent(), ShipItem::GetShipHullHP(), ShipItem::GetShipHullPercent(), ShipItem::GetShipPGLevel(), ShipItem::GetShipPGPercent(), ShipItem::GetShipShieldHP(), ShipItem::GetShipShieldPercent(), Skill::GetSPForLevel(), Character::GetSPPerMin(), SentryAI::GetTargetTime(), NPCAIMgr::GetTargetTime(), ConcordAI::GetTargetTime(), TurretFormulas::GetToHit(), Skill::GetTrainingTime(), ShipItem::HeatDamageCheck(), Missile::HitTarget(), StructureSE::Init(), ShipItem::InitAttribs(), ModuleManager::Initialize(), ShipItem::InitPod(), ModuleManager::InstallRig(), GenericModule::IsDamaged(), isGlobal(), IsOnline(), RamMethods::JobsCheck(), CustomsSE::Killed(), StructureSE::Killed(), ShipSE::Killed(), ShipSE::LaunchDrone(), ActiveModule::LaunchMissile(), NPCAIMgr::LaunchMissile(), TurretModule::LoadCharge(), MiningLaser::LoadCharge(), Character::LoadPausedSkillQueue(), Concord::MakeDamageState(), Missile::MakeDamageState(), DroneSE::MakeDamageState(), ProbeSE::MakeDamageState(), CelestialSE::MakeDamageState(), ShipSE::MakeDamageState(), ItemSystemEntity::MakeDamageState(), ObjectSystemEntity::MakeDamageState(), DynamicSystemEntity::MakeDamageState(), DestinyManager::MakeMissile(), NPCAIMgr::MissileLaunched(), ShipItem::MoveModuleSlot(), NPC::NPC(), NPCAIMgr::NPCAIMgr(), GenericModule::Offline(), GenericModule::Online(), DestinyManager::Orbit(), Populate(), ProbeSE::ProbeSE(), ShipSE::Process(), ActiveModule::ProcessActiveCycle(), ShipItem::ProcessHeat(), Scan::ProcessScan(), StructureSE::PullAnchor(), radius(), ProbeSE::RecoverProbe(), ShipItem::RemoveItem(), RigModule::RemoveRig(), ShipItem::RepairShip(), Scan::RequestScans(), ShipSE::ScoopDrone(), SystemEntity::SendDamageStateChanged(), Sentry::Sentry(), SentryAI::SentryAI(), StructureSE::SetAnchor(), DestinyManager::SetMaxVelocity(), ModuleItem::SetOnline(), TowerSE::SetOnline(), ShipItem::SetShipArmor(), ShipItem::SetShipCapacitorLevel(), ShipItem::SetShipHull(), ShipItem::SetShipShield(), Skill::SkillPrereqsComplete(), CargoContainer::Spawn(), WreckContainer::Spawn(), Spawn(), DestinyManager::SpeedBoost(), TargetManager::StartTargeting(), StationSE::StationSE(), SystemEntity::SystemEntity(), SentryAI::Target(), DroneAIMgr::Target(), ConcordAI::Target(), SentryAI::Targeted(), ConcordAI::Targeted(), TargetManager::TimeToLock(), TowerSE::TowerSE(), ShipItem::TryModuleLimitChecks(), ActiveModule::UnloadCharge(), ActiveModule::UpdateCharge(), ActiveModule::UpdateDamage(), ObjectSystemEntity::UpdateDamage(), DynamicSystemEntity::UpdateDamage(), ShipItem::UpdateMass(), ProbeSE::UpdateProbe(), DestinyManager::UpdateShipVariables(), Concord::UseArmorRepairer(), NPC::UseArmorRepairer(), Concord::UseShieldRecharge(), NPC::UseShieldRecharge(), ShipItem::ValidateBoardShip(), Skill::VerifyAttribs(), ShipItem::VerifyHoldType(), Skill::VerifySP(), DestinyManager::WarpTo(), and DestinyManager::WebbedMe().

323 { return pAttributeMap->GetAttribute(attrID); }
EvilNumber GetAttribute(const uint16 attrID) const
AttributeMap * pAttributeMap

Here is the call graph for this function:

AttributeMap* InventoryItem::GetAttributeMap ( )
inline

Definition at line 307 of file InventoryItem.h.

References pAttributeMap.

Referenced by Command_attrlist().

307 { return pAttributeMap; }
AttributeMap * pAttributeMap

Here is the caller graph for this function:

void InventoryItem::GetChargeStatusRow ( uint32  shipID,
PyPackedRow into 
) const

Definition at line 1158 of file InventoryItem.cpp.

References ItemData::flag, ItemType::id(), m_data, m_type, and PyPackedRow::SetField().

Referenced by GetChargeStatusRow().

1158  {
1159  into->SetField("instanceID", new PyLong(shipID)); // locationID
1160  into->SetField("flagID", new PyInt(m_data.flag));
1161  into->SetField("typeID", new PyInt(m_type.id()));
1162 }
uint16 id() const
Definition: ItemType.h:63
ItemType m_type
ItemData m_data
Python integer.
Definition: PyRep.h:231
EVEItemFlags flag
Definition: ItemType.h:187
bool SetField(uint32 index, PyRep *value)
Definition: PyRep.cpp:1031
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

Here is the caller graph for this function:

PyPackedRow * InventoryItem::GetChargeStatusRow ( uint32  shipID) const

Definition at line 1147 of file InventoryItem.cpp.

References DBRowDescriptor::AddColumn(), DBTYPE_I2, DBTYPE_I4, DBTYPE_I8, and GetChargeStatusRow().

1147  {
1148  DBRowDescriptor* header = new DBRowDescriptor();
1149  header->AddColumn("instanceID", DBTYPE_I8);
1150  header->AddColumn("flagID", DBTYPE_I2);
1151  header->AddColumn("typeID", DBTYPE_I4);
1152  //header->AddColumn("quantity", DBTYPE_I4);
1153  PyPackedRow* row = new PyPackedRow(header);
1154  GetChargeStatusRow(shipID, row);
1155  return row;
1156 }
void AddColumn(const char *name, DBTYPE type)
Definition: PyDatabase.cpp:96
void GetChargeStatusRow(uint32 shipID, PyPackedRow *into) const
Python object "blue.DBRowDescriptor".
Definition: PyDatabase.h:41
Packed row.
Definition: PyRep.h:961

Here is the call graph for this function:

EvilNumber InventoryItem::GetDefaultAttribute ( const uint16  attrID) const
inline

Definition at line 324 of file InventoryItem.h.

References ItemType::GetAttribute().

Referenced by AttributeMap::ResetAttribute().

324 { return m_type.GetAttribute(attrID); }
ItemType m_type
EvilNumber GetAttribute(const uint16 attributeID) const
Definition: ItemType.cpp:168

Here is the call graph for this function:

Here is the caller graph for this function:

PyRep* InventoryItem::GetItem ( ) const
inline

Definition at line 263 of file InventoryItem.h.

References GetItemRow().

Referenced by PyCallable_Make_InnerDispatcher().

263 { return GetItemRow(); }
PyPackedRow * GetItemRow() const

Here is the call graph for this function:

Here is the caller graph for this function:

PyList * InventoryItem::GetItemInfo ( ) const

Definition at line 1277 of file InventoryItem.cpp.

References PyList::AddItem(), and GetItemRow().

1278 {
1279  PyList* itemInfo = new PyList();
1280  itemInfo->AddItem(GetItemRow());
1281  return itemInfo;
1282 }
PyPackedRow * GetItemRow() const
void AddItem(PyRep *i)
Definition: PyRep.h:701
Python list.
Definition: PyRep.h:639

Here is the call graph for this function:

void InventoryItem::GetItemRow ( PyPackedRow into) const

Definition at line 1171 of file InventoryItem.cpp.

References EVEDB::invCategories::Blueprint, ItemType::categoryID(), categoryID(), ItemData::customInfo, ItemData::flag, groupID(), ItemType::id(), ItemData::locationID, m_data, m_itemID, m_type, ItemData::ownerID, ItemData::quantity, PyPackedRow::SetField(), ItemData::singleton, sItemFactory, and type().

1172 {
1173  int32 qty = (m_data.singleton ? -1 : m_data.quantity);
1175  if (sItemFactory.GetBlueprint(m_itemID)->copy())
1176  qty = -2;
1177 
1178  into->SetField("itemID", new PyLong(m_itemID));
1179  into->SetField("typeID", new PyInt(m_type.id()));
1180  into->SetField("ownerID", new PyInt(m_data.ownerID));
1181  into->SetField("locationID", new PyInt(m_data.locationID));
1182  into->SetField("flagID", new PyInt(m_data.flag));
1183  into->SetField("groupID", new PyInt(type().groupID()));
1184  into->SetField("categoryID", new PyInt(type().categoryID()));
1185  into->SetField("quantity", new PyInt(qty));
1186  /*
1187  if (m_type.categoryID() == EVEDB::invCategories::Blueprint) {
1188  if (sItemFactory.GetBlueprint(m_itemID)->copy()) {
1189  into->SetField("stacksize", new PyInt(1));
1190  into->SetField("singleton", new PyInt(2));
1191  } else {
1192  into->SetField("stacksize", new PyInt(m_data.singleton? -1 : m_data.quantity));
1193  into->SetField("singleton", new PyInt(m_data.singleton?1:0));
1194  }
1195  } else {
1196  into->SetField("stacksize", new PyInt(m_data.singleton? -1 : m_data.quantity));
1197  into->SetField("singleton", new PyInt(m_data.singleton?1:0));
1198  }
1199  */
1200  // customInfo is actually used in client (but i dont think it's a string)
1201  //if const.ixLocationID in change and item.customInfo == logConst.eventUndock:
1202  into->SetField("customInfo", new PyString(m_data.customInfo));
1203 }
uint16 id() const
Definition: ItemType.h:63
Python string.
Definition: PyRep.h:430
ItemType m_type
uint32 locationID
Definition: ItemType.h:190
ItemData m_data
uint8 categoryID() const
Definition: ItemType.h:66
std::string customInfo
Definition: ItemType.h:194
uint16 groupID() const
signed __int32 int32
Definition: eve-compat.h:49
const ItemType & type() const
Python integer.
Definition: PyRep.h:231
uint32 quantity
Definition: ItemType.h:191
EVEItemFlags flag
Definition: ItemType.h:187
bool SetField(uint32 index, PyRep *value)
Definition: PyRep.cpp:1031
uint32 ownerID
Definition: ItemType.h:189
#define sItemFactory
Definition: ItemFactory.h:165
uint8 categoryID() const
bool singleton
Definition: ItemType.h:186
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

PyPackedRow * InventoryItem::GetItemRow ( ) const

Definition at line 1164 of file InventoryItem.cpp.

References sDataMgr.

Referenced by StationOffice::GetItem(), CargoContainer::GetItem(), GetItem(), GetItemInfo(), Populate(), and SendItemChange().

1165 {
1166  PyPackedRow* row = new PyPackedRow( sDataMgr.CreateHeader() );
1167  GetItemRow(row);
1168  return row;
1169 }
PyPackedRow * GetItemRow() const
Packed row.
Definition: PyRep.h:961
#define sDataMgr

Here is the caller graph for this function:

void InventoryItem::GetItemStatusRow ( PyPackedRow into) const

Definition at line 1135 of file InventoryItem.cpp.

References AttrArmorDamageAmount, AttrCapacitorCharge, AttrDamage, AttrIsIncapacitated, AttrOnline, AttrShieldCharge, AttrSkillPoints, GetAttribute(), HasAttribute(), m_itemID, and PyPackedRow::SetField().

Referenced by ShipItem::GetShipState().

1135  {
1136  into->SetField("instanceID", new PyLong(m_itemID ));
1137  into->SetField("online", new PyBool((HasAttribute(AttrOnline) ? GetAttribute(AttrOnline).get_bool() : false) ));
1138  into->SetField("damage", new PyFloat((HasAttribute(AttrDamage) ? GetAttribute(AttrDamage).get_float() : 0) ));
1139  into->SetField("charge", new PyFloat((HasAttribute(AttrCapacitorCharge) ? GetAttribute(AttrCapacitorCharge).get_float() : 0) ));
1140  into->SetField("skillPoints", new PyInt((HasAttribute(AttrSkillPoints) ? GetAttribute(AttrSkillPoints).get_uint32() : 0) ));
1141  into->SetField("armorDamage", new PyFloat((HasAttribute(AttrArmorDamageAmount) ? GetAttribute(AttrArmorDamageAmount).get_float() : 0.0) ));
1142  into->SetField("shieldCharge", new PyFloat((HasAttribute(AttrShieldCharge) ? GetAttribute(AttrShieldCharge).get_float() : 0.0) ));
1143  into->SetField("incapacitated", new PyBool((HasAttribute(AttrIsIncapacitated) ? GetAttribute(AttrIsIncapacitated).get_bool() : false) ));
1144 }
bool HasAttribute(const uint16 attrID) const
Python floating point number.
Definition: PyRep.h:292
Python boolean.
Definition: PyRep.h:323
Python integer.
Definition: PyRep.h:231
EvilNumber GetAttribute(const uint16 attrID) const
bool SetField(uint32 index, PyRep *value)
Definition: PyRep.cpp:1031
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

Here is the caller graph for this function:

PyPackedRow * InventoryItem::GetItemStatusRow ( ) const

Definition at line 1120 of file InventoryItem.cpp.

References DBRowDescriptor::AddColumn(), DBTYPE_BOOL, DBTYPE_I4, DBTYPE_I8, and DBTYPE_R8.

Referenced by ShipItem::GetShipState().

1120  {
1121  DBRowDescriptor* header = new DBRowDescriptor();
1122  header->AddColumn("instanceID", DBTYPE_I8);
1123  header->AddColumn("online", DBTYPE_BOOL);
1124  header->AddColumn("damage", DBTYPE_R8);
1125  header->AddColumn("charge", DBTYPE_R8);
1126  header->AddColumn("skillPoints", DBTYPE_I4);
1127  header->AddColumn("armorDamage", DBTYPE_R8);
1128  header->AddColumn("shieldCharge", DBTYPE_R8);
1129  header->AddColumn("incapacitated", DBTYPE_BOOL);
1130  PyPackedRow* row = new PyPackedRow(header);
1131  GetItemStatusRow(row);
1132  return row;
1133 }
void AddColumn(const char *name, DBTYPE type)
Definition: PyDatabase.cpp:96
PyPackedRow * GetItemStatusRow() const
Python object "blue.DBRowDescriptor".
Definition: PyDatabase.h:41
Packed row.
Definition: PyRep.h:961

Here is the call graph for this function:

Here is the caller graph for this function:

virtual ModuleItem* InventoryItem::GetModuleItem ( )
inlinevirtual

Reimplemented in ModuleItem.

Definition at line 83 of file InventoryItem.h.

83 { return nullptr; }
double InventoryItem::GetPackagedVolume ( )

Definition at line 1358 of file InventoryItem.cpp.

References ItemType::groupID(), m_data, m_type, ItemData::singleton, and ItemType::volume().

Referenced by ShipItem::_Load(), ChangeSingleton(), ShipItem::InitAttribs(), ShipItem::InitPod(), and CargoContainer::Spawn().

1359 {
1360  if (m_data.singleton)
1361  return m_type.volume();
1362 
1363  // these volumes are hard-coded in client.
1364  switch (m_type.groupID()) {
1365  case 29: //Capsule
1366  case 31: //Shuttle
1367  case 1022: { //Prototype Exploration Ship
1368  return 500;
1369  }
1370  case 12: //Cargo Container
1371  case 306: //Spawn Container
1372  case 340: //Secure Cargo Container
1373  case 448: //Audit Log Secure Container
1374  case 649: //Freight Container
1375  case 952: { //Mission Container
1376  return 1000;
1377  }
1378  case 25: //Frigate
1379  case 324: //Assault Ship
1380  case 830: //Covert Ops
1381  case 893: //Electronic Attack Ship
1382  case 831: //Interceptor
1383  case 834: { //Stealth Bomber
1384  return 2500;
1385  }
1386  case 543: //Exhumer
1387  case 463: { //Mining Barge
1388  return 3750;
1389  }
1390  case 541: //Interdictor
1391  case 420: //Destroyer
1392  case 963: { //Strategic Cruiser
1393  return 5000;
1394  }
1395  case 906: //Combat Recon Ship
1396  case 26: //Cruiser
1397  case 833: //Force Recon Ship
1398  case 358: //Heavy Assault Ship
1399  case 894: //Heavy Interdictor
1400  case 832: { //Logistics
1401  return 10000;
1402  }
1403  case 419: //Battlecruiser
1404  case 540: { //Command Ship
1405  return 15000;
1406  }
1407  case 28: //Industrial
1408  case 380: { //Transport Ship
1409  return 20000;
1410  }
1411  case 27: //Battleship
1412  case 900: //Marauder
1413  case 898: //Black Ops
1414  case 381: { //Elite Battleship
1415  return 50000;
1416  }
1417  case 941: { //Industrial Command Ship
1418  return 500000;
1419  }
1420  case 883: //Capital Industrial Ship
1421  case 547: //Carrier
1422  case 485: //Dreadnought
1423  case 513: //Freighter
1424  case 902: //Jump Freighter
1425  case 659: { //Supercarrier
1426  return 1000000;
1427  }
1428  case 30: { //Titan
1429  return 10000000;
1430  }
1431  }
1432 
1433  // return basic volume for non-ship or non-container objects
1434  return m_type.volume();
1435 }
ItemType m_type
uint16 groupID() const
Definition: ItemType.h:64
ItemData m_data
float volume() const
Definition: ItemType.h:70
bool singleton
Definition: ItemType.h:186

Here is the call graph for this function:

Here is the caller graph for this function:

virtual Client* InventoryItem::GetPilot ( )
inlinevirtual

Reimplemented in ShipItem.

Definition at line 176 of file InventoryItem.h.

Referenced by SystemEntity::AwardSecurityStatus(), ShipSE::Killed(), ShipSE::MakeSlimItem(), and ShipSE::Process().

176 { return nullptr; }

Here is the caller graph for this function:

virtual ShipItem* InventoryItem::GetShipItem ( )
inlinevirtual

Reimplemented in ShipItem.

Definition at line 82 of file InventoryItem.h.

Referenced by RepairService::GetDamageReports(), and InventoryBound::MoveItems().

82 { return nullptr; }

Here is the caller graph for this function:

int64 InventoryItem::GetTimeStamp ( )
inline

Definition at line 308 of file InventoryItem.h.

References m_timestamp.

308 { return m_timestamp; }
bool InventoryItem::HasAttribute ( const uint16  attrID,
EvilNumber value 
) const
inline

Definition at line 318 of file InventoryItem.h.

References AttributeMap::HasAttribute(), and pAttributeMap.

318 { return pAttributeMap->HasAttribute(attrID, value); }
bool HasAttribute(const uint16 attrID) const
AttributeMap * pAttributeMap

Here is the call graph for this function:

virtual bool InventoryItem::HasPilot ( )
inlinevirtual

Reimplemented in ShipItem.

Definition at line 175 of file InventoryItem.h.

Referenced by SystemEntity::AwardSecurityStatus(), ShipSE::EncodeDestiny(), ShipSE::Killed(), and ShipSE::Process().

175 { return false; }

Here is the caller graph for this function:

bool InventoryItem::HasReqSkill ( const uint16  skillID)
inline

Definition at line 300 of file InventoryItem.h.

References ItemType::HasReqSkill().

Referenced by FxProc::ApplyEffects().

300 { return m_type.HasReqSkill(skillID); }
ItemType m_type
bool HasReqSkill(const uint16 skillID) const
Definition: ItemType.cpp:176
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()()() itemID() itemID Fits selected item to active ship() skillID(level)-gives skillID to specified level." ) COMMAND( online

Here is the call graph for this function:

Here is the caller graph for this function:

bool InventoryItem::isGlobal ( ) const
inline

Definition at line 114 of file InventoryItem.h.

References AttrIsGlobal, GetAttribute(), and HasAttribute().

Referenced by SystemEntity::isGlobal().

114 { return (HasAttribute(AttrIsGlobal) ? GetAttribute(AttrIsGlobal).get_bool() : false); }
bool HasAttribute(const uint16 attrID) const
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool InventoryItem::IsModuleItem ( )
inlinevirtual

Reimplemented in ModuleItem.

Definition at line 86 of file InventoryItem.h.

Referenced by SystemEntity::ApplyDamage().

86 { return false; }

Here is the caller graph for this function:

bool InventoryItem::IsOnline ( )
inline

Definition at line 115 of file InventoryItem.h.

References AttrOnline, EvilNumber::get_bool(), and GetAttribute().

Referenced by GenericModule::isOnline().

115 { return GetAttribute(AttrOnline).get_bool(); }
bool get_bool()
Definition: EvilNumber.cpp:157
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool InventoryItem::IsShipItem ( )
inlinevirtual

Reimplemented in ShipItem.

Definition at line 85 of file InventoryItem.h.

Referenced by RepairService::GetDamageReports().

85 { return false; }

Here is the caller graph for this function:

bool InventoryItem::isSingleton ( ) const
inline

Definition at line 96 of file InventoryItem.h.

References m_data, and ItemData::singleton.

Referenced by Character::Character(), Client::CheckShipRef(), Merge(), MergeTypesInCargo(), and Skill::VerifyAttribs().

96 { return m_data.singleton != 0; }
ItemData m_data
bool singleton
Definition: ItemType.h:186

Here is the caller graph for this function:

PyObject * InventoryItem::ItemGetInfo ( )

Definition at line 1284 of file InventoryItem.cpp.

References Populate().

1285 { // called from dogmaBound at least once (usually 2x) on every weapon update
1286  Rsp_ItemGetInfo result;
1287  if (!Populate(result.entry))
1288  return nullptr;
1289  return result.Encode();
1290 }
bool Populate(Rsp_CommonGetInfo_Entry &into)

Here is the call graph for this function:

uint32 InventoryItem::itemID ( ) const
inline

Definition at line 98 of file InventoryItem.h.

References m_itemID.

Referenced by _Load(), _LoadItem(), ActiveModule::AbortCycle(), ActiveModule::ActiveModule(), AttributeMap::Add(), ShipItem::AddItemByFlag(), SolarSystem::AddItemToInventory(), FleetService::AddMember(), MiningLaser::AddOreAndDeactivate(), AnomalyMgr::AddSignal(), Character::AddToSkillQueue(), TurretModule::ApplyDamage(), SystemEntity::ApplyDamage(), SentryAI::AttackTarget(), DroneAIMgr::AttackTarget(), NPCAIMgr::AttackTarget(), ConcordAI::AttackTarget(), DynamicSystemEntity::AwardBounty(), SystemEntity::AwardSecurityStatus(), Client::Board(), Client::BoardShip(), ActiveModule::CanActivate(), Character::CancelSkillInTraining(), Agent::CanUseAgent(), CelestialObject::CelestialObject(), AttributeMap::Change(), Client::CharNoLongerInStation(), Client::CharNowInStation(), Client::CheckShipRef(), ActiveModule::Clear(), Command_cargo(), Command_dogma(), PlanetSE::CreateCustomsOffice(), FleetService::CreateFleet(), Client::CreateNewPod(), Colony::CreatePin(), Client::CreateShipSE(), Damage::Damage(), ActiveModule::Deactivate(), ActiveModule::DeactivateCycle(), AsteroidSE::Delete(), AttributeMap::DeleteAttribute(), MiningLaser::Depleted(), Client::DestroyShipSE(), Client::DockToStation(), DroneSE::DroneSE(), SystemEntity::DropLoot(), Prospector::DropSalvage(), Client::Eject(), AnomalySE::EncodeDestiny(), WormholeSE::EncodeDestiny(), StationSE::EncodeDestiny(), SystemEntity::EncodeDestiny(), StaticSystemEntity::EncodeDestiny(), ItemSystemEntity::EncodeDestiny(), FieldSE::EncodeDestiny(), ObjectSystemEntity::EncodeDestiny(), DynamicSystemEntity::EncodeDestiny(), MarketMgr::ExecuteBuyOrder(), GenericModule::GenericModule(), FactoryDB::GetAssemblyLineProperties(), ShipItem::GetChargeState(), Client::GetCharID(), Character::GetEndOfTraining(), SystemEntity::GetID(), PlanetSE::GetPlanetInfo(), Client::GetPodID(), ReprocessingServiceBound::GetQuote(), ShipItem::GetShipDNA(), ShipItem::GetShipInfo(), ShipItem::GetShipState(), IHubSE::Init(), SBUSE::Init(), TCUSE::Init(), TowerSE::Init(), CustomsSE::Init(), ReactorSE::Init(), StructureSE::Init(), ModuleManager::Initialize(), ModuleManager::InstallRig(), ModuleManager::InstallSubSystem(), GenericModule::itemID(), RamMethods::JobsCheck(), Sentry::Killed(), CustomsSE::Killed(), NPC::Killed(), DroneSE::Killed(), StructureSE::Killed(), ShipSE::Killed(), ShipSE::LaunchDrone(), ActiveModule::LaunchMissile(), ActiveModule::LaunchProbe(), FleetService::LeaveFleet(), ProbeItem::Load(), AttributeMap::Load(), Load(), ActiveModule::LoadCharge(), ModuleManager::LoadCharge(), StargateSE::LoadExtras(), Character::LoadPausedSkillQueue(), Client::LoadStationHangar(), TowerSE::MakeSlimItem(), Missile::MakeSlimItem(), DroneSE::MakeSlimItem(), ProbeSE::MakeSlimItem(), AnomalySE::MakeSlimItem(), ContainerSE::MakeSlimItem(), WormholeSE::MakeSlimItem(), StationSE::MakeSlimItem(), SystemEntity::MakeSlimItem(), WreckSE::MakeSlimItem(), StaticSystemEntity::MakeSlimItem(), ShipSE::MakeSlimItem(), StargateSE::MakeSlimItem(), ItemSystemEntity::MakeSlimItem(), ObjectSystemEntity::MakeSlimItem(), DynamicSystemEntity::MakeSlimItem(), WreckContainer::MakeSlimItemChange(), SpawnMgr::MakeSpawn(), Merge(), ShipItem::MergeModuleGroups(), MergeTypesInCargo(), Missile::Missile(), ModuleItem::ModuleItem(), InventoryBound::MoveItems(), Client::MoveToLocation(), AttributeMap::MultiplyAttribute(), NPC::NPC(), Character::PayBounty(), ShipSE::PayInsurance(), ShipItem::PeelAndLink(), ProbeSE::ProbeSE(), SystemEntity::Process(), ContainerSE::Process(), WreckSE::Process(), ShipSE::Process(), Client::ProcessClient(), MiningLaser::ProcessCycle(), ProbeSE::ProcessTic(), ProbeSE::RecoverProbe(), ShipItem::RemoveItem(), WreckContainer::RemoveItem(), SolarSystem::RemoveItemFromInventory(), SystemManager::RemoveItemFromInventory(), FleetService::RemoveMember(), ProbeSE::RemoveProbe(), ShipItem::RemoveRig(), ShipItem::ReplaceCharges(), Client::ResetAfterPopped(), AttributeMap::Save(), AttributeMap::SaveShipState(), DestinyManager::SendBallInteractive(), AttributeMap::SendChanges(), SystemEntity::SendDamageStateChanged(), ProbeSE::SendNewProbe(), Client::SendSessionChange(), ProbeSE::SendSlimChange(), ProbeSE::SendStateChange(), ProbeSE::SendWarpEnd(), ProbeSE::SendWarpStart(), CustomsSE::SetAnchor(), StructureSE::SetAnchor(), AttributeMap::SetAttribute(), SystemBubble::SetBelt(), Client::SetDestiny(), IHubSE::SetOnline(), TowerSE::SetOnline(), StructureSE::SetOnline(), Client::SetShip(), ShipItem::ShipGetModuleList(), ShipItem::ShipItem(), ActiveModule::ShowEffect(), Character::SkillQueueLoop(), ProbeItem::Spawn(), Spawn(), Client::SpawnNewRookieShip(), DroneSE::StateChange(), StationItem::StationItem(), StationOffice::StationOffice(), StructureItem::StructureItem(), TradeService::TransferContainerContents(), ActiveModule::UnloadCharge(), ModuleManager::UnloadCharge(), ObjectSystemEntity::UpdateDamage(), DynamicSystemEntity::UpdateDamage(), DestinyManager::UpdateNewShip(), Client::UpdateNewShip(), TowerSE::UpdatePassword(), Agent::UpdateStandings(), ShipItem::ValidateItemSpecifics(), Client::WarpIn(), Client::WarpOut(), WreckContainer::WreckContainer(), WreckContainer::WreckContainerGetInfo(), and Client::~Client().

98 { return m_itemID; }
InventoryItemRef InventoryItem::Load ( uint32  itemID)
static

Definition at line 133 of file InventoryItem.cpp.

References itemID().

134 {
135  return InventoryItem::Load<InventoryItem>(itemID);
136 }
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

template<class _Ty >
static RefPtr<_Ty> InventoryItem::Load ( uint32  itemID)
inlinestaticprotected

Definition at line 225 of file InventoryItem.h.

References itemID().

226  {
227  // static load
228  RefPtr<_Ty> i = _Ty::template _Load<_Ty>( itemID );
229  if (!i)
230  return RefPtr<_Ty>();
231 
232  // virtual load (load attributes)
233  if (!i->_Load())
234  return RefPtr<_Ty>();
235 
236  return i;
237  }
uint32 itemID() const
Definition: InventoryItem.h:98
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

bool InventoryItem::Merge ( InventoryItemRef  to_merge,
int32  qty = 0,
bool  notify = true 
)
virtual

Definition at line 860 of file InventoryItem.cpp.

References _log, AlterQuantity(), RefPtr< X >::get(), ItemType::id(), IsCharacterID, isSingleton(), itemID(), m_data, m_itemID, m_type, name(), ItemData::name, ItemData::ownerID, quantity(), Client::SendErrorMsg(), sEntityList, ItemData::singleton, and typeID().

Referenced by ModuleManager::LoadCharge(), Blueprint::Merge(), and MergeTypesInCargo().

860  {
861  if (to_merge.get() == nullptr)
862  return false;
863 
864  if (m_data.singleton or to_merge->isSingleton())
865  throw CustomError ("You cannot stack assembled items.");
866 
867  if (m_type.id() != to_merge->typeID()) {
868  _log(ITEM__WARNING, "II::Merge() - %s (%u): Asked to merge with %s (%u).", m_data.name.c_str(), m_itemID, to_merge->name(), to_merge->itemID());
869  return false;
870  }
871 
872  if (qty < 1)
873  qty = to_merge->quantity();
874 
875  // AlterQuantity will delete items with qty < 1
876  if (!to_merge->AlterQuantity(-qty, notify)) {
877  _log(ITEM__ERROR, "II::Merge() - %s (%u): Failed to remove quantity %u.", to_merge->name(), to_merge->itemID(), qty);
879  Client* pClient = sEntityList.FindClientByCharID(m_data.ownerID);
880  if (pClient != nullptr)
881  pClient->SendErrorMsg("Internal Server Error. Ref: ServerError 63138");
882  }
883  return false;
884  }
885 
886  if (!AlterQuantity(qty, notify)) {
887  _log(ITEM__ERROR, "%s (%u): Failed to add quantity %u.", m_data.name.c_str(), m_itemID, qty);
889  Client* pClient = sEntityList.FindClientByCharID(m_data.ownerID);
890  if (pClient != nullptr)
891  pClient->SendErrorMsg("Internal Server Error. Ref: ServerError 63238");
892  }
893  return false;
894  }
895 
896  return true;
897 }
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
#define _log(type, fmt,...)
Definition: logsys.h:124
uint16 id() const
Definition: ItemType.h:63
ItemType m_type
ItemData m_data
#define sEntityList
Definition: EntityList.h:208
const char * name()
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
bool isSingleton() const
Definition: InventoryItem.h:96
bool AlterQuantity(int32 qty, bool notify=false)
X * get() const
Definition: RefPtr.h:213
#define IsCharacterID(itemID)
Definition: EVE_Defines.h:206
Definition: Client.h:66
uint32 ownerID
Definition: ItemType.h:189
std::string name
Definition: ItemType.h:193
uint16 typeID() const
bool singleton
Definition: ItemType.h:186
uint32 itemID() const
Definition: InventoryItem.h:98
int32 quantity() const
Definition: InventoryItem.h:97

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::MergeTypesInCargo ( ShipItem pShip,
EVEItemFlags  flag = flagNone 
)

Definition at line 899 of file InventoryItem.cpp.

References flag(), RefPtr< X >::get(), Inventory::GetByTypeFlag(), GetMyInventory(), ItemType::id(), isSingleton(), itemID(), m_data, m_type, Merge(), Move(), ItemData::singleton, and typeID().

Referenced by ProbeSE::ProcessTic().

900 {
901  // get existing type in cargo
903  if (iRef.get() == nullptr) {
904  Move(pShip->itemID(), flag, true);
905  return;
906  }
907  // fix for elusive error when using IB::Add() to remove loaded modules (charge trying to add to module item)
908  if (iRef->typeID() != m_type.id()) {
909  Move(pShip->itemID(), flag, true);
910  return;
911  }
912 
913  // if either item is assembled, just move item (merge will throw on assembled items)
914  if (iRef->isSingleton() or m_data.singleton) {
915  Move(pShip->itemID(), flag, true);
916  return;
917  }
918  // here we 'merge' with stack already in cargo
919  // if it dont work, just move item.
920  if (!iRef->Merge(InventoryItemRef(this)))
921  Move(pShip->itemID(), flag, true);
922 }
uint16 id() const
Definition: ItemType.h:63
ItemType m_type
virtual bool Merge(InventoryItemRef to_merge, int32 qty=0, bool notify=true)
ItemData m_data
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
bool isSingleton() const
Definition: InventoryItem.h:96
X * get() const
Definition: RefPtr.h:213
EVEItemFlags flag() const
Inventory * GetMyInventory()
Definition: InventoryItem.h:91
InventoryItemRef GetByTypeFlag(uint32 typeID, EVEItemFlags flag) const
Definition: Inventory.cpp:444
uint16 typeID() const
bool singleton
Definition: ItemType.h:186
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::Move ( uint32  new_location = locTemp,
EVEItemFlags  flag = flagNone,
bool  notify = false 
)

Definition at line 742 of file InventoryItem.cpp.

References _log, AddItem(), Inv::Update::Flag, ItemData::flag, RefPtr< X >::get(), IsNPC, IsTempItem, IsValidLocation, Inv::Update::Location, ItemData::locationID, locRAMItems, m_data, m_delete, m_itemID, ItemData::name, ItemData::ownerID, RemoveItem(), SendItemChange(), sItemFactory, and ItemDB::UpdateLocation().

Referenced by ShipItem::AddItemByFlag(), Client::Board(), Client::BoardShip(), TradeBound::CancelTrade(), Colony::CreatePin(), Delete(), Client::Eject(), TradeBound::ExchangeItems(), ShipSE::LaunchDrone(), MergeTypesInCargo(), Client::MoveItem(), Client::MoveToLocation(), ShipItem::RemoveRig(), Client::ResetAfterPodded(), Client::SetShip(), and Split().

742  {
743  if ((new_location == m_data.locationID) and (new_flag == m_data.flag) and !notify)
744  return; //nothing to do...
745 
746  InventoryItemRef iRef(nullptr);
747  uint32 old_location = m_data.locationID;
748  EVEItemFlags old_flag = m_data.flag;
749 
750  if ((new_location != m_data.locationID) // diff container
751  or ((new_location == m_data.locationID) // or same container
752  and (new_flag != m_data.flag))) { // but different flag
753  // remove from current location
755  iRef = sItemFactory.GetItem(m_data.locationID);
756  if (iRef.get() != nullptr) {
757  iRef->RemoveItem(InventoryItemRef(this));
758  } else {
759  _log(ITEM__ERROR, "II::Move() - Cant find location %u containing %s.", m_data.locationID, m_data.name.c_str());
760  }
761  }
762  }
763 
764  // update data
765  m_data.flag = new_flag;
766  m_data.locationID = new_location;
767 
768  if ((old_location != m_data.locationID) // diff container
769  or ((old_location == m_data.locationID) // or same container
770  and (old_flag != m_data.flag))) { // but different flag
771  // add to new location
773  iRef = sItemFactory.GetItem(m_data.locationID);
774  if (iRef.get() != nullptr) {
775  iRef->AddItem(InventoryItemRef(this));
776  } else {
777  _log(ITEM__ERROR, "II::Move() - Cant find location %u to add %s.", m_data.locationID, m_data.name.c_str());
778  }
779  }
780  }
781 
783  return;
784 
787 
788  //notify about the changes.
789  if (notify) {
790  std::map<int32, PyRep *> changes;
791  if (m_data.locationID != old_location)
792  changes[Inv::Update::Location] = new PyInt(old_location);
793  if (m_data.flag != old_flag)
794  changes[Inv::Update::Flag] = new PyInt(old_flag);
795  SendItemChange(m_data.ownerID, changes); //changes is consumed
796  }
797 }
void SendItemChange(uint32 toID, std::map< int32, PyRep * > &changes)
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 locationID
Definition: ItemType.h:190
EVEItemFlags
Definition: EVE_Flags.h:13
ItemData m_data
Python integer.
Definition: PyRep.h:231
unsigned __int32 uint32
Definition: eve-compat.h:50
EVEItemFlags flag
Definition: ItemType.h:187
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
static void UpdateLocation(uint32 itemID, uint32 locationID, EVEItemFlags flag)
Definition: ItemDB.cpp:212
#define IsTempItem(itemID)
Definition: EVE_Defines.h:333
uint32 ownerID
Definition: ItemType.h:189
#define sItemFactory
Definition: ItemFactory.h:165
#define IsNPC(itemID)
Definition: EVE_Defines.h:300
std::string name
Definition: ItemType.h:193
#define IsValidLocation(itemID)
Definition: EVE_Defines.h:209

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::MultiplyAttribute ( uint16  attrID,
EvilNumber  num,
bool  notify = false 
)

Definition at line 1353 of file InventoryItem.cpp.

References AttributeMap::MultiplyAttribute(), and pAttributeMap.

Referenced by ModuleManager::addModuleRef(), and Missile::Missile().

1354 {
1355  pAttributeMap->MultiplyAttribute(attrID, num, notify);
1356 }
void MultiplyAttribute(uint16 attrID, EvilNumber &num, bool notify=false)
AttributeMap * pAttributeMap

Here is the call graph for this function:

Here is the caller graph for this function:

const char* InventoryItem::name ( )
inline

Definition at line 107 of file InventoryItem.h.

References m_data, and ItemData::name.

Referenced by ActiveModule::AbortCycle(), ActiveModule::Activate(), ModuleManager::Activate(), StructureSE::Activate(), ActiveModule::ActiveModule(), Character::AddItem(), SolarSystem::AddItemToInventory(), ModuleManager::AddModule(), ModuleManager::addModuleRef(), MiningLaser::AddOreAndDeactivate(), AnomalyMgr::AddSignal(), TargetManager::AddTargetModule(), Character::AddToSkillQueue(), TurretModule::ApplyDamage(), SystemEntity::ApplyDamage(), Client::BoardShip(), ActiveModule::CanActivate(), Character::CancelSkillInTraining(), CargoContainer::CargoContainer(), CargoContainer::CargoContainerGetInfo(), CelestialObject::CelestialObject(), ModuleManager::CheckGroupFitLimited(), Client::CheckShipRef(), ActiveModule::Clear(), Character::ClearSkillQueue(), Command_cargo(), Command_inventory(), Command_shipinventory(), Command_skilllist(), Colony::CreatePin(), Client::CreateShipSE(), Client::CynoJump(), Damage::Damage(), ModuleManager::DamageModule(), ActiveModule::Deactivate(), ModuleManager::Deactivate(), ActiveModule::DeactivateCycle(), ProbeItem::Delete(), AsteroidSE::Delete(), AttributeMap::DeleteAttribute(), ModuleManager::deleteModuleRef(), ModuleManager::DeOverload(), MiningLaser::Depleted(), Client::DestroyShipSE(), ShipItem::DissipateHeat(), DroneSE::DroneSE(), Prospector::DropSalvage(), Client::Eject(), MarketMgr::ExecuteBuyOrder(), ShipItem::FindAvailableModuleSlot(), EntityList::FindClientByName(), ShipItem::GenerateHeat(), GenericModule::GenericModule(), ShipItem::GetChargeState(), Character::GetCharInfo(), Skill::GetCurrentSP(), Character::GetEndOfTraining(), Client::GetName(), SystemEntity::GetName(), ShipItem::GetShipDNA(), ShipItem::GetShipInfo(), ShipItem::GetShipState(), Client::Handle_Notify(), IHubSE::Init(), SBUSE::Init(), TCUSE::Init(), TowerSE::Init(), CustomsSE::Init(), ReactorSE::Init(), StructureSE::Init(), ModuleManager::Initialize(), Character::InjectSkillIntoBrain(), ModuleManager::InstallRig(), ModuleManager::InstallSubSystem(), Sentry::Killed(), NPC::Killed(), StructureSE::Killed(), ShipSE::Killed(), ShipSE::LaunchDrone(), ActiveModule::LaunchMissile(), ActiveModule::LaunchProbe(), AttributeMap::Load(), TurretModule::LoadCharge(), ActiveModule::LoadCharge(), ModuleManager::LoadCharge(), ShipItem::LoadCharge(), Character::LoadPausedSkillQueue(), Client::LoadStationHangar(), ContainerSE::MakeSlimItem(), StationSE::MakeSlimItem(), WreckSE::MakeSlimItem(), ShipSE::MakeSlimItem(), Merge(), ShipItem::MergeModuleGroups(), MiningLaser::MiningLaser(), ModuleItem::ModuleItem(), Client::MoveItem(), InventoryBound::MoveItems(), ShipItem::MoveModuleSlot(), Client::MoveToLocation(), AttributeMap::MultiplyAttribute(), NPC::NPC(), GenericModule::Offline(), ModuleManager::Offline(), GenericModule::Online(), ModuleManager::Online(), ModuleManager::Overload(), Character::PauseSkillQueue(), ShipItem::PeelAndLink(), ActiveModule::Process(), SystemEntity::Process(), Client::ProcessClient(), MiningLaser::ProcessCycle(), GenericModule::ProcessEffects(), Client::ProcessNet(), WreckContainer::RemoveItem(), SolarSystem::RemoveItemFromInventory(), SystemManager::RemoveItemFromInventory(), ActiveModule::RemoveTarget(), TargetManager::RemoveTargetModule(), Rename(), StationItem::RentOffice(), GenericModule::Repair(), ShipItem::ReplaceCharges(), Client::ResetAfterPopped(), Character::SaveSkillQueue(), Client::SelfChatMessage(), AttributeMap::SendChanges(), Client::SendSessionChange(), CustomsSE::SetAnchor(), StructureSE::SetAnchor(), AttributeMap::SetAttribute(), Client::SetBallParkTimer(), Client::SetCloakTimer(), Client::SetInvulTimer(), ModuleItem::SetOnline(), Client::SetStateTimer(), ActiveModule::SetTimer(), Client::SetUncloakTimer(), ShipItem::ShipGetModuleList(), ShipItem::ShipItem(), ActiveModule::ShowEffect(), Character::SkillQueueLoop(), SolarSystem::SolarSystem(), Client::SpawnNewRookieShip(), Client::StargateJump(), StationItem::StationItem(), StationOffice::StationOffice(), StationOffice::StationOfficeGetInfo(), StructureItem::StructureGetInfo(), StructureItem::StructureItem(), ModuleManager::UnfitModule(), ModuleManager::UninstallRig(), TurretModule::UnloadCharge(), MiningLaser::UnloadCharge(), ActiveModule::UnloadCharge(), ModuleManager::UnloadCharge(), ModuleManager::UnloadModule(), Character::UpdateSkillQueueEndTime(), ShipItem::ValidateItemSpecifics(), CustomsSE::VerifyAddItem(), Skill::VerifyAttribs(), ShipItem::VerifyHoldType(), Skill::VerifySP(), WreckContainer::WreckContainer(), WreckContainer::WreckContainerGetInfo(), and Client::~Client().

107 { return m_data.name.c_str(); }
ItemData m_data
std::string name
Definition: ItemType.h:193
InventoryItem& InventoryItem::operator= ( const InventoryItem oth)
delete
InventoryItem& InventoryItem::operator= ( InventoryItem &&  oth)
delete
bool InventoryItem::Populate ( Rsp_CommonGetInfo_Entry &  into)
Todo:
this may need to be reworked once POS and Outposts are implemented.
Todo:
fix this once we start tracking effects

Definition at line 1205 of file InventoryItem.cpp.

References AttrOnline, AttrSkillLevel, AttrSkillPoints, AttrSkillTimeConstant, AttrWarpSpeedMultiplier, AttributeMap::begin(), ItemType::categoryID(), EVEDB::invCategories::Charge, AttributeMap::end(), ItemData::flag, EvilNumber::get_bool(), AttributeMap::GetAttribute(), GetAttribute(), GetFileTimeNow(), GetItemRow(), EvilNumber::GetPyObject(), ItemType::id(), IsCharacterID, IsFittingSlot, ItemData::locationID, m_data, m_itemID, m_type, EvE::Time::Minute, ItemData::name, ItemData::ownerID, pAttributeMap, PySafeDecRef, PyStatic, PyTuple::SetItem(), and EVEDB::invCategories::Skill.

Referenced by CargoContainer::CargoContainerGetInfo(), Character::GetCharInfo(), ShipItem::GetShipInfo(), ItemGetInfo(), StationOffice::StationOfficeGetInfo(), StructureItem::StructureGetInfo(), and WreckContainer::WreckContainerGetInfo().

1206 {
1209  //make sure trash data is removed from &result
1210  result.attributes.clear();
1211  PySafeDecRef(result.itemID);
1212  PySafeDecRef(result.invItem);
1213  result.time = GetFileTimeNow();
1214  // this is only to display item name in logs. client ignores it
1215  result.description = m_data.name;
1216 
1217  // updated charge info...again -allan 8Jan20
1219  and IsFittingSlot(m_data.flag)) {
1220  PyTuple* tuple = new PyTuple(3);
1221  tuple->SetItem(0, new PyInt(m_data.locationID));
1222  tuple->SetItem(1, new PyInt(m_data.flag));
1223  tuple->SetItem(2, new PyInt(m_type.id()));
1224  result.itemID = tuple;
1225  result.invItem = PyStatic.NewNone();
1226  for (AttrMapItr itr = pAttributeMap->begin(), end = pAttributeMap->end(); itr != end; ++itr)
1227  result.attributes[(*itr).first] = (*itr).second.GetPyObject();
1228  return true;
1229  }
1230 
1231  result.itemID = new PyInt(m_itemID);
1232  result.invItem = GetItemRow();
1233 
1236  result.attributes[AttrSkillPoints] = GetAttribute(AttrSkillPoints).GetPyObject();
1237  result.attributes[AttrSkillLevel] = GetAttribute(AttrSkillLevel).GetPyObject();
1238  return true;
1239  }
1240  //} else if (m_type.id() == 51) { // for vouchers
1241  // result.description = m_data.name;
1242 
1244  EntityEffectState es;
1245  es.env_itemID = m_itemID;
1246  es.env_charID = m_data.ownerID;
1247  es.env_shipID = m_data.locationID;
1248  es.env_target = m_data.locationID;
1249  es.env_other = PyStatic.NewNone();
1250  es.env_area = PyStatic.NewNone();
1251  es.env_effectID = 16;
1253  // on login, this is current time
1254  if (IsCharacterID(m_itemID)) {
1255  es.startTime = GetFileTimeNow() - EvE::Time::Minute; // m_timestamp
1256  } else {
1257  es.startTime = GetFileTimeNow() - EvE::Time::Minute; // GetAttribute(AttrStartTime).get_int();
1258  }
1259  es.duration = -1;
1260  es.repeat = 0;
1261  es.randomSeed = PyStatic.NewNone();
1262  result.activeEffects[es.env_effectID] = es.Encode();
1263  }
1264 
1265  for (AttrMapItr itr = pAttributeMap->begin(), end = pAttributeMap->end(); itr != end; ++itr) {
1266  //localization.GetByLabel('UI/Fitting/FittingWindow/WarpSpeed', distText=util.FmtDist(max(1.0, bws) * wsm * 3 * const.AU, 2))
1267  if ((*itr).first == AttrWarpSpeedMultiplier) {
1268  result.attributes[AttrWarpSpeedMultiplier] = new PyFloat((*itr).second.get_float() /3);
1269  } else {
1270  result.attributes[(*itr).first] = (*itr).second.GetPyObject();
1271  }
1272  }
1273 
1274  return true;
1275 }
PyPackedRow * GetItemRow() const
uint16 id() const
Definition: ItemType.h:63
ItemType m_type
uint32 locationID
Definition: ItemType.h:190
PyRep * GetPyObject()
converts the EvilNumber into a python object.
Definition: EvilNumber.cpp:109
bool get_bool()
Definition: EvilNumber.cpp:157
Python floating point number.
Definition: PyRep.h:292
ItemData m_data
AttrMapItr begin()
return the begin iterator of the AttributeMap
Python tuple.
Definition: PyRep.h:567
uint8 categoryID() const
Definition: ItemType.h:66
EvilNumber GetAttribute(const uint16 attrID) const
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
AttrMap::iterator AttrMapItr
Definition: AttributeMap.h:35
Python integer.
Definition: PyRep.h:231
#define PyStatic
Definition: PyRep.h:1209
#define IsFittingSlot(flag)
Definition: EVE_Defines.h:355
#define IsCharacterID(itemID)
Definition: EVE_Defines.h:206
EVEItemFlags flag
Definition: ItemType.h:187
double GetFileTimeNow()
Definition: utils_time.cpp:84
EvilNumber GetAttribute(const uint16 attrID) const
uint32 ownerID
Definition: ItemType.h:189
#define PySafeDecRef(op)
Definition: PyRep.h:61
AttributeMap * pAttributeMap
AttrMapItr end()
return the end iterator of the AttributeMap
std::string name
Definition: ItemType.h:193

Here is the call graph for this function:

Here is the caller graph for this function:

double InventoryItem::radius ( ) const
inline

Definition at line 112 of file InventoryItem.h.

References AttrRadius, GetAttribute(), and HasAttribute().

Referenced by ActiveModule::DeactivateCycle(), Client::Eject(), ShipSE::Killed(), ActiveModule::LaunchProbe(), CustomsSE::SetAnchor(), and StructureSE::SetAnchor().

112 { return (HasAttribute(AttrRadius) ? GetAttribute(AttrRadius).get_double() : 1.0); }
bool HasAttribute(const uint16 attrID) const
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::Relocate ( uint32  locID = 0,
EVEItemFlags  flag = flagNone 
)
virtual

Definition at line 821 of file InventoryItem.cpp.

References _log, AddItem(), Inv::Update::Flag, flag(), ItemData::flag, RefPtr< X >::get(), IsValidLocation, Inv::Update::Location, ItemData::locationID, m_data, m_itemID, ItemData::name, ItemData::ownerID, SendItemChange(), sItemFactory, and ItemDB::UpdateLocation().

821  {
822  if ((locID == m_data.locationID) and (flag == m_data.flag))
823  return; //nothing to do...
824 
825  InventoryItemRef iRef(nullptr);
826  uint32 old_location = m_data.locationID;
827  EVEItemFlags old_flag = m_data.flag;
828 
829  // update data
830  m_data.flag = flag;
831  m_data.locationID = locID;
832 
833  if ((old_location != m_data.locationID) // diff container
834  or ((old_location == m_data.locationID) // or same container
835  and (old_flag != m_data.flag))) { // but different flag
836  // add to new location
838  iRef = sItemFactory.GetItem(m_data.locationID);
839  if (iRef.get() != nullptr) {
840  iRef->AddItem(InventoryItemRef(this));
841  } else {
842  _log(ITEM__ERROR, "II::Relocate(): new location %u not found for %s.",
843  m_data.locationID, m_data.name.c_str());
844  }
845  }
846  }
847 
850 
851  //notify about the changes.
852  std::map<int32, PyRep *> changes;
853  if (m_data.locationID != old_location)
854  changes[Inv::Update::Location] = new PyInt(old_location);
855  if (m_data.flag != old_flag)
856  changes[Inv::Update::Flag] = new PyInt(old_flag);
857  SendItemChange(m_data.ownerID, changes); //changes is consumed
858 }
void SendItemChange(uint32 toID, std::map< int32, PyRep * > &changes)
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 locationID
Definition: ItemType.h:190
EVEItemFlags
Definition: EVE_Flags.h:13
ItemData m_data
Python integer.
Definition: PyRep.h:231
unsigned __int32 uint32
Definition: eve-compat.h:50
EVEItemFlags flag() const
EVEItemFlags flag
Definition: ItemType.h:187
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
static void UpdateLocation(uint32 itemID, uint32 locationID, EVEItemFlags flag)
Definition: ItemDB.cpp:212
uint32 ownerID
Definition: ItemType.h:189
#define sItemFactory
Definition: ItemFactory.h:165
std::string name
Definition: ItemType.h:193
#define IsValidLocation(itemID)
Definition: EVE_Defines.h:209

Here is the call graph for this function:

void InventoryItem::RemoveItem ( InventoryItemRef  iRef)
virtual

Reimplemented in WreckContainer, ShipItem, CargoContainer, StructureItem, and StationOffice.

Definition at line 574 of file InventoryItem.cpp.

References pInventory, and Inventory::RemoveItem().

Referenced by Donate(), Move(), StationOffice::RemoveItem(), StructureItem::RemoveItem(), CargoContainer::RemoveItem(), ShipItem::RemoveItem(), WreckContainer::RemoveItem(), and SolarSystem::RemoveItemFromInventory().

575 {
576  if (pInventory != nullptr) // just in case
577  pInventory->RemoveItem(iRef);
578 }
void RemoveItem(InventoryItemRef iRef)
Definition: Inventory.cpp:243
Inventory * pInventory

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::RemoveModifier ( fxData data)

Definition at line 1469 of file InventoryItem.cpp.

References m_modifiers, fxData::math, FX::Math::ModAdd, FX::Math::ModSub, FX::Math::PostAssignment, FX::Math::PostDiv, FX::Math::PostMul, FX::Math::PostPercent, FX::Math::PreAssignment, FX::Math::PreDiv, FX::Math::PreMul, and FX::Math::RevPostPercent.

Referenced by FxProc::ParseExpression().

1470 {
1471  switch (data.math) {
1472  case FX::Math::PreMul: data.math = FX::Math::PreDiv; break;
1473  case FX::Math::PreDiv: data.math = FX::Math::PreMul; break;
1474  case FX::Math::ModAdd: data.math = FX::Math::ModSub; break;
1475  case FX::Math::ModSub: data.math = FX::Math::ModAdd; break;
1476  case FX::Math::PostMul: data.math = FX::Math::PostDiv; break;
1477  case FX::Math::PostDiv: data.math = FX::Math::PostMul; break;
1481  }
1482  m_modifiers.emplace(data.math, data);
1483 }
std::multimap< int8, fxData > m_modifiers
int8 math
Definition: EffectsData.h:70

Here is the caller graph for this function:

void InventoryItem::Rename ( std::string  name)
virtual
Todo:
if renaming a POS or other space object, we'll need to BubblecastSendNotification instead of CorpNotify

Reimplemented in StructureItem.

Definition at line 629 of file InventoryItem.cpp.

References PyList::AddItem(), SystemBubble::BubblecastSendNotification(), Client::GetShipSE(), IsCharacterID, Client::IsDocked(), IsPlayerCorp, Notify::Types::ItemUpdateStation, Notify::Types::ItemUpdateSystem, ItemData::locationID, m_data, m_itemID, name(), ItemData::name, ItemData::ownerID, SaveItem(), sDataMgr, Client::SendNotification(), sEntityList, PyTuple::SetItem(), and SystemEntity::SysBubble().

Referenced by StructureItem::Rename().

630 {
631  m_data.name = name;
632  SaveItem();
633 
634  PyList* list = new PyList();
635  list->AddItem(new PyInt(m_itemID));
636  list->AddItem(new PyString(name));
637  list->AddItem(new PyFloat(0));
638  list->AddItem(new PyFloat(0));
639  list->AddItem(new PyFloat(0));
640  PyTuple* tuple = new PyTuple(2);
641  tuple->SetItem(0, new PyString("evelocations"));
642  tuple->SetItem(1, list);
643 
644  // get owner
646  // this will be the most-used case
647  Client* pClient = sEntityList.FindClientByCharID(m_data.ownerID);
648  if (pClient == nullptr)
649  return; // make error here?
650  if (pClient->IsDocked()) {
651  pClient->SendNotification("OnCfgDataChanged", "charid", &tuple, false); //unsequenced.
652  } else { // client in space. sent update to all clients in bubble
653  pClient->GetShipSE()->SysBubble()->BubblecastSendNotification("OnCfgDataChanged", "solarsystemid", &tuple, false);
654  }
655  } else if (IsPlayerCorp(m_data.ownerID)) {
656  // bcast to all online corp members
657  if (sDataMgr.IsStation(m_data.locationID)) {
658  sEntityList.CorpNotify(m_data.ownerID, Notify::Types::ItemUpdateStation, "OnCfgDataChanged", "charid", tuple);
659  } else {
660  sEntityList.CorpNotify(m_data.ownerID, Notify::Types::ItemUpdateSystem, "OnCfgDataChanged", "solarsystemid", tuple);
661  }
662  }
663 
665 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
Python string.
Definition: PyRep.h:430
uint32 locationID
Definition: ItemType.h:190
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
Python floating point number.
Definition: PyRep.h:292
void BubblecastSendNotification(const char *notifyType, const char *idType, PyTuple **payload, bool seq=true)
ItemData m_data
#define sEntityList
Definition: EntityList.h:208
const char * name()
Python tuple.
Definition: PyRep.h:567
void AddItem(PyRep *i)
Definition: PyRep.h:701
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
bool IsDocked()
Definition: Client.h:229
Python integer.
Definition: PyRep.h:231
#define IsPlayerCorp(itemID)
Definition: EVE_Defines.h:241
#define IsCharacterID(itemID)
Definition: EVE_Defines.h:206
Definition: Client.h:66
ShipSE * GetShipSE()
Definition: Client.h:168
uint32 ownerID
Definition: ItemType.h:189
std::string name
Definition: ItemType.h:193
Python list.
Definition: PyRep.h:639
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::ResetAttribute ( uint16  attrID,
bool  notify = false 
)
inline

Definition at line 320 of file InventoryItem.h.

References pAttributeMap, and AttributeMap::ResetAttribute().

Referenced by GenericModule::Repair(), and GenericModule::ResetAttribute().

320 { pAttributeMap->ResetAttribute(attrID, notify); }
void ResetAttribute(uint16 attrID, bool notify=false)
AttributeMap * pAttributeMap

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::ResetAttributes ( )

Definition at line 1491 of file InventoryItem.cpp.

References _log, AttributeMap::Load(), m_data, ItemData::name, and pAttributeMap.

Referenced by ShipItem::ProcessEffects(), ShipItem::ResetEffects(), and Character::ResetModifiers().

1491  {
1492  _log(EFFECTS__TRACE, "Resetting attrib map for %s", m_data.name.c_str());
1493  pAttributeMap->Load(true);
1494 }
#define _log(type, fmt,...)
Definition: logsys.h:124
ItemData m_data
bool Load(bool reset=false)
AttributeMap * pAttributeMap
std::string name
Definition: ItemType.h:193

Here is the call graph for this function:

Here is the caller graph for this function:

bool InventoryItem::SaveAttributes ( )
inline

Definition at line 319 of file InventoryItem.h.

References pAttributeMap, and AttributeMap::SaveAttributes().

Referenced by Character::SaveFullCharacter().

319 { return pAttributeMap->SaveAttributes(); }
bool SaveAttributes()
AttributeMap * pAttributeMap

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::SaveItem ( )

Definition at line 1096 of file InventoryItem.cpp.

References ItemData::contraband, customInfo(), ItemData::flag, ItemType::id(), ItemData::locationID, m_data, m_itemID, m_type, ItemData::name, ItemData::ownerID, pAttributeMap, ItemData::position, ItemData::quantity, AttributeMap::Save(), ItemDB::SaveItem(), and ItemData::singleton.

Referenced by Character::AddToSkillQueue(), Character::CancelSkillInTraining(), ChangeOwner(), ChangeSingleton(), Donate(), Character::LoadPausedSkillQueue(), Rename(), DroneSE::SaveDrone(), Character::SaveFullCharacter(), NPC::SaveNPC(), Sentry::SaveSentry(), ShipItem::SaveShip(), TowerSE::Scoop(), CustomsSE::SetAnchor(), StructureSE::SetAnchor(), SetCustomInfo(), SetQuantity(), Character::SkillQueueLoop(), and ModuleItem::Spawn().

1097 {
1098  ItemData data(m_data.name.c_str(),
1099  m_type.id(),
1100  m_data.ownerID,
1102  m_data.flag,
1104  m_data.singleton,
1105  m_data.quantity,
1106  m_data.position,
1107  customInfo().c_str()
1108  );
1109 
1110  ItemDB::SaveItem(m_itemID, data);
1111  // item attributes are saved in ItemFactory.cpp:96 (save loop on shutdown for loaded items)
1112  // make call here for items saved after *some* change
1113  pAttributeMap->Save();
1114 }
static bool SaveItem(uint32 itemID, const ItemData &data)
Definition: ItemDB.cpp:219
uint16 id() const
Definition: ItemType.h:63
ItemType m_type
uint32 locationID
Definition: ItemType.h:190
const std::string & customInfo() const
GPoint position
Definition: ItemType.h:192
ItemData m_data
uint32 quantity
Definition: ItemType.h:191
EVEItemFlags flag
Definition: ItemType.h:187
uint32 ownerID
Definition: ItemType.h:189
bool contraband
Definition: ItemType.h:185
AttributeMap * pAttributeMap
std::string name
Definition: ItemType.h:193
bool singleton
Definition: ItemType.h:186

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::SendItemChange ( uint32  toID,
std::map< int32, PyRep * > &  changes 
)

Definition at line 1058 of file InventoryItem.cpp.

References _log, PyRep::Dump(), GetItemRow(), is_log_enabled, IsCharacterID, Client::IsCharCreation(), IsFaction, IsNPCCorp, IsPlayerCorp, Notify::Types::ItemUpdateStation, Notify::Types::ItemUpdateSystem, ItemData::locationID, m_data, m_itemID, ItemData::name, sConsole, sDataMgr, Client::SendNotification(), and sEntityList.

Referenced by ChangeOwner(), ChangeSingleton(), Donate(), Move(), Relocate(), SetFlag(), SetQuantity(), and ToVirtual().

1058  {
1059  if (IsNPCCorp(toID) or (toID == 1) or IsFaction(toID)) //IsValidOwner()
1060  return;
1061  if (sConsole.IsShutdown())
1062  return;
1063  if (changes.empty())
1064  return;
1065 
1066  NotifyOnItemChange change;
1067  change.itemRow = GetItemRow();
1068  change.changes = changes;
1069  PyTuple *tmp = change.Encode();
1070 
1071  if (is_log_enabled(ITEM__CHANGE)) {
1072  _log(ITEM__CHANGE, "Sending Item changes for %s(%u)", m_data.name.c_str(), m_itemID);
1073  tmp->Dump(ITEM__CHANGE, " ");
1074  }
1075 
1076  //TODO: figure out the appropriate list of interested people...
1077  if (IsCharacterID(toID)) {
1078  Client* pClient = sEntityList.FindClientByCharID(toID);
1079  if (pClient == nullptr)
1080  return;
1081  if (pClient->IsCharCreation())
1082  return;
1083  //if (IsShipItem()) //(pClient->IsBoard())
1084  // pClient->SendNotification("OnItemsChanged", "charid", &tmp, false); //unsequenced. <<-- this is called for multiple items
1085  //else
1086  pClient->SendNotification("OnItemChange", "clientID", &tmp, false); //unsequenced. <<-- this is for single items
1087  } else if (IsPlayerCorp(toID)) {
1088  if (sDataMgr.IsStation(m_data.locationID)) {
1089  sEntityList.CorpNotify(toID, Notify::Types::ItemUpdateStation, "OnItemChange","*stationid&corpid", tmp);
1090  } else {
1091  sEntityList.CorpNotify(toID, Notify::Types::ItemUpdateSystem, "OnItemChange","corpid", tmp);
1092  }
1093  }
1094 }
PyPackedRow * GetItemRow() const
#define IsNPCCorp(itemID)
Definition: EVE_Defines.h:238
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
#define _log(type, fmt,...)
Definition: logsys.h:124
#define sConsole
uint32 locationID
Definition: ItemType.h:190
bool IsCharCreation()
Definition: Client.h:433
ItemData m_data
#define sEntityList
Definition: EntityList.h:208
Python tuple.
Definition: PyRep.h:567
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
#define is_log_enabled(type)
Definition: logsys.h:78
#define IsPlayerCorp(itemID)
Definition: EVE_Defines.h:241
#define IsCharacterID(itemID)
Definition: EVE_Defines.h:206
Definition: Client.h:66
#define IsFaction(itemID)
Definition: EVE_Defines.h:250
std::string name
Definition: ItemType.h:193
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::SetAttribute ( uint16  attrID,
int  num,
bool  notify = true 
)

Definition at line 1335 of file InventoryItem.cpp.

References pAttributeMap, and AttributeMap::SetAttribute().

Referenced by ShipItem::_Load(), ShipSE::AbandonDrones(), ShipItem::AddItem(), ModuleManager::addModuleRef(), ShipSE::ApplyBoost(), TurretModule::ApplyDamage(), SystemEntity::ApplyDamage(), DynamicEntityFactory::BuildEntity(), Character::CancelSkillInTraining(), ChangeSingleton(), Concord::Concord(), ContainerSE::ContainerSE(), ItemType::CopyAttributes(), CynoModule::DeactivateCycle(), ModuleManager::deleteModuleRef(), DroneSE::DroneSE(), IHubSE::Init(), SBUSE::Init(), TCUSE::Init(), CustomsSE::Init(), ShipItem::InitAttribs(), ShipItem::InitPod(), DestinyManager::InitWarp(), ShipSE::LaunchDrone(), ShipItem::LogOut(), NPC::NPC(), GenericModule::Offline(), GenericModule::Online(), ShipSE::Process(), ActiveModule::ProcessActiveCycle(), MiningLaser::ProcessCycle(), ShipItem::ProcessHeat(), ShipSE::RemoveBoost(), ShipItem::RemoveItem(), RigModule::RemoveRig(), ShipItem::RepairShip(), Character::SaveFullCharacter(), ShipSE::ScoopDrone(), Sentry::Sentry(), GenericModule::SetAttribute(), ModuleItem::SetOnline(), ShipItem::SetPlayer(), SetQuantity(), Sentry::SetResists(), NPC::SetResists(), Concord::SetResists(), DroneSE::SetResists(), ShipItem::SetShipArmor(), ShipItem::SetShipCapacitorLevel(), ShipItem::SetShipHull(), ShipItem::SetShipShield(), Character::SkillQueueLoop(), CargoContainer::Spawn(), WreckContainer::Spawn(), Spawn(), StationSE::StationSE(), ActiveModule::UnloadCharge(), ActiveModule::UpdateCharge(), ActiveModule::UpdateDamage(), ShipItem::UpdateMass(), ModuleManager::UpdateModules(), NPC::UseArmorRepairer(), NPC::UseHullRepairer(), NPC::UseShieldRecharge(), Skill::VerifyAttribs(), Skill::VerifySP(), and WreckSE::WreckSE().

1336 {
1337  EvilNumber eNum(num);
1338  pAttributeMap->SetAttribute(attrID, eNum, notify);
1339 }
void SetAttribute(uint16 attrID, EvilNumber &num, bool notify=true)
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
AttributeMap * pAttributeMap

Here is the call graph for this function:

void InventoryItem::SetAttribute ( uint16  attrID,
uint32  num,
bool  notify = true 
)

Definition at line 1347 of file InventoryItem.cpp.

References pAttributeMap, and AttributeMap::SetAttribute().

1348 {
1349  EvilNumber eNum(num);
1350  pAttributeMap->SetAttribute(attrID, eNum, notify);
1351 }
void SetAttribute(uint16 attrID, EvilNumber &num, bool notify=true)
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
AttributeMap * pAttributeMap

Here is the call graph for this function:

void InventoryItem::SetAttribute ( uint16  attrID,
int64  num,
bool  notify = true 
)

Definition at line 1341 of file InventoryItem.cpp.

References pAttributeMap, and AttributeMap::SetAttribute().

1342 {
1343  EvilNumber eNum(num);
1344  pAttributeMap->SetAttribute(attrID, eNum, notify);
1345 }
void SetAttribute(uint16 attrID, EvilNumber &num, bool notify=true)
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
AttributeMap * pAttributeMap

Here is the call graph for this function:

void InventoryItem::SetAttribute ( uint16  attrID,
float  num,
bool  notify = true 
)

Definition at line 1318 of file InventoryItem.cpp.

References pAttributeMap, and AttributeMap::SetAttribute().

1319 {
1320  EvilNumber eNum(num);
1321  pAttributeMap->SetAttribute(attrID, eNum, notify);
1322 }
void SetAttribute(uint16 attrID, EvilNumber &num, bool notify=true)
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
AttributeMap * pAttributeMap

Here is the call graph for this function:

void InventoryItem::SetAttribute ( uint16  attrID,
double  num,
bool  notify = true 
)

Definition at line 1324 of file InventoryItem.cpp.

References pAttributeMap, and AttributeMap::SetAttribute().

1325 {
1326  EvilNumber eNum(num);
1327  pAttributeMap->SetAttribute(attrID, eNum, notify);
1328 }
void SetAttribute(uint16 attrID, EvilNumber &num, bool notify=true)
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
AttributeMap * pAttributeMap

Here is the call graph for this function:

void InventoryItem::SetAttribute ( uint16  attrID,
EvilNumber  num,
bool  notify = true 
)

Definition at line 1330 of file InventoryItem.cpp.

References pAttributeMap, and AttributeMap::SetAttribute().

1331 {
1332  pAttributeMap->SetAttribute(attrID, num, notify);
1333 }
void SetAttribute(uint16 attrID, EvilNumber &num, bool notify=true)
AttributeMap * pAttributeMap

Here is the call graph for this function:

void InventoryItem::SetCustomInfo ( const char *  ci)

Definition at line 1292 of file InventoryItem.cpp.

References ItemData::customInfo, m_data, SaveItem(), and sConfig.

Referenced by Client::Board(), Client::BoardShip(), Client::Eject(), Client::MoveToLocation(), Client::UpdateNewShip(), Client::WarpIn(), and Client::WarpOut().

1292  {
1293  if (ci != nullptr) {
1294  m_data.customInfo = ci;
1295  } else {
1296  m_data.customInfo = "";
1297  }
1298 
1299  if (sConfig.world.saveOnUpdate)
1300  SaveItem();
1301 }
#define sConfig
A macro for easier access to the singleton.
ItemData m_data
std::string customInfo
Definition: ItemType.h:194

Here is the call graph for this function:

Here is the caller graph for this function:

bool InventoryItem::SetFlag ( EVEItemFlags  flag,
bool  notify = false 
)

Definition at line 988 of file InventoryItem.cpp.

References Inv::Update::Flag, flag(), ItemData::flag, ItemData::locationID, m_data, m_itemID, ItemData::ownerID, SendItemChange(), and ItemDB::UpdateLocation().

Referenced by Character::AddToSkillQueue(), Client::Board(), Character::CancelSkillInTraining(), Client::Eject(), Character::GetEndOfTraining(), CustomsSE::Init(), StructureSE::Init(), Character::LoadPausedSkillQueue(), StructureSE::Process(), StructureSE::SetOffline(), TowerSE::SetOnline(), StructureSE::SetOnline(), ShipItem::SetPlayer(), Character::SkillQueueLoop(), Client::WarpIn(), and Client::WarpOut().

988  {
989  if (m_data.flag == flag)
990  return true;
991 
992  EVEItemFlags old_flag = m_data.flag;
993  m_data.flag = flag;
994 
996 
997  if (notify) {
998  std::map<int32, PyRep *> changes;
999  changes[Inv::Update::Flag] = new PyInt(old_flag);
1000  SendItemChange(m_data.ownerID, changes); //changes is consumed
1001  }
1002 
1003  return true;
1004 }
void SendItemChange(uint32 toID, std::map< int32, PyRep * > &changes)
uint32 locationID
Definition: ItemType.h:190
EVEItemFlags
Definition: EVE_Flags.h:13
ItemData m_data
Python integer.
Definition: PyRep.h:231
EVEItemFlags flag() const
EVEItemFlags flag
Definition: ItemType.h:187
static void UpdateLocation(uint32 itemID, uint32 locationID, EVEItemFlags flag)
Definition: ItemDB.cpp:212
uint32 ownerID
Definition: ItemType.h:189

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::SetOwner ( uint32  ownerID)
inline

Definition at line 137 of file InventoryItem.h.

References m_data, ownerID(), and ItemData::ownerID.

137 { m_data.ownerID = ownerID; }
uint32 ownerID() const
Definition: InventoryItem.h:99
ItemData m_data
uint32 ownerID
Definition: ItemType.h:189

Here is the call graph for this function:

virtual void InventoryItem::SetPlayer ( Client pClient)
inlinevirtual

Reimplemented in ShipItem.

Definition at line 174 of file InventoryItem.h.

Referenced by ShipSE::SetPilot().

174 { /* do nothing here */ }

Here is the caller graph for this function:

void InventoryItem::SetPosition ( const GPoint pos)

Definition at line 1303 of file InventoryItem.cpp.

References _log, m_data, m_itemID, ItemData::name, ItemData::position, Ga::GaVec3::x, Ga::GaVec3::y, and Ga::GaVec3::z.

Referenced by Client::Board(), Client::BoardShip(), Client::Eject(), ShipSE::LaunchDrone(), Client::MoveToLocation(), ProbeSE::ProcessTic(), ProbeSE::RemoveProbe(), Client::ResetAfterPopped(), ProbeSE::SendWarpEnd(), and SystemEntity::SetPosition().

1304 {
1305  if (m_data.position == pos)
1306  return;
1307  /*
1308  if (pos.isZero() and sDataMgr.IsSolarSystem(m_data.locationID)) {
1309  _log(DESTINY__TRACE, "II::SetPosition() - %s(%u) point is zero", m_data.name.c_str(), m_itemID);
1310  EvE::traceStack();
1311  } */
1312 
1313  m_data.position = pos;
1314  _log(ITEM__RELOCATE, "%s(%u) Relocating to %.2f, %.2f, %.2f.", m_data.name.c_str(), \
1316 }
#define _log(type, fmt,...)
Definition: logsys.h:124
GPoint position
Definition: ItemType.h:192
ItemData m_data
GaFloat x
Definition: GaTypes.h:207
GaFloat y
Definition: GaTypes.h:207
std::string name
Definition: ItemType.h:193
GaFloat z
Definition: GaTypes.h:207

Here is the caller graph for this function:

bool InventoryItem::SetQuantity ( int32  qty,
bool  notify = false,
bool  deleteOnZero = true 
)

Definition at line 943 of file InventoryItem.cpp.

References _log, AttrQuantity, ItemType::categoryID(), EVEDB::invCategories::Charge, codelog, Delete(), ItemData::flag, IsCargoHoldFlag, IsCharacterID, IsFittingSlot, Client::IsInSpace(), m_data, m_itemID, m_type, maxEveItem, ItemData::name, ItemData::ownerID, ItemData::quantity, SaveItem(), sConfig, Client::SendInfoModalMsg(), SendItemChange(), sEntityList, SetAttribute(), ItemData::singleton, and Inv::Update::StackSize.

Referenced by AlterQuantity(), and Colony::CreatePin().

943  {
944  //if an object is singleton, there is only one, and it shouldn't be able to alter qty
945  if (m_data.singleton) {
946  _log(ITEM__ERROR, "II::SetQuantity() - %s(%u): Failed to set quantity %i; the items singleton bit is set", m_data.name.c_str(), m_itemID, qty);
947  // make player error msg here.....
948  return false;
949  }
950  int32 old_qty = m_data.quantity;
951  m_data.quantity = qty;
952 
953  if (m_data.quantity > maxEveItem) {
954  codelog(ITEM__ERROR, "II::SetQuantity() - %s(%u): quantity overflow", m_data.name.c_str(), m_itemID);
957  Client* pClient = sEntityList.FindClientByCharID(m_data.ownerID);
958  if (pClient != nullptr)
959  pClient->SendInfoModalMsg("Your %s has reached quantity limits of this server.<br>If you try to add any more to this stack, you will lose items. This is your only warning.", m_data.name.c_str());
960  }
961  }
962 
964  std::map<int32, PyRep *> changes;
965  changes[Inv::Update::StackSize] = new PyInt(old_qty);
966  SendItemChange(m_data.ownerID, changes); //changes is consumed
967  }
968 
969  // how are we gonna do modules owned by corp here???
971  if (IsCharacterID(m_data.ownerID)/* or IsPlayerCorp(m_data.ownerID)*/) {
972  Client* pClient = sEntityList.FindClientByCharID(m_data.ownerID);
973  SetAttribute(AttrQuantity, m_data.quantity, pClient == nullptr ? notify : pClient->IsInSpace());
974  }
975 
976  if (m_data.quantity < 1) {
977  if (deleteOnZero)
978  Delete();
979  return true;
980  }
981 
982  if (sConfig.world.saveOnUpdate)
983  SaveItem();
984 
985  return true;
986 }
#define sConfig
A macro for easier access to the singleton.
void SendItemChange(uint32 toID, std::map< int32, PyRep * > &changes)
#define _log(type, fmt,...)
Definition: logsys.h:124
ItemType m_type
#define maxEveItem
Definition: EVE_Defines.h:166
void SendInfoModalMsg(const char *fmt,...)
Definition: Client.cpp:2756
ItemData m_data
#define sEntityList
Definition: EntityList.h:208
bool IsInSpace()
Definition: Client.h:228
uint8 categoryID() const
Definition: ItemType.h:66
signed __int32 int32
Definition: eve-compat.h:49
#define codelog(type, fmt,...)
Definition: logsys.h:128
Python integer.
Definition: PyRep.h:231
void SetAttribute(uint16 attrID, int num, bool notify=true)
#define IsFittingSlot(flag)
Definition: EVE_Defines.h:355
uint32 quantity
Definition: ItemType.h:191
#define IsCharacterID(itemID)
Definition: EVE_Defines.h:206
Definition: Client.h:66
EVEItemFlags flag
Definition: ItemType.h:187
#define IsCargoHoldFlag(flag)
Definition: EVE_Defines.h:336
uint32 ownerID
Definition: ItemType.h:189
virtual void Delete()
std::string name
Definition: ItemType.h:193
bool singleton
Definition: ItemType.h:186

Here is the call graph for this function:

Here is the caller graph for this function:

bool InventoryItem::SkillCheck ( InventoryItemRef  refItem)

Definition at line 1437 of file InventoryItem.cpp.

References HasAttribute().

1438 {
1439  EvilNumber need = 0, has = 0;
1440  uint16 attr = 182, skill = 277;
1441  for (int8 i = 0; i < 3; ++i, ++attr, ++skill) {
1442  if (refItem->HasAttribute(attr, need) and HasAttribute(skill, has)) {
1443  if (need > has)
1444  return false;
1445  }
1446  }
1447  if (refItem->HasAttribute(1285, need) and HasAttribute(1286, has)) {
1448  if (need > has)
1449  return false;
1450  }
1451 
1452  attr = 1289; skill = 1287;
1453  for (int8 i = 0; i < 2; ++i, ++attr, ++skill) {
1454  if (refItem->HasAttribute(attr, need) and HasAttribute(skill, has)) {
1455  if (need > has)
1456  return false;
1457  }
1458  }
1459  // all skill requirement checks passed.
1460  return true;
1461 }
bool HasAttribute(const uint16 attrID) const
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
signed __int8 int8
Definition: eve-compat.h:45
unsigned __int16 uint16
Definition: eve-compat.h:48

Here is the call graph for this function:

InventoryItemRef InventoryItem::Spawn ( ItemData data)
static

TODO not handled....use generic item

Definition at line 391 of file InventoryItem.cpp.

References _log, EVEDB::invCategories::Accessories, EVEDB::invCategories::AncientRelics, EVEDB::invCategories::Asteroid, AttrArmorDamage, AttrCapacity, AttrMass, AttrRadius, AttrShieldCapacity, AttrShieldCharge, AttrVolume, EVEDB::invGroups::Audit_Log_Secure_Container, EVEDB::invGroups::Billboard, EVEDB::invCategories::Blueprint, EVEDB::invCategories::Bonus, ItemType::capacity(), EVEDB::invGroups::Capture_Point, EVEDB::invGroups::Cargo_Container, ItemType::categoryID(), EVEDB::invCategories::Celestial, EVEDB::invCategories::Charge, codelog, EVEDB::invCategories::Commodity, EVEDB::invGroups::Control_Bunker, StationItem::CreateItemID(), CreateItemID(), CreateTempItemID(), EVEDB::invCategories::Decryptors, EVEDB::invCategories::Deployable, EVEDB::invCategories::Drone, EVEDB::invCategories::Entity, EvilZero, ItemData::flag, flagMissile, EVEDB::invGroups::Force_Field, EVEDB::invGroups::Freight_Container, RefPtr< X >::get(), GetAttribute(), ItemType::groupID(), ItemType::id(), EVEDB::invCategories::Implant, itemID(), StationItem::Load(), ItemData::locationID, ItemType::mass(), EVEDB::invCategories::Material, EVEDB::invGroups::Mission_Container, EVEDB::invCategories::Module, EVEDB::invGroups::Obsolete_Probes, EVEDB::invCategories::Orbitals, EVEDB::invCategories::Owner, EVEDB::invCategories::PlanetaryCommodities, EVEDB::invCategories::PlanetaryInteraction, EVEDB::invCategories::PlanetaryResources, ItemType::radius(), EVEDB::invCategories::Reaction, EvERam::bpData::runs, EVEDB::invGroups::Scanner_Probe, sConfig, EVEDB::invGroups::Secure_Cargo_Container, EVEDB::invGroups::Sentry_Gun, SetAttribute(), EVEDB::invCategories::Ship, sItemFactory, EVEDB::invCategories::Skill, EVEDB::invCategories::SovereigntyStructure, ModuleItem::Spawn(), StructureItem::Spawn(), ProbeItem::Spawn(), CargoContainer::Spawn(), CelestialObject::Spawn(), ShipItem::Spawn(), Skill::Spawn(), Blueprint::Spawn(), WreckContainer::Spawn(), EVEDB::invGroups::Spawn_Container, SpawnItem(), EVEDB::invCategories::Station, EVEDB::invGroups::Station, EVEDB::invGroups::Station_Services, EVEDB::invCategories::Structure, EVEDB::invCategories::StructureUpgrade, EVEDB::invCategories::Subsystem, EVEDB::invGroups::Survey_Probe, EVEDB::invGroups::Temporary_Cloud, EVEDB::invCategories::Trading, ItemData::typeID, ItemType::volume(), EVEDB::invGroups::Warp_Disruption_Probe, and EVEDB::invGroups::Wreck.

Referenced by ItemFactory::SpawnItem().

392 {
393  // obtain type of new item
394  const ItemType *iType = sItemFactory.GetType(data.typeID);
395  if (iType == nullptr) {
396  codelog(ITEM__ERROR, "II::Spawn() - Invalid type returned for typeID %u", data.typeID);
397  return InventoryItemRef(nullptr);
398  }
399 
400  switch(iType->categoryID() ) { //23
402  assert(0); // this needs to make a serious error here....these CANNOT be called from here using the generic InventoryItem::Spawn() method
403  } break;
405  case EVEDB::invCategories::Bonus: // no clue what this is
408  case EVEDB::invCategories::Asteroid: // ore is "asteroid" also
409  case EVEDB::invCategories::Material: // includes minerals
412  case EVEDB::invCategories::Accessories: // this is for bookmark vouchers
413  case EVEDB::invCategories::AncientRelics: // t3 bpc from sleepers
414  // these *may* need their own class
420  _log(ITEM__WARNING, "II::Spawn creating generic item for type %u, cat %u.", iType->id(), iType->categoryID());
421  // Spawn generic item:
423  return InventoryItem::SpawnItem(itemID, data);
424  } break;
428  return StructureItem::Spawn(data);
429  } break;
431  // this needs to distinguish between copy and orig
432  EvERam::bpData bdata = EvERam::bpData();
433  bdata.runs = -1;
434  return Blueprint::Spawn(data, bdata);
435  } break;
437  return Skill::Spawn(data);
438  } break;
440  return ShipItem::Spawn(data);
441  } break;
443  switch (iType->groupID()) {
445  return CargoContainer::Spawn(data);
446  } break;
451  return InventoryItem::SpawnItem(itemID, data);
452  } break;
453  case EVEDB::invGroups::Sentry_Gun: // these are not saved
455  default: { // *should* be all npcs
456  // use temp items and NOT save to db.
458  return InventoryItem::SpawnItem(itemID, data);
459  } break;
460  }
461  } break;
464  return ModuleItem::Spawn(data);
465  } break;
467  if (!sConfig.testing.EnableDrones)
468  return InventoryItemRef(nullptr);
469  //return DroneItem::Spawn(data);
470  } // allow fallthru until DroneItem is written
472  // Spawn generic item:
474  InventoryItemRef itemRef = InventoryItem::SpawnItem(itemID, data);
475  if (itemRef.get() == nullptr)
476  return InventoryItemRef(nullptr);
477  // THESE SHOULD BE MOVED INTO A _type::Spawn() function that does not exist yet
478  itemRef->SetAttribute(AttrMass, iType->mass(), false); // Mass
479  itemRef->SetAttribute(AttrRadius, iType->radius(), false); // Radius
480  itemRef->SetAttribute(AttrVolume, iType->volume(), false); // Volume
481  itemRef->SetAttribute(AttrCapacity, iType->capacity(), false); // Capacity
482  return itemRef;
483  } break;
485  uint32 itemID = 0;
486  InventoryItemRef itemRef;
487  switch (data.flag) {
489  // Spawn launched missile item in MISSILE_ID range and does NOT save missile to db
490  itemID = InventoryItem::CreateTempItemID(data);
491  itemRef = InventoryItem::SpawnItem(itemID, data);
492  } break;
493  default: {
494  switch (iType->groupID()) {
498  return ProbeItem::Spawn(data);
499  } break;
501  // make error for these
502  _log(ITEM__ERROR, "II::Spawn - Obsolete Probe group called.");
503  return InventoryItemRef(nullptr);
504  }
505  default: {
506  // create generic item for other charge types
507  itemID = InventoryItem::CreateItemID(data);
508  itemRef = InventoryItem::SpawnItem(itemID, data);
509  } break;
510  }
511  }
512  }
513  if (itemRef.get() == nullptr)
514  return InventoryItemRef(nullptr);
515  itemRef->SetAttribute(AttrMass, iType->mass(), false); // Mass
516  itemRef->SetAttribute(AttrRadius, iType->radius(), false); // Radius
517  return itemRef;
518  } break;
520  if (iType->groupID() == EVEDB::invGroups::Station) {
521  uint32 itemID = StationItem::CreateItemID(data);
522  if (itemID == 0)
523  return StationItemRef(nullptr);
524  StationItemRef stationRef = StationItem::Load(itemID);
525  if (stationRef.get() == nullptr)
526  return StationItemRef(nullptr);
527  // THESE SHOULD BE MOVED INTO A Station::Spawn() function that does not exist yet
528  stationRef->SetAttribute(AttrShieldCharge, stationRef->GetAttribute(AttrShieldCapacity), false); // Shield Charge
529  stationRef->SetAttribute(AttrArmorDamage, EvilZero, false); // Armor Damage
530  stationRef->SetAttribute(AttrMass, iType->mass(), false); // Mass
531  stationRef->SetAttribute(AttrRadius, iType->radius(), false); // Radius
532  stationRef->SetAttribute(AttrVolume, iType->volume(), false); // Volume
533  stationRef->SetAttribute(AttrCapacity, iType->capacity(), false); // Capacity
534  return stationRef;
535  } else if (iType->groupID() == EVEDB::invGroups::Station_Services) {
536  // this should never hit...throw error
537  codelog(INV__ERROR, "II::Spawn called for unhandled item type %u, cat %u in locID: %u.", iType->id(), iType->categoryID(), data.locationID);
538  }
539  } break;
545  or (iType->groupID() == EVEDB::invGroups::Mission_Container)) {
546  return CargoContainer::Spawn(data);
547  } else if (iType->groupID() == EVEDB::invGroups::Wreck) {
548  return WreckContainer::Spawn(data);
549  } else if (iType->groupID() == EVEDB::invGroups::Force_Field) {
550  // Spawn force field item in TEMP_ENTITY_ID range and does NOT save Force_Field to db
552  return InventoryItem::SpawnItem(itemID, data);
553  } else {
554  // Spawn new Celestial Object
555  return CelestialObject::Spawn(data);
556  }
557  } break;
558  }
559 
560  // log error and return nullref for items not handled here
561  _log(ITEM__WARNING, "II::Spawn item not handled - type %u, grp %u, cat %u.", iType->id(), iType->groupID(), iType->categoryID());
562  return InventoryItemRef(nullptr);
563 }
#define sConfig
A macro for easier access to the singleton.
RefPtr< StationItem > StationItemRef
Definition: ItemRef.h:66
static ShipItemRef Spawn(ItemData &data)
Definition: Ship.cpp:51
static InventoryItemRef SpawnItem(uint32 itemID, const ItemData &data)
#define _log(type, fmt,...)
Definition: logsys.h:124
uint16 id() const
Definition: ItemType.h:63
uint32 locationID
Definition: ItemType.h:190
uint16 groupID() const
Definition: ItemType.h:64
static StationItemRef Load(uint32 stationID)
Definition: Station.cpp:82
static SkillRef Spawn(ItemData &data)
Definition: Skill.cpp:52
static CelestialObjectRef Spawn(ItemData &data)
Definition: Celestial.cpp:72
float capacity() const
Definition: ItemType.h:71
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
uint8 categoryID() const
Definition: ItemType.h:66
static ModuleItemRef Spawn(ItemData &data)
Definition: ModuleItem.cpp:27
#define codelog(type, fmt,...)
Definition: logsys.h:128
float mass() const
Definition: ItemType.h:69
static uint32 CreateTempItemID(ItemData &data)
void SetAttribute(uint16 attrID, int num, bool notify=true)
static CargoContainerRef Spawn(ItemData &data)
Definition: Container.cpp:70
X * get() const
Definition: RefPtr.h:213
static WreckContainerRef Spawn(ItemData &data)
Definition: Container.cpp:410
static ProbeItemRef Spawn(ItemData &data)
Definition: Probes.cpp:52
unsigned __int32 uint32
Definition: eve-compat.h:50
uint16 typeID
Definition: ItemType.h:188
EVEItemFlags flag
Definition: ItemType.h:187
static BlueprintRef Spawn(ItemData &data, EvERam::bpData &bdata)
Definition: Blueprint.cpp:71
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
static uint32 CreateItemID(ItemData &data)
Definition: Station.cpp:106
static uint32 CreateItemID(ItemData &data)
EvilNumber GetAttribute(const uint16 attrID) const
float radius() const
Definition: ItemType.h:68
float volume() const
Definition: ItemType.h:70
#define sItemFactory
Definition: ItemFactory.h:165
int16 runs
Definition: EVE_RAM.h:110
static StructureItemRef Spawn(ItemData &data)
Definition: Structure.cpp:71
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

InventoryItemRef InventoryItem::SpawnItem ( uint32  itemID,
const ItemData data 
)
static

Definition at line 138 of file InventoryItem.cpp.

References _Load(), RefPtr< X >::get(), InventoryItem(), ItemData::quantity, sItemFactory, and ItemData::typeID.

Referenced by WormholeMgr::Create(), DungeonMgr::Create(), Spawn(), and SpawnTemp().

139 {
140  if (data.quantity == 0)
141  return InventoryItemRef(nullptr);
142  const ItemType *iType = sItemFactory.GetType(data.typeID);
143  if (iType == nullptr)
144  return InventoryItemRef(nullptr);
145  InventoryItemRef iRef = InventoryItemRef(new InventoryItem(itemID, *iType, data));
146  if (iRef.get() != nullptr)
147  iRef->_Load();
148 
149  return iRef;
150 }
virtual bool _Load()
X * get() const
Definition: RefPtr.h:213
uint32 quantity
Definition: ItemType.h:191
uint16 typeID
Definition: ItemType.h:188
InventoryItem(uint32 _itemID, const ItemType &_type, const ItemData &_data)
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
#define sItemFactory
Definition: ItemFactory.h:165
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

InventoryItemRef InventoryItem::SpawnTemp ( ItemData data)
static
Todo:
will need to update this to get 'proper' item creation for temps...

Definition at line 373 of file InventoryItem.cpp.

References EVEDB::invGroups::Cargo_Container, codelog, CreateTempItemID(), ItemType::groupID(), sItemFactory, SpawnItem(), CargoContainer::SpawnTemp(), and ItemData::typeID.

Referenced by SystemBubble::MarkBubble(), and ItemFactory::SpawnTempItem().

374 {
376  // for now, return generic item
377  // obtain type of new item
378  const ItemType *iType = sItemFactory.GetType(data.typeID);
379  if (iType == nullptr) {
380  codelog(ITEM__ERROR, "II::SpawnTemp() - Invalid type returned for typeID %u", data.typeID);
381  return InventoryItemRef(nullptr);
382  }
383 
385  return CargoContainer::SpawnTemp(data);
386 
388 }
static InventoryItemRef SpawnItem(uint32 itemID, const ItemData &data)
uint16 groupID() const
Definition: ItemType.h:64
static CargoContainerRef SpawnTemp(ItemData &data)
Definition: Container.cpp:87
#define codelog(type, fmt,...)
Definition: logsys.h:128
static uint32 CreateTempItemID(ItemData &data)
uint16 typeID
Definition: ItemType.h:188
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
#define sItemFactory
Definition: ItemFactory.h:165

Here is the call graph for this function:

Here is the caller graph for this function:

InventoryItemRef InventoryItem::Split ( int32  qty = 0,
bool  notify = true,
bool  silent = false 
)
virtual

Definition at line 799 of file InventoryItem.cpp.

References _log, AlterQuantity(), ItemData::flag, ItemType::id(), ItemData::locationID, locTemp, m_data, m_itemID, m_type, Move(), ItemData::name, ItemData::ownerID, and sItemFactory.

Referenced by MarketMgr::ExecuteBuyOrder(), InventoryBound::MoveItems(), and Blueprint::SplitBlueprint().

799  {
800  if (qty < 1) {
801  _log(ITEM__ERROR, "II::Split() - %s(%u): Asked to split into a chunk of %i", m_data.name.c_str(), m_itemID, qty);
802  return InventoryItemRef(nullptr);
803  }
804  if (!AlterQuantity(-qty, notify)) {
805  _log(ITEM__ERROR, "II::Split() - %s(%u): Failed to remove quantity of %i during split.", m_data.name.c_str(), m_itemID, qty);
806  return InventoryItemRef(nullptr);
807  }
808 
809  ItemData idata(m_type.id(), m_data.ownerID, locTemp, m_data.flag, qty);
810  InventoryItemRef iRef = sItemFactory.SpawnItem(idata);
811  if (iRef.get() == nullptr)
812  return InventoryItemRef(nullptr); // couldnt spawn new item...we'll get over it.
813 
814  if (silent)
815  return iRef;
816 
817  iRef->Move(m_data.locationID, m_data.flag, notify);
818  return iRef;
819 }
#define _log(type, fmt,...)
Definition: logsys.h:124
uint16 id() const
Definition: ItemType.h:63
ItemType m_type
uint32 locationID
Definition: ItemType.h:190
ItemData m_data
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
bool AlterQuantity(int32 qty, bool notify=false)
EVEItemFlags flag
Definition: ItemType.h:187
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
uint32 ownerID
Definition: ItemType.h:189
#define sItemFactory
Definition: ItemFactory.h:165
std::string name
Definition: ItemType.h:193

Here is the call graph for this function:

Here is the caller graph for this function:

void InventoryItem::ToVirtual ( uint32  locationID)

Definition at line 605 of file InventoryItem.cpp.

References AttributeMap::Delete(), ItemDB::DeleteItem(), RefPtr< X >::get(), Inv::Update::Location, locationID(), ItemData::locationID, m_data, m_itemID, ItemData::ownerID, pAttributeMap, pInventory, Inventory::RemoveItem(), SendItemChange(), and sItemFactory.

Referenced by Colony::PlanetXfer().

606 {
607  InventoryItemRef iRef = sItemFactory.GetItemContainer(m_itemID, false);
608  if (iRef.get() != nullptr) {
609  // verify this gets inventory containing item before trying to manipulate
610  //Inventory* pInv = iRef->GetMyInventory();
611  if (pInventory != nullptr) // this isnt right...this item wont be in it's own inventory
613  }
614  if (pAttributeMap != nullptr) // should never be null, but just in case
616 
617  //notify about the changes.
618  std::map<int32, PyRep *> changes;
620  SendItemChange(m_data.ownerID, changes); //changes is consumed
622 
623  //take ourself out of the DB
625  //delete ourselves from factory cache
626  sItemFactory.RemoveItem(m_itemID);
627 }
void SendItemChange(uint32 toID, std::map< int32, PyRep * > &changes)
uint32 locationID
Definition: ItemType.h:190
ItemData m_data
void RemoveItem(InventoryItemRef iRef)
Definition: Inventory.cpp:243
Inventory * pInventory
uint32 locationID() const
Python integer.
Definition: PyRep.h:231
X * get() const
Definition: RefPtr.h:213
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
static bool DeleteItem(uint32 itemID)
Definition: ItemDB.cpp:348
uint32 ownerID
Definition: ItemType.h:189
#define sItemFactory
Definition: ItemFactory.h:165
AttributeMap * pAttributeMap

Here is the call graph for this function:

Here is the caller graph for this function:

uint16 InventoryItem::typeID ( ) const
inline

Definition at line 110 of file InventoryItem.h.

References ItemType::id(), and m_type.

Referenced by ItemType::_LoadType(), LSCChannel::_MakeSenderInfo(), StructureSE::Activate(), AttributeMap::Add(), FleetService::AddMember(), CharacterDB::addOwnerCache(), AnomalyMgr::AddSignal(), Character::AddToSkillQueue(), SystemEntity::ApplyDamage(), SentryAI::AttackTarget(), DroneAIMgr::AttackTarget(), NPCAIMgr::AttackTarget(), ConcordAI::AttackTarget(), Client::Board(), Client::BoardShip(), Character::CancelSkillInTraining(), AttributeMap::Change(), Command_cargo(), Command_giveallskills(), ContainerSE::ContainerSE(), CargoContainer::Delete(), Client::DockToStation(), StructureSE::GetEffectState(), PlanetSE::GetPlanetInfo(), ReprocessingServiceBound::GetQuote(), ShipItem::GetShipDNA(), SystemEntity::GetTypeID(), ModuleManager::Initialize(), ModuleManager::InstallRig(), Sentry::Killed(), CustomsSE::Killed(), NPC::Killed(), StructureSE::Killed(), ShipSE::Killed(), ActiveModule::LaunchMissile(), ActiveModule::LaunchProbe(), ItemType::Load(), ActiveModule::LoadCharge(), ModuleManager::LoadCharge(), ShipItem::LoadCharge(), PlanetSE::LoadExtras(), TowerSE::MakeSlimItem(), CustomsSE::MakeSlimItem(), Missile::MakeSlimItem(), DroneSE::MakeSlimItem(), ProbeSE::MakeSlimItem(), StructureSE::MakeSlimItem(), AnomalySE::MakeSlimItem(), ContainerSE::MakeSlimItem(), WormholeSE::MakeSlimItem(), StationSE::MakeSlimItem(), SystemEntity::MakeSlimItem(), WreckSE::MakeSlimItem(), StaticSystemEntity::MakeSlimItem(), ShipSE::MakeSlimItem(), StargateSE::MakeSlimItem(), ItemSystemEntity::MakeSlimItem(), DynamicSystemEntity::MakeSlimItem(), Merge(), MergeTypesInCargo(), MiningLaser::MiningLaser(), InventoryBound::MoveItems(), ModuleManager::Online(), FxProc::ParseExpression(), ShipSE::PayInsurance(), Colony::PlanetXfer(), ProbeSE::ProbeSE(), StructureSE::Process(), CustomsSE::PullAnchor(), StructureSE::PullAnchor(), CargoContainer::RemoveItem(), StationItem::RentOffice(), SpawnMgr::ReSpawn(), Client::SelectCharacter(), ProbeSE::SendNewProbe(), ProbeSE::SendSlimChange(), CustomsSE::SendSlimUpdate(), StructureSE::SendSlimUpdate(), CustomsSE::SetAnchor(), StructureSE::SetAnchor(), SystemBubble::SetBelt(), TowerSE::SetOnline(), StructureSE::SetOnline(), ActiveModule::ShowEffect(), Character::SkillQueueLoop(), DroneSE::StateChange(), ShipItem::TryModuleLimitChecks(), GenericModule::typeID(), DestinyManager::UpdateNewShip(), ShipItem::ValidateItemSpecifics(), and ShipItem::VerifyHoldType().

110 { return m_type.id(); }
uint16 id() const
Definition: ItemType.h:63
ItemType m_type

Here is the call graph for this function:

void InventoryItem::UpdateLocation ( )

Definition at line 1116 of file InventoryItem.cpp.

References ItemData::flag, ItemData::locationID, m_data, m_itemID, and ItemDB::UpdateLocation().

1116  {
1118 }
uint32 locationID
Definition: ItemType.h:190
ItemData m_data
EVEItemFlags flag
Definition: ItemType.h:187
static void UpdateLocation(uint32 itemID, uint32 locationID, EVEItemFlags flag)
Definition: ItemDB.cpp:212

Here is the call graph for this function:

void InventoryItem::UpdateLocation ( uint32  locID)
inline

Definition at line 142 of file InventoryItem.h.

References ItemData::locationID, and m_data.

142 { m_data.locationID = locID; } // change item's locationID without saving
uint32 locationID
Definition: ItemType.h:190
ItemData m_data

Member Data Documentation

bool InventoryItem::m_delete
private

Definition at line 282 of file InventoryItem.h.

Referenced by Delete(), and Move().

uint32 InventoryItem::m_itemID
protected

Definition at line 279 of file InventoryItem.h.

Referenced by _Load(), Character::_Load(), ShipItem::AddItemByFlag(), SolarSystem::AddItemToInventory(), Character::AddToSkillQueue(), Character::AlterBalance(), AlterQuantity(), Character::CancelSkillInTraining(), CargoContainer::CargoContainer(), CargoContainer::CargoContainerGetInfo(), ChangeSingleton(), Character::Character(), Character::ClearSkillQueue(), ProbeItem::Delete(), CargoContainer::Delete(), Blueprint::Delete(), Delete(), Character::Delete(), Blueprint::GetBlueprintAttributes(), Character::GetCharInfo(), GetItemRow(), GetItemStatusRow(), Character::GetNPCCorpStanding(), Character::GetSkillHistory(), Character::GetStandingModified(), Character::GrantCertificate(), Character::InjectSkillIntoBrain(), InventoryItem(), itemID(), Character::JoinCorporation(), Character::LoadPausedSkillQueue(), ShipItem::LoadWeaponGroups(), ShipItem::LogOut(), Character::LogOut(), Merge(), Move(), Character::PauseSkillQueue(), Character::PayBounty(), Character::PickAlternateShip(), Populate(), PyCallable_Make_InnerDispatcher(), Relocate(), CargoContainer::RemoveItem(), SolarSystem::RemoveItemFromInventory(), Rename(), Character::ResetClone(), Blueprint::SaveBlueprint(), Character::SaveCertificates(), Character::SaveCharacter(), Character::SaveFullCharacter(), SaveItem(), Character::SaveSkillQueue(), ShipItem::SaveWeaponGroups(), SendItemChange(), Character::SetAccountKey(), Character::SetActivePod(), Character::SetActiveShip(), Character::SetBaseID(), SetFlag(), Character::SetLoginTime(), ModuleItem::SetOnline(), SetPosition(), SetQuantity(), Character::SkillQueueLoop(), SolarSystem::SolarSystem(), Split(), StationOffice::StationOfficeGetInfo(), StructureItem::StructureGetInfo(), ToVirtual(), ShipItem::UnlinkAllWeapons(), ShipItem::UnlinkGroup(), ShipItem::UnlinkWeapon(), Character::UpdateCertificate(), UpdateLocation(), Character::UpdateSkillQueueEndTime(), and Character::VisitSystem().

std::multimap<int8, fxData> InventoryItem::m_modifiers
int64 InventoryItem::m_timestamp
private

Definition at line 331 of file InventoryItem.h.

Referenced by GetTimeStamp().

Inventory* InventoryItem::pInventory
protected

Definition at line 278 of file InventoryItem.h.

Referenced by StructureItem::_Load(), CargoContainer::_Load(), StationItem::_Load(), ShipItem::_Load(), WreckContainer::_Load(), Character::_Load(), AddItem(), CargoContainer::CargoContainer(), CargoContainer::CargoContainerGetInfo(), Character::Character(), Character::ClearSkillFlags(), StructureItem::Delete(), CargoContainer::Delete(), ShipItem::Delete(), WreckContainer::Delete(), Character::Delete(), ShipItem::EmptyCargo(), CargoContainer::GetCapacity(), WreckContainer::GetCapacity(), ShipItem::GetChargeState(), Character::GetCharInfo(), StationItem::GetContainerFromInventory(), ShipItem::GetModuleItemVec(), GetMyInventory(), ShipItem::GetRemainingVolumeByFlag(), StationItem::GetShipFromInventory(), ShipItem::GetShipInfo(), ShipItem::GetShipState(), Character::GetSkill(), Character::GetSkillsList(), Character::GetTotalSP(), StationItem::HasShip(), WreckContainer::IsEmpty(), ShipItem::LogOut(), Character::LogOut(), Character::ProcessEffects(), CargoContainer::RemoveItem(), RemoveItem(), WreckContainer::RemoveItem(), Character::ResetModifiers(), ShipItem::SetPlayer(), ShipItem::ShipGetModuleList(), ShipItem::ShipItem(), SolarSystem::SolarSystem(), StationItem::StationItem(), StationOffice::StationOffice(), StationOffice::StationOfficeGetInfo(), StructureItem::StructureGetInfo(), StructureItem::StructureItem(), ToVirtual(), ShipItem::UpdateMass(), StationOffice::ValidateAddItem(), CargoContainer::ValidateAddItem(), Character::VerifySP(), WreckContainer::WreckContainer(), WreckContainer::WreckContainerGetInfo(), CargoContainer::~CargoContainer(), Character::~Character(), ShipItem::~ShipItem(), SolarSystem::~SolarSystem(), StationItem::~StationItem(), StationOffice::~StationOffice(), StructureItem::~StructureItem(), and WreckContainer::~WreckContainer().


The documentation for this class was generated from the following files: