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

#include "Station.h"

Inheritance diagram for StationItem:
Collaboration diagram for StationItem:

Public Member Functions

StationTypeGetStationType ()
 
ShipItemRef GetShipFromInventory (uint32 shipID)
 
CargoContainerRef GetContainerFromInventory (uint32 contID)
 
PyRepGetOffices ()
 
int8 GetAvalibleOfficeCount ()
 
int32 GetOfficeRentalFee ()
 
uint32 GetOwnerID ()
 
uint32 GetID ()
 
void RentOffice (OfficeData &odata)
 
uint32 GetOfficeID (uint32 corpID)
 
void LoadStationOffice (uint32 corpID)
 
void AddLoadedOffice (uint32 officeID)
 
void RemoveLoadedOffice (uint32 officeID)
 
bool IsLoaded ()
 
bool IsOfficeLoaded (uint32 officeID)
 
void GetGuestList (std::vector< Client * > &cVec)
 
void AddGuest (Client *pClient)
 
void RemoveGuest (Client *pClient)
 
void GetRefineData (uint32 &stationCorpID, float &staEfficiency, float &tax)
 
bool HasShip (Client *pClient)
 
- Public Member Functions inherited from CelestialObject
 CelestialObject (uint32 _celestialID, const ItemType &_type, const ItemData &_data)
 
 CelestialObject (uint32 _celestialID, const ItemType &_type, const ItemData &_data, const CelestialObjectData &_cData)
 
virtual ~CelestialObject ()
 
void Delete ()
 
double radius () const
 
double security () const
 
uint8 celestialIndex () const
 
uint8 orbitIndex () const
 
- Public Member Functions inherited from InventoryItem
 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 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)
 
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 StationItemRef Load (uint32 stationID)
 
- Static Public Member Functions inherited from CelestialObject
static CelestialObjectRef Load (uint32 celestialID)
 
static CelestialObjectRef Spawn (ItemData &data)
 
- Static Public Member Functions inherited from InventoryItem
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)
 

Protected Member Functions

 StationItem (uint32 stationID, const StationType &type, const ItemData &data, const CelestialObjectData &cData)
 
virtual ~StationItem ()
 
virtual bool _Load ()
 
void SendBill ()
 
void ImpoundOffice (uint32 officeID)
 
void RecoverOffice (uint32 officeID)
 
- 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...
 

Static Protected Member Functions

template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 stationID, const ItemType &type, const ItemData &data)
 
static uint32 CreateItemID (ItemData &data)
 
- Static Protected Member Functions inherited from CelestialObject
template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 celestialID, const ItemType &type, const ItemData &data)
 
static uint32 CreateItemID (ItemData &data)
 
- Static Protected Member Functions inherited from InventoryItem
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)
 

Private Attributes

PyRepm_officePyData
 
StationType m_stationType
 
StationData m_data
 
bool m_loaded
 
uint32 m_stationID
 
std::map< uint32, Client * > m_guestList
 
std::map< uint32, OfficeDatam_officeMap
 
std::map< uint32, bool > m_officeLoaded
 

Friends

class InventoryItem
 
class CelestialObject
 

Additional Inherited Members

- Public Attributes inherited from InventoryItem
std::multimap< int8, fxDatam_modifiers
 
- Protected Attributes inherited from CelestialObject
double m_radius
 
double m_security
 
uint8 m_celestialIndex
 
uint8 m_orbitIndex
 
- Protected Attributes inherited from InventoryItem
InventorypInventory
 
uint32 m_itemID
 
AttributeMappAttributeMap
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Detailed Description

CelestialObject which represents station.

Definition at line 70 of file Station.h.

Constructor & Destructor Documentation

StationItem::StationItem ( uint32  stationID,
const StationType type,
const ItemData data,
const CelestialObjectData cData 
)
protected

Definition at line 59 of file Station.cpp.

References _log, InventoryItem::itemID(), InventoryItem::name(), and InventoryItem::pInventory.

Referenced by _LoadItem().

60 : CelestialObject(stationID, type, data, cData),
61 m_officePyData(nullptr),
62 m_stationType(type),
63 m_stationID(stationID),
64 m_loaded(false)
65 {
67 
68  _log(ITEM__TRACE, "Created Station for item %s (%u).", name(), itemID());
69 }
#define _log(type, fmt,...)
Definition: logsys.h:124
StationType m_stationType
Definition: Station.h:156
const char * name()
PyRep * m_officePyData
Definition: Station.h:155
Inventory * pInventory
friend class CelestialObject
Definition: Station.h:74
bool m_loaded
Definition: Station.h:159
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
uint32 itemID() const
Definition: InventoryItem.h:98
uint32 m_stationID
Definition: Station.h:160

Here is the call graph for this function:

Here is the caller graph for this function:

StationItem::~StationItem ( )
protectedvirtual

Definition at line 71 of file Station.cpp.

References m_guestList, m_officeMap, m_officePyData, InventoryItem::pInventory, PySafeDecRef, SafeDelete(), and Inventory::Unload().

72 {
73  if (pInventory != nullptr)
74  pInventory->Unload();
76 
77  m_officeMap.clear();
78  m_guestList.clear();
80 }
std::map< uint32, OfficeData > m_officeMap
Definition: Station.h:164
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
void Unload()
Definition: Inventory.cpp:62
PyRep * m_officePyData
Definition: Station.h:155
Inventory * pInventory
std::map< uint32, Client * > m_guestList
Definition: Station.h:162
#define PySafeDecRef(op)
Definition: PyRep.h:61

Here is the call graph for this function:

Member Function Documentation

bool StationItem::_Load ( )
protectedvirtual

Reimplemented from InventoryItem.

Definition at line 87 of file Station.cpp.

References InventoryItem::_Load(), StationDB::GetOffices(), Inventory::LoadContents(), m_data, m_guestList, m_loaded, m_officeMap, m_officePyData, m_stationID, StationData::officeRentalFee, InventoryItem::pInventory, and stDataMgr.

87  {
88  if (!pInventory->LoadContents())
89  return false;
90 
91  m_officeMap.clear();
92  m_guestList.clear();
93 
94  stDataMgr.GetStationData(m_stationID, m_data);
95  stDataMgr.LoadOffices(m_stationID, m_officeMap);
97 
98  if (m_data.officeRentalFee < 10000)
99  m_data.officeRentalFee = 10000;
100 
102 
103  return m_loaded;
104 }
int32 officeRentalFee
#define stDataMgr
std::map< uint32, OfficeData > m_officeMap
Definition: Station.h:164
virtual bool _Load()
PyRep * m_officePyData
Definition: Station.h:155
Inventory * pInventory
std::map< uint32, Client * > m_guestList
Definition: Station.h:162
static PyRep * GetOffices(uint32 stationID)
Definition: StationDB.cpp:54
bool m_loaded
Definition: Station.h:159
bool LoadContents()
Definition: Inventory.cpp:113
StationData m_data
Definition: Station.h:157
uint32 m_stationID
Definition: Station.h:160

Here is the call graph for this function:

template<class _Ty >
static RefPtr<_Ty> StationItem::_LoadItem ( uint32  stationID,
const ItemType type,
const ItemData data 
)
inlinestaticprotected

Definition at line 128 of file Station.h.

References _log, ItemType::groupID(), sConfig, sDataMgr, sItemFactory, EVEDB::invGroups::Station, StationItem(), EvE::traceStack(), and InventoryItem::type().

129  {
130  if (type.groupID() != EVEDB::invGroups::Station) {
131  _log(ITEM__ERROR, "Trying to load %s as Station.", sDataMgr.GetGroupName(type.groupID()));
132  if (sConfig.debug.StackTrace)
133  EvE::traceStack();
134  return RefPtr<_Ty>();
135  }
136  // cast the type
137  const StationType &stType = static_cast<const StationType &>( type );
138 
139  // load celestial data
141  if (!sItemFactory.db()->GetCelestialObject(stationID, cData))
142  return RefPtr<_Ty>();
143 
144  return StationItemRef(new StationItem(stationID, stType, data, cData));
145  }
#define sConfig
A macro for easier access to the singleton.
RefPtr< StationItem > StationItemRef
Definition: ItemRef.h:66
#define _log(type, fmt,...)
Definition: logsys.h:124
uint16 groupID() const
Definition: ItemType.h:64
const ItemType & type() const
void traceStack(void)
Definition: misc.cpp:169
#define sItemFactory
Definition: ItemFactory.h:165
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr
StationItem(uint32 stationID, const StationType &type, const ItemData &data, const CelestialObjectData &cData)
Definition: Station.cpp:59

Here is the call graph for this function:

void StationItem::AddGuest ( Client pClient)

Definition at line 219 of file Station.cpp.

References Client::GetCharacterID(), and m_guestList.

Referenced by Client::MoveToLocation().

220 {
221  m_guestList.emplace(pClient->GetCharacterID(), pClient);
222 }
int32 GetCharacterID() const
Definition: Client.h:113
std::map< uint32, Client * > m_guestList
Definition: Station.h:162

Here is the call graph for this function:

Here is the caller graph for this function:

void StationItem::AddLoadedOffice ( uint32  officeID)

Definition at line 120 of file Station.cpp.

References IsOfficeID, and m_officeLoaded.

121 {
122  if (!IsOfficeID(officeID))
123  return;
124  m_officeLoaded.emplace(officeID, true);
125 }
std::map< uint32, bool > m_officeLoaded
Definition: Station.h:165
#define IsOfficeID(itemID)
Definition: EVE_Defines.h:253
uint32 StationItem::CreateItemID ( ItemData data)
staticprotected

Definition at line 106 of file Station.cpp.

References InventoryItem::CreateItemID().

Referenced by InventoryItem::Spawn().

106  {
107  return InventoryItem::CreateItemID(data);
108 }
static uint32 CreateItemID(ItemData &data)

Here is the call graph for this function:

Here is the caller graph for this function:

int8 StationItem::GetAvalibleOfficeCount ( )
inline

Definition at line 92 of file Station.h.

References m_officeMap, and maxRentableOffices.

92 { return maxRentableOffices - m_officeMap.size(); }
std::map< uint32, OfficeData > m_officeMap
Definition: Station.h:164
#define maxRentableOffices
Definition: EVE_Defines.h:80
CargoContainerRef StationItem::GetContainerFromInventory ( uint32  contID)

Definition at line 259 of file Station.cpp.

References Inventory::GetByID(), InventoryItem::pInventory, and RefPtr< X >::StaticCast().

260 {
262 }
Inventory * pInventory
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
Definition: RefPtr.h:238
InventoryItemRef GetByID(uint32 id) const
Definition: Inventory.cpp:415

Here is the call graph for this function:

void StationItem::GetGuestList ( std::vector< Client * > &  cVec)

Definition at line 224 of file Station.cpp.

References m_guestList.

225 {
226  for (auto cur : m_guestList)
227  cVec.push_back(cur.second);
228 }
std::map< uint32, Client * > m_guestList
Definition: Station.h:162
uint32 StationItem::GetID ( )
inline

Definition at line 95 of file Station.h.

References m_data, and StationData::stationID.

95 { return m_data.stationID; }
uint32 stationID
StationData m_data
Definition: Station.h:157
uint32 StationItem::GetOfficeID ( uint32  corpID)

Definition at line 110 of file Station.cpp.

References IsPlayerCorp, and m_officeMap.

Referenced by LoadStationOffice().

111 {
112  if (!IsPlayerCorp(corpID))
113  return 0;
114  for (auto cur : m_officeMap)
115  if (cur.second.corporationID = corpID)
116  return cur.first;
117  return 0;
118 }
std::map< uint32, OfficeData > m_officeMap
Definition: Station.h:164
#define IsPlayerCorp(itemID)
Definition: EVE_Defines.h:241

Here is the caller graph for this function:

int32 StationItem::GetOfficeRentalFee ( )
inline

Definition at line 93 of file Station.h.

References m_data, and StationData::officeRentalFee.

93 { return m_data.officeRentalFee; }
int32 officeRentalFee
StationData m_data
Definition: Station.h:157
PyRep* StationItem::GetOffices ( )
inline

Definition at line 91 of file Station.h.

References m_officePyData, and PyIncRef.

91 { PyIncRef(m_officePyData); return m_officePyData; } // cached officeData for client call
PyRep * m_officePyData
Definition: Station.h:155
#define PyIncRef(op)
Definition: PyRep.h:56
uint32 StationItem::GetOwnerID ( )
inline

Definition at line 94 of file Station.h.

References StationData::corporationID, and m_data.

94 { return m_data.corporationID; }
uint32 corporationID
StationData m_data
Definition: Station.h:157
void StationItem::GetRefineData ( uint32 stationCorpID,
float &  staEfficiency,
float &  tax 
)

Definition at line 235 of file Station.cpp.

References StationData::corporationID, m_data, StationData::reprocessingEfficiency, and StationData::reprocessingStationsTake.

Referenced by ReprocessingServiceBound::ReprocessingServiceBound().

236 {
237  stationCorpID = m_data.corporationID;
238  staEfficiency = m_data.reprocessingEfficiency;
240 }
uint32 corporationID
float reprocessingStationsTake
StationData m_data
Definition: Station.h:157
float reprocessingEfficiency

Here is the caller graph for this function:

ShipItemRef StationItem::GetShipFromInventory ( uint32  shipID)

Definition at line 254 of file Station.cpp.

References Inventory::GetByID(), InventoryItem::pInventory, and RefPtr< ShipItem >::StaticCast().

255 {
256  return ShipItemRef::StaticCast(pInventory->GetByID(shipID));
257 }
Inventory * pInventory
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
Definition: RefPtr.h:238
InventoryItemRef GetByID(uint32 id) const
Definition: Inventory.cpp:415

Here is the call graph for this function:

StationType* StationItem::GetStationType ( )
inline

Definition at line 86 of file Station.h.

References m_stationType.

86 { return &m_stationType; }
StationType m_stationType
Definition: Station.h:156
bool StationItem::HasShip ( Client pClient)

Definition at line 242 of file Station.cpp.

References EVEDB::invTypes::Capsule, Client::GetCharacterID(), Inventory::GetInvForOwner(), items, InventoryItem::pInventory, and EVEDB::invCategories::Ship.

Referenced by Client::DockToStation(), and Client::SelectCharacter().

243 {
244  std::vector< InventoryItemRef > items;
246 
247  for (auto cur : items)
248  if (cur->categoryID() == EVEDB::invCategories::Ship)
249  if (cur->typeID() != EVEDB::invTypes::Capsule)
250  return true;
251  return false;
252 }
void GetInvForOwner(uint32 ownerID, std::vector< InventoryItemRef > &items)
Definition: Inventory.cpp:425
int32 GetCharacterID() const
Definition: Client.h:113
Inventory * pInventory
entityID heal the character with the entityID note giving you detailed ship status information gives a list of all dynamic entities and players and their destinyState in this bubble shows some current destiny variables save all items

Here is the call graph for this function:

Here is the caller graph for this function:

void StationItem::ImpoundOffice ( uint32  officeID)
protected

Definition at line 163 of file Station.cpp.

References m_officeMap.

164 {
165  std::map<uint32, OfficeData>::iterator itr = m_officeMap.find(officeID);
166  if (itr != m_officeMap.end())
167  itr->second.lockDown = true;
168 }
std::map< uint32, OfficeData > m_officeMap
Definition: Station.h:164
bool StationItem::IsLoaded ( )
inline

Definition at line 103 of file Station.h.

References m_loaded.

103 { return m_loaded; }
bool m_loaded
Definition: Station.h:159
bool StationItem::IsOfficeLoaded ( uint32  officeID)

Definition at line 127 of file Station.cpp.

References IsOfficeID, and m_officeLoaded.

Referenced by LoadStationOffice().

128 {
129  if (!IsOfficeID(officeID))
130  return false;
131  std::map<uint32, bool>::const_iterator itr = m_officeLoaded.find(officeID);
132  if (itr != m_officeLoaded.end())
133  return itr->second;
134  return false;
135 }
std::map< uint32, bool > m_officeLoaded
Definition: Station.h:165
#define IsOfficeID(itemID)
Definition: EVE_Defines.h:253

Here is the caller graph for this function:

StationItemRef StationItem::Load ( uint32  stationID)
static

Loads station.

Parameters
[in]factory
[in]stationIDID of station to load.
Returns
Pointer to new Station object; NULL if fails.

Definition at line 82 of file Station.cpp.

Referenced by InventoryItem::Spawn().

83 {
84  return InventoryItem::Load<StationItem>(stationID);
85 }

Here is the caller graph for this function:

void StationItem::LoadStationOffice ( uint32  corpID)

Definition at line 144 of file Station.cpp.

References _log, GetOfficeID(), IsOfficeLoaded(), IsPlayerCorp, m_officeLoaded, m_stationID, and sItemFactory.

Referenced by Client::MoveToLocation().

145 {
146  if (!IsPlayerCorp(corpID))
147  return;
148  uint32 officeID = GetOfficeID(corpID);
149  if (officeID == 0)
150  return;
151  if (IsOfficeLoaded(officeID))
152  return;
153  _log(CORP__TRACE, "StationItem::LoadStationOffice() is loading corp office %u in stationID %u", officeID, m_stationID);
154  StationOfficeRef oRef = sItemFactory.GetOffice(officeID);
155  if (oRef->GetMyInventory() == nullptr) { // not sure why this would be null, but i *may* have seen errors from it
156  _log(ITEM__ERROR, "StationItem::LoadStationOffice() - GetMyInventory() for corp office %u in stationID %u is NULL.", officeID, m_stationID);
157  return;
158  }
159  oRef->SetLoaded(oRef->GetMyInventory()->LoadContents());
160  m_officeLoaded.emplace(officeID, true);
161 }
bool IsOfficeLoaded(uint32 officeID)
Definition: Station.cpp:127
#define _log(type, fmt,...)
Definition: logsys.h:124
std::map< uint32, bool > m_officeLoaded
Definition: Station.h:165
#define IsPlayerCorp(itemID)
Definition: EVE_Defines.h:241
unsigned __int32 uint32
Definition: eve-compat.h:50
#define sItemFactory
Definition: ItemFactory.h:165
uint32 m_stationID
Definition: Station.h:160
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
uint32 GetOfficeID(uint32 corpID)
Definition: Station.cpp:110

Here is the call graph for this function:

Here is the caller graph for this function:

void StationItem::RecoverOffice ( uint32  officeID)
protected

Definition at line 170 of file Station.cpp.

References m_officeMap.

171 {
172  std::map<uint32, OfficeData>::iterator itr = m_officeMap.find(officeID);
173  if (itr != m_officeMap.end())
174  itr->second.lockDown = false;
175 }
std::map< uint32, OfficeData > m_officeMap
Definition: Station.h:164
void StationItem::RemoveGuest ( Client pClient)

Definition at line 230 of file Station.cpp.

References Client::GetCharacterID(), and m_guestList.

231 {
232  m_guestList.erase(pClient->GetCharacterID());
233 }
int32 GetCharacterID() const
Definition: Client.h:113
std::map< uint32, Client * > m_guestList
Definition: Station.h:162

Here is the call graph for this function:

void StationItem::RemoveLoadedOffice ( uint32  officeID)

Definition at line 137 of file Station.cpp.

References IsOfficeID, and m_officeLoaded.

138 {
139  if (!IsOfficeID(officeID))
140  return;
141  m_officeLoaded.erase(officeID);
142 }
std::map< uint32, bool > m_officeLoaded
Definition: Station.h:165
#define IsOfficeID(itemID)
Definition: EVE_Defines.h:253
void StationItem::RentOffice ( OfficeData odata)

Definition at line 178 of file Station.cpp.

References StationData::corporationID, OfficeData::corporationID, flagOffice, OfficeData::folderID, StationDB::GetOffices(), m_data, m_guestList, m_officeLoaded, m_officeMap, m_officePyData, m_stationID, InventoryItem::name(), OfficeData::officeID, PyDecRef, PyIncRef, PySafeDecRef, sItemFactory, STATION_OFFICE_OFFSET, OfficeData::stationID, stDataMgr, OfficeData::ticker, InventoryItem::typeID(), and OfficeData::typeID.

179 {
180  odata.typeID = typeID(); // change from officeTypeID to stationTypeID
182  odata.stationID = m_stationID;
183 
184  // create new office item
185  std::string name = odata.ticker;
186  name += "'s Office";
187  ItemData idata(27, m_data.corporationID, m_stationID, flagOffice, name.c_str());
188  StationOfficeRef oRef = sItemFactory.SpawnOffice(idata, odata);
189  if (oRef.get() == nullptr)
190  return; // make error here?
191 
192  // make and send notifications
193  OnOfficeRentalChanged oorc;
194  oorc.ownerID = odata.corporationID;
195  oorc.officeID = odata.officeID;
196  oorc.officeFolderID = odata.folderID;
197  PyTuple* payload = oorc.Encode();
198  for (auto cur : m_guestList) {
199  PyIncRef(payload);
200  cur.second->SendNotification("OnOfficeRentalChanged", "stationid", &payload, false);
201  }
202  PyDecRef( payload );
203 
204  oRef->ChangeOwner(odata.corporationID, true);
205 
206  // update data
207  stDataMgr.AddOffice(m_stationID, odata);
208  m_officeMap.emplace(odata.officeID, odata);
209  m_officeLoaded.emplace(odata.officeID, true);
212 }
uint32 corporationID
#define stDataMgr
std::map< uint32, bool > m_officeLoaded
Definition: Station.h:165
uint32 folderID
uint32 stationID
std::map< uint32, OfficeData > m_officeMap
Definition: Station.h:164
const char * name()
Python tuple.
Definition: PyRep.h:567
PyRep * m_officePyData
Definition: Station.h:155
std::map< uint32, Client * > m_guestList
Definition: Station.h:162
uint32 officeID
std::string ticker
#define PyDecRef(op)
Definition: PyRep.h:57
uint32 corporationID
#define PyIncRef(op)
Definition: PyRep.h:56
static PyRep * GetOffices(uint32 stationID)
Definition: StationDB.cpp:54
#define STATION_OFFICE_OFFSET
Definition: EVE_Defines.h:177
#define PySafeDecRef(op)
Definition: PyRep.h:61
#define sItemFactory
Definition: ItemFactory.h:165
StationData m_data
Definition: Station.h:157
uint16 typeID() const
uint32 m_stationID
Definition: Station.h:160
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

void StationItem::SendBill ( )
protected

Definition at line 214 of file Station.cpp.

215 {
216  // do we need this here?
217 }

Friends And Related Function Documentation

friend class CelestialObject
friend

Definition at line 74 of file Station.h.

friend class InventoryItem
friend

Definition at line 73 of file Station.h.

Member Data Documentation

StationData StationItem::m_data
private

Definition at line 157 of file Station.h.

Referenced by _Load(), GetID(), GetOfficeRentalFee(), GetOwnerID(), GetRefineData(), and RentOffice().

std::map<uint32, Client*> StationItem::m_guestList
private

Definition at line 162 of file Station.h.

Referenced by _Load(), AddGuest(), GetGuestList(), RemoveGuest(), RentOffice(), and ~StationItem().

bool StationItem::m_loaded
private

Definition at line 159 of file Station.h.

Referenced by _Load(), and IsLoaded().

std::map<uint32, bool> StationItem::m_officeLoaded
private
std::map<uint32, OfficeData> StationItem::m_officeMap
private
PyRep* StationItem::m_officePyData
private

Definition at line 155 of file Station.h.

Referenced by _Load(), GetOffices(), RentOffice(), and ~StationItem().

uint32 StationItem::m_stationID
private

Definition at line 160 of file Station.h.

Referenced by _Load(), LoadStationOffice(), and RentOffice().

StationType StationItem::m_stationType
private

Definition at line 156 of file Station.h.

Referenced by GetStationType().


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