EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Container.cpp
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Aknor Jaden
24  Rewrite: Allan
25 */
26 
27 #include "eve-server.h"
28 
29 #include "Client.h"
30 #include "ConsoleCommands.h"
31 #include "EntityList.h"
32 #include "EVEServerConfig.h"
33 #include "planet/PlanetDB.h"
34 #include "system/DestinyManager.h"
35 #include "system/Container.h"
36 #include "system/SystemManager.h"
37 #include "system/SystemBubble.h"
39 
40 /*
41  * CargoContainer
42  */
43 CargoContainer::CargoContainer(uint32 _containerID, const ItemType &_containerType, const ItemData &_data)
44 : InventoryItem(_containerID, _containerType, _data),
45 m_isAnchored(false)
46 {
48  _log(ITEM__TRACE, "Created CargoContainer object for item %s (%u).", name(), m_itemID);
49 }
50 
52 {
53  if (pInventory != nullptr)
54  pInventory->Unload();
56 }
57 
59 {
60  return InventoryItem::Load<CargoContainer>(containerID );
61 }
62 
64  if (!pInventory->LoadContents())
65  return false;
66 
67  return InventoryItem::_Load();
68 }
69 
71  uint32 containerID = CargoContainer::CreateItemID(data );
72  if (containerID == 0 )
73  return CargoContainerRef(nullptr);
74  CargoContainerRef containerRef = CargoContainer::Load(containerID );
75 
76  // Create default dynamic attributes in the AttributeMap:
77  containerRef->SetAttribute(AttrRadius, containerRef->type().radius(), false); // Radius
78  containerRef->SetAttribute(AttrShieldCharge, containerRef->GetAttribute(AttrShieldCapacity), false); // Shield Charge
79  containerRef->SetAttribute(AttrArmorDamage, EvilZero, false); // Armor Damage
80  containerRef->SetAttribute(AttrMass, containerRef->type().mass(), false); // Mass
81  containerRef->SetAttribute(AttrVolume, containerRef->GetPackagedVolume(), false); // Volume
82  containerRef->SetAttribute(AttrCapacity, containerRef->type().capacity(), false); // Capacity
83 
84  return containerRef;
85 }
86 
88 {
89  uint32 containerID = CargoContainer::CreateTempItemID(data);
90  if (containerID == 0)
91  return CargoContainerRef(nullptr);
92 
93  if (data.quantity == 0)
94  return CargoContainerRef(nullptr);
95 
96  const ItemType *iType = sItemFactory.GetType(data.typeID);
97  if (iType == nullptr)
98  return CargoContainerRef(nullptr);
99 
100  CargoContainerRef cRef = CargoContainerRef(new CargoContainer(containerID, *iType, data));
101  /* we dont need attribs or inventory here....these are position markers
102  if (cRef.get() != nullptr)
103  cRef->_Load();
104  */
105 
106  return cRef;
107 }
108 
110 {
111  return InventoryItem::CreateItemID(data);
112 }
113 
115 {
118 
119  // if SE exists, remove from system before deleting item
120  if (mySE != nullptr)
121  mySE->Delete();
122 
126 }
127 
129 {
130  return pInventory->GetCapacity(flag);
131 }
132 
134  pInventory->ValidateAddItem(flag, item);
135 }
136 
138  if (!pInventory->LoadContents( ) ) {
139  codelog( ITEM__ERROR, "%s (%u): Failed to load contents for CargoContainerGetInfo", name(), m_itemID );
140  return nullptr;
141  }
142 
143  Rsp_CommonGetInfo result;
144  Rsp_CommonGetInfo_Entry entry;
145 
146  //first populate the CargoContainer.
147  if (!Populate(entry))
148  return nullptr; //print already done.
149 
150  result.items[ m_itemID ] = entry.Encode();
151 
152  return result.Encode();
153 }
154 
156 {
158  /* http://www.eveinfo.net/wiki/ind~4067.htm
159  * relative_sec_status_penalty = base_penalty * system_truesec * (1 + (victim_sec_status - agressor_sec_status) / 90)
160  * The actual drop in security status seen by the attacker is a function of their current security status and the relative penalty:
161  * security status loss = relative_penalty * (agressor_sec_status + 10)
162  *
163  double modifier = (1 + ((GetChar()->GetSecurityRating() - client->GetSecurityRating()) /90));
164  double penalty = 6.0f * m_system->GetSystemSecurityRating() * modifier;
165  double loss = penalty * (client->GetSecurityRating() + 10);
166  client->GetChar()->secStatusChange( loss );
167  */
168 
169  if (iRef.get() == nullptr)
170  return;
171 
173 
174  if (m_isAnchored)
175  return;
176 
177  if (pInventory->IsEmpty()) {
179  sLog.Warning( "CargoContainer::RemoveItem()", "Launch Container %u is empty and being deleted.", m_itemID );
181  } else if (typeID() == EVEDB::invTypes::CargoContainer) {
182  sLog.Warning( "CargoContainer::RemoveItem()", "Cargo Container %u is empty and being deleted.", m_itemID );
183  } else {
184  sLog.Warning( "CargoContainer::RemoveItem()", "Non-Cargo Container %u (type: %u) is empty and being deleted.", m_itemID, typeID() );
185  }
186  Delete();
187  }
188 }
189 
190 void CargoContainer::MakeDamageState(DoDestinyDamageState &into) const
191 {
192  //FIXME container attributes here are NOT saved in the db....
193  into.shield = 1.0;//(m_self->GetAttribute(AttrShieldCharge).get_double() / m_self->GetAttribute(AttrShieldCapacity).get_double());
194  into.recharge = 10000;
195  into.timestamp = GetFileTimeNow();
196  into.armor = 1.0;//1.0 - (m_self->GetAttribute(AttrArmorDamage).get_double() / m_self->GetAttribute(AttrArmorHP).get_double());
197  into.structure = 1.0;
198 }
199 
200 /*
201  * def HaveLootRight(self, objectID):
202  * """
203  * This method mirrors logic on server in lootRightsMgr.py HaveLootRight
204  *
205  * Returns True if the character has loot rights to a container, otherwise returns False
206  * """
207  * if self.slimItems.has_key(objectID):
208  * slim = self.slimItems[objectID]
209  * if session.charid == slim.ownerID:
210  * return True
211  * lootRights = getattr(slim, 'lootRights', None)
212  * if lootRights is not None:
213  * ownerID, corpID, fleetID, abandoned = lootRights
214  * if abandoned:
215  * return True
216  * if session.charid == ownerID:
217  * return True
218  * if not util.IsNPCCorporation(session.corpid) and session.corpid in (ownerID, corpID):
219  * return True
220  * if session.fleetid is not None and session.fleetid == fleetID:
221  * return True
222  * if self.broker.crimewatchSvc.CanAttackFreely(slim):
223  * return True
224  * elif not util.IsNPCCorporation(session.corpid) and session.corpid == slim.ownerID:
225  * return True
226  * return False
227  */
228 
230 : ItemSystemEntity(self, services, system),
231  m_contRef(self),
232  m_deleteTimer(0)
233 {
234  m_targMgr = new TargetManager(this);
235  m_destiny = new DestinyManager(this);
236 
237  assert(m_targMgr != nullptr);
238  assert(m_destiny != nullptr);
239 
240  m_global = false;
241 
242  m_warID = data.factionID;
243  m_allyID = data.allianceID;
244  m_corpID = data.corporationID;
245  m_ownerID = data.ownerID;
246 
247  if (!sDataMgr.IsStation(m_self->locationID())) { // should NEVER be true (SE object in station???)
249  m_deleteTimer.Start(5 *24 *60 *60 *1000); //5d timer for PI launch. should probably get this saved value from planet launches
250  } else {
251  m_deleteTimer.Start(sConfig.rates.WorldDecay *60 *1000);
252  }
253  }
254 
256 }
257 
259 {
260  if (m_targMgr != nullptr)
261  if (!sConsole.IsShutdown()) {
263  m_targMgr->ClearAllTargets(false);
264  //m_targMgr->OnTarget(nullptr, TargMgr::Mode::Clear, TargMgr::Msg::Destroyed);
265  }
266 
269 }
270 
272  /* Enable base call to Process Targeting and Movement */
274  if (m_deleteTimer.Check(false)) {
276  sLog.Magenta( "ContainerSE::Process()", "Garbage Collection is removing Cargo Container %u.", m_contRef->itemID() );
277  m_contRef->Delete();
278  delete this;
279  }
280 }
281 
283 {
284  // check effectID, check current state, check current timer, set new state, update timer
285 
297 }
298 
300 {
301  // check effectID, check current state, check current timer, set new state, update timer
302 
303 }
304 
306 {
308  m_contRef->SetAnchor(true);
309 }
310 
312 {
313  using namespace Destiny;
314  BallHeader head = BallHeader();
315  head.entityID = GetID();
316  head.radius = GetRadius();
317  head.posX = x();
318  head.posY = y();
319  head.posZ = z();
320  head.mode = Ball::Mode::TROLL;
322  into.Append( head );
323  MassSector mass = MassSector();
324  mass.mass = m_self->type().mass();
325  mass.cloak = 0;
326  mass.harmonic = m_harmonic;
327  mass.corporationID = m_corpID;
328  mass.allianceID = (IsAlliance(m_allyID) ? m_allyID : -1);
329  into.Append( mass );
330  DataSector data = DataSector();
331  data.inertia = 1;
332  data.maxSpeed = 1;
333  data.velX = 0;
334  data.velY = 0;
335  data.velZ = 0;
336  data.speedfraction = 1;
337  into.Append( data );
338  TROLL_Struct troll;
339  troll.formationID = 0xFF;
340  troll.effectStamp = sEntityList.GetStamp();
341  into.Append( troll );
342 
343  _log(SE__DESTINY, "ContainerSE::EncodeDestiny(): %s - id:%li, mode:%u, flags:0x%X", GetName(), head.entityID, head.mode, head.flags);
344 }
345 
346 void ContainerSE::MakeDamageState(DoDestinyDamageState &into)
347 {
348  //FIXME container attributes are NOT saved in the db....
349  into.shield = 1;
350  into.recharge = 2000000;
351  into.timestamp = GetFileTimeNow();
352  into.armor = 1;
353  into.structure = 1;
354 }
355 
357  _log(SE__SLIMITEM, "MakeSlimItem for ContainerSE %s(%u)", m_self->name(), m_self->itemID());
358  PyDict *slim = new PyDict();
359  slim->SetItemString("itemID", new PyLong(m_self->itemID()));
360  slim->SetItemString("typeID", new PyInt(m_self->typeID()));
361  slim->SetItemString("ownerID", new PyInt(m_ownerID));
362  slim->SetItemString("name", new PyString(m_self->itemName()));
363  slim->SetItemString("nameID", PyStatic.NewNone());
364  slim->SetItemString("corpID", IsCorp(m_corpID) ? new PyInt(m_corpID) : PyStatic.NewNone());
365  slim->SetItemString("allianceID", IsAlliance(m_allyID) ? new PyInt(m_allyID) : PyStatic.NewNone());
366  slim->SetItemString("warFactionID", IsFaction(m_warID) ? new PyInt(m_warID) : PyStatic.NewNone());
367  if (m_contRef->IsAnchored()) // not sure if this is right...testing
368  slim->SetItemString("structureState", new PyInt(EVEPOS::StructureState::Anchored));
369 
370  if (is_log_enabled(DESTINY__DEBUG)) {
371  _log( DESTINY__DEBUG, "ContainerSE::MakeSlimItem() - %s(%u)", GetName(), GetID());
372  slim->Dump(DESTINY__DEBUG, " ");
373  }
374 
375  return slim;
376 }
377 
378 /*
379  * WreckContainer
380  */
381 WreckContainer::WreckContainer(uint32 _containerID, const ItemType &_containerType, const ItemData &_data)
382 : InventoryItem(_containerID, _containerType, _data),
383 m_delete(false)
384 {
386  m_salvaged = false;
387 
388  _log(ITEM__TRACE, "Created WreckContainer object for item %s (%u).", name(), itemID());
389 }
390 
392 {
393  if (pInventory != nullptr)
394  pInventory->Unload();
396 }
397 
399 {
400  return InventoryItem::Load<WreckContainer>(containerID );
401 }
402 
404  if (!pInventory->LoadContents( ) )
405  return false;
406 
407  return InventoryItem::_Load();
408 }
409 
411  uint32 containerID = WreckContainer::CreateItemID(data );
412  if (containerID == 0 )
413  return WreckContainerRef(nullptr);
414  WreckContainerRef wreckRef = WreckContainer::Load(containerID );
415 
416  // Create default dynamic attributes in the AttributeMap:
417  wreckRef->SetAttribute(AttrShieldCharge, wreckRef->GetAttribute(AttrShieldCapacity), false); // Shield Charge
418  wreckRef->SetAttribute(AttrArmorDamage, EvilZero, false); // Armor Damage
419  wreckRef->SetAttribute(AttrMass, wreckRef->type().mass(), false); // Mass
420  wreckRef->SetAttribute(AttrRadius, wreckRef->type().radius(), false); // Radius
421  wreckRef->SetAttribute(AttrVolume, wreckRef->type().volume(), false); // Volume
422  wreckRef->SetAttribute(AttrCapacity, wreckRef->type().capacity(), false); // Capacity
423 
424  return wreckRef;
425 }
426 
428 {
429  return InventoryItem::CreateItemID(data);
430 }
431 
433 {
434  // verify this is actually called correctly
435  m_delete = true;
439 }
440 
442 {
443  return pInventory->GetCapacity(flag);
444 }
445 
447 {
448  if (!pInventory->LoadContents()) {
449  codelog( ITEM__ERROR, "%s (%u): Failed to load contents for WreckContainerGetInfo", name(), itemID() );
450  return nullptr;
451  }
452 
453  Rsp_CommonGetInfo result;
454  Rsp_CommonGetInfo_Entry entry;
455 
456  //first populate the WreckContainer.
457  if (!Populate( entry ) )
458  return nullptr; //print already done.
459 
460  result.items[ itemID() ] = entry.Encode();
461 
462  return result.Encode();
463 }
464 
466 {
467  // throw();
468  // no code here. should NOT be able to add items to a wreck container.
469  //_log(INV__ERROR, "Adding item to wreck.");
470  sLog.Error("ValidateAddItem", "Adding item to wreck");
471  EvE::traceStack();
472 }
473 
475 {
476  if (iRef.get() == nullptr)
477  return;
478 
480 
481  if (m_salvaged)
482  return;
483 
484  if (pInventory->IsEmpty()) {
486  _log(INV__INFO, "WreckContainer::IsEmpty() for %s(%u)", name(), itemID());
487  }
488 }
489 
491 {
492  if (m_delete)
493  return;
494  if ((mySE == nullptr) or (mySE->SysBubble() == nullptr))
495  return;
496  PyDict* slimPod = mySE->MakeSlimItem();
497  PyTuple* shipData = new PyTuple(2);
498  shipData->SetItem(0, new PyLong(itemID()));
499  shipData->SetItem(1, new PyObject( "foo.SlimItem", slimPod));
500  PyTuple* updates = new PyTuple(2);
501  updates->SetItem(0, new PyString("OnSlimItemChange"));
502  updates->SetItem(1, shipData);
503  //consumes updates
504  mySE->SysBubble()->BubblecastDestinyUpdate(&updates, "destiny" );
505 }
506 
507 // wrecks are invul.
509 : DynamicSystemEntity(self, services, system),
510 m_deleteTimer(sConfig.rates.WorldDecay *60 *1000),
511 m_abandoned(false),
512 m_contRef(self)
513 {
514  assert(m_targMgr != nullptr);
515  assert(m_destiny != nullptr);
516 
517  m_warID = data.factionID;
518  m_allyID = data.allianceID;
519  m_corpID = data.corporationID;
520  m_ownerID = data.ownerID;
521 
523 }
524 
526 {
527  // these are cleared in base class
528  //SafeDelete(m_targMgr);
529  //SafeDelete(m_destiny);
530 }
531 
533  /* Enable base call to Process Targeting and Movement */
535  if (m_deleteTimer.Check(false)) {
537  sLog.Magenta( "WreckSE::Process()", "Garbage Collection is removing Wreck %u.", m_contRef->itemID() );
538  Delete();
539  delete this;
540  }
541 }
542 
544 {
546  m_abandoned = true;
547 }
548 
550 {
551  using namespace Destiny;
552  BallHeader head = BallHeader();
553  head.entityID = GetID();
554  head.radius = GetRadius();
555  head.posX = x();
556  head.posY = y();
557  head.posZ = z();
558  head.mode = Ball::Mode::TROLL;
560  into.Append( head );
561  MassSector mass = MassSector();
562  mass.mass = m_self->type().mass();
563  mass.cloak = 0;
564  mass.harmonic = m_harmonic;
565  mass.corporationID = m_corpID;
566  mass.allianceID = (IsAlliance(m_allyID) ? m_allyID : -1);
567  into.Append( mass );
568  DataSector data = DataSector();
569  data.inertia = 1;
570  data.maxSpeed = 1;
571  data.velX = 0;
572  data.velY = 0;
573  data.velZ = 0;
574  data.speedfraction = 1;
575  into.Append( data );
576  TROLL_Struct troll;
577  troll.formationID = 0xFF;
578  troll.effectStamp = sEntityList.GetStamp();
579  into.Append( troll );
580  _log(SE__DESTINY, "WreckSE::EncodeDestiny(): %s - id:%li, mode:%u, flags:0x%X", GetName(), head.entityID, head.mode, head.flags);
581 }
582 
584  _log(SE__SLIMITEM, "MakeSlimItem for WreckSE %s(%u)", m_self->name(), m_self->itemID());
585  PyTuple* nameID = new PyTuple(2);
586  nameID->SetItem(0, new PyString("UI/Inflight/WreckNameShipName"));
587  PyDict* shipName = new PyDict;
588  shipName->SetItem("shipName", new PyInt(0)); // does this need data here?
589  nameID->SetItem(1, shipName);
590  PyDict *slim = new PyDict();
591  slim->SetItemString("itemID", new PyLong(m_self->itemID()));
592  slim->SetItemString("typeID", new PyInt(m_self->typeID()));
593  slim->SetItemString("name", new PyString(m_self->itemName()));
594  if (m_abandoned or (m_fleetID)) { // this is ONLY for abandoned wrecks or wrecks from fleet ops
595  PyTuple* loot = new PyTuple(4);
596  loot->SetItem(0, new PyInt(m_ownerID));
597  loot->SetItem(1, IsCorp(m_corpID) ? new PyInt(m_corpID) : PyStatic.NewNone());
598  loot->SetItem(2, IsFleetID(m_fleetID) ? new PyInt(m_fleetID) : PyStatic.NewNone());
599  loot->SetItem(3, new PyBool(false)); // what is this??
600  slim->SetItemString("lootRights", loot );
601  }
602  slim->SetItemString("corpID", IsCorp(m_corpID) ? new PyInt(m_corpID) : PyStatic.NewNone());
603  slim->SetItemString("allianceID", IsAlliance(m_allyID) ? new PyInt(m_allyID) : PyStatic.NewNone());
604  slim->SetItemString("warFactionID", IsFaction(m_warID) ? new PyInt(m_warID) : PyStatic.NewNone());
605  slim->SetItemString("isEmpty", new PyBool(m_contRef->IsEmpty()));
606  slim->SetItemString("launcherID", new PyLong(m_launchedByID));
607  slim->SetItemString("securityStatus", new PyInt(0)); //FIXME TODO
608  slim->SetItemString("ownerID", new PyInt(m_ownerID));
609  PyDict* dict = new PyDict;
610  dict->SetItemString("WreckTypeID", new PyInt(m_self->typeID()));
611  PyTuple* tuple2 = new PyTuple(2);
612  tuple2->SetItem(0, new PyString("UI/Inflight/WreckNameTypeID"));
613  tuple2->SetItem(1, dict);
614  slim->SetItemString("nameID", tuple2);
615 
616  if (is_log_enabled(DESTINY__DEBUG)) {
617  _log( DESTINY__DEBUG, "WreckSE::MakeSlimItem() - %s(%u)", GetName(), GetID());
618  slim->Dump(DESTINY__DEBUG, " ");
619  }
620 
621  return slim;
622 }
void Append(const T &value)
Appends a single value to buffer.
Definition: Buffer.h:437
bool IsEmpty()
Definition: Container.h:206
#define sConfig
A macro for easier access to the singleton.
float GetCapacity(EVEItemFlags flag) const
Definition: Inventory.cpp:642
ContainerSE(CargoContainerRef self, PyServiceMgr &services, SystemManager *system, const FactionData &data)
Definition: Container.cpp:229
virtual void Process()
double GetCapacity(EVEItemFlags flag) const
Definition: Container.cpp:441
virtual void RemoveItem(InventoryItemRef iRef)
Definition: Container.cpp:155
PyObject * CargoContainerGetInfo()
Definition: Container.cpp:137
WreckContainerRef m_contRef
Definition: Container.h:270
#define _log(type, fmt,...)
Definition: logsys.h:124
#define sConsole
void Disable()
Definition: timer.h:39
Python string.
Definition: PyRep.h:430
DestinyManager * m_destiny
Definition: SystemEntity.h:265
double GetRadius()
Definition: SystemEntity.h:208
void ClearAllTargets(bool notify=true)
Python's dictionary.
Definition: PyRep.h:719
uint32 m_ownerID
Definition: SystemEntity.h:283
virtual ~CargoContainer()
Definition: Container.cpp:51
virtual void RemoveItem(InventoryItemRef iRef)
static uint32 CreateItemID(ItemData &data)
Definition: Container.cpp:109
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
PyObject * WreckContainerGetInfo()
Definition: Container.cpp:446
EVEItemFlags
Definition: EVE_Flags.h:13
double y()
Definition: SystemEntity.h:214
virtual ~WreckContainer()
Definition: Container.cpp:391
virtual void EncodeDestiny(Buffer &into)
Definition: Container.cpp:549
WreckSE(WreckContainerRef self, PyServiceMgr &services, SystemManager *system, const FactionData &data)
Definition: Container.cpp:508
static CargoContainerRef SpawnTemp(ItemData &data)
Definition: Container.cpp:87
void DeleteContents()
Definition: Inventory.cpp:273
double GetCapacity(EVEItemFlags flag) const
Definition: Container.cpp:128
void Deactivate(int32 effectID)
Definition: Container.cpp:299
virtual bool _Load()
static uint32 CreateItemID(ItemData &data)
Definition: Container.cpp:427
#define sEntityList
Definition: EntityList.h:208
void SetAnchor(bool set=false)
Definition: Container.h:78
static void DeleteLaunch(uint32 contID)
Definition: PlanetDB.cpp:825
virtual void Abandon()
Definition: Container.cpp:543
const char * name()
Python tuple.
Definition: PyRep.h:567
bool IsAnchored()
Definition: Container.h:77
int32 m_harmonic
Definition: SystemEntity.h:276
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
itemID[count] Create count or of the specified item(from Insider)" ) COMMAND( goto
float capacity() const
Definition: ItemType.h:71
virtual ~ContainerSE()
Definition: Container.cpp:258
RefPtr< WreckContainer > WreckContainerRef
Definition: ItemRef.h:62
virtual void EncodeDestiny(Buffer &into)
Definition: Container.cpp:311
virtual void RemoveItem(InventoryItemRef iRef)
Definition: Container.cpp:474
RefPtr< CargoContainer > CargoContainerRef
Definition: ItemRef.h:61
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
virtual void Delete()
CargoContainerRef m_contRef
Definition: Container.h:169
void AnchorContainer()
Definition: Container.cpp:305
signed __int32 int32
Definition: eve-compat.h:49
TargetManager * m_targMgr
Definition: SystemEntity.h:264
Python boolean.
Definition: PyRep.h:323
const ItemType & type() const
void Unload()
Definition: Inventory.cpp:62
#define is_log_enabled(type)
Definition: logsys.h:78
uint32 m_fleetID
Definition: SystemEntity.h:282
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
virtual PyDict * MakeSlimItem()
double GetPackagedVolume()
const ItemType & type() const
Definition: Container.h:202
bool m_abandoned
Definition: Container.h:277
InventoryItemRef m_self
Definition: SystemEntity.h:269
Generic class for buffers.
Definition: Buffer.h:40
virtual void MakeDamageState(DoDestinyDamageState &into) const
Definition: Container.cpp:190
Python object.
Definition: PyRep.h:826
uint32 m_corpID
Definition: SystemEntity.h:281
PyTuple * MakeDamageState()
void ValidateAddItem(EVEItemFlags flag, InventoryItemRef item) const
Definition: Container.cpp:133
Inventory * pInventory
#define codelog(type, fmt,...)
Definition: logsys.h:128
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
float mass() const
Definition: ItemType.h:69
bool m_isAnchored
Definition: Container.h:96
uint32 locationID() const
Python integer.
Definition: PyRep.h:231
static uint32 CreateTempItemID(ItemData &data)
double z()
Definition: SystemEntity.h:215
void SetAttribute(uint16 attrID, int num, bool notify=true)
uint32 GetID()
Definition: SystemEntity.h:207
static CargoContainerRef Spawn(ItemData &data)
Definition: Container.cpp:70
bool Check(bool reset=true)
Definition: timer.cpp:62
#define PyStatic
Definition: PyRep.h:1209
virtual PyDict * MakeSlimItem()
Definition: Container.cpp:356
virtual void Delete()
Definition: Container.cpp:114
X * get() const
Definition: RefPtr.h:213
void ValidateAddItem(EVEItemFlags flag, InventoryItemRef item) const
Definition: Container.cpp:465
static WreckContainerRef Spawn(ItemData &data)
Definition: Container.cpp:410
const char * GetName() const
Definition: SystemEntity.h:210
uint32 quantity
Definition: ItemType.h:191
virtual bool _Load()
Definition: Container.cpp:63
bool Populate(Rsp_CommonGetInfo_Entry &into)
double x()
Definition: SystemEntity.h:213
void MakeSlimItemChange()
Definition: Container.cpp:490
unsigned __int32 uint32
Definition: eve-compat.h:50
uint16 typeID
Definition: ItemType.h:188
uint32 corporationID
bool m_global
Definition: Container.h:173
#define IsCorp(itemID)
Definition: EVE_Defines.h:234
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
virtual void Process()
Definition: Container.cpp:532
double GetFileTimeNow()
Definition: utils_time.cpp:84
void Activate(int32 effectID)
Definition: Container.cpp:282
virtual PyDict * MakeSlimItem()
Definition: Container.cpp:583
const std::string & itemName() const
SystemEntity * mySE
Definition: Container.h:126
#define IsFleetID(itemID)
Definition: EVE_Defines.h:225
static uint32 CreateItemID(ItemData &data)
Timer m_deleteTimer
Definition: Container.h:272
EvilNumber GetAttribute(const uint16 attrID) const
static CargoContainerRef Load(uint32 containerID)
Definition: Container.cpp:58
bool LoadContents()
Definition: Inventory.cpp:113
#define IsFaction(itemID)
Definition: EVE_Defines.h:250
virtual void Process()
Definition: Container.cpp:271
WreckContainer(uint32 _containerID, const ItemType &_containerType, const ItemData &_data)
Definition: Container.cpp:381
void traceStack(void)
Definition: misc.cpp:169
float radius() const
Definition: ItemType.h:68
float volume() const
Definition: ItemType.h:70
virtual void Delete()
#define sItemFactory
Definition: ItemFactory.h:165
bool IsEmpty()
Definition: Inventory.h:55
CargoContainer(uint32 _containerID, const ItemType &_containerType, const ItemData &_data)
Definition: Container.cpp:43
void BubblecastDestinyUpdate(std::vector< PyTuple * > &updates, const char *desc) const
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244
virtual bool _Load()
Definition: Container.cpp:403
virtual ~WreckSE()
Definition: Container.cpp:525
static void UpdateLaunchStatus(uint32 itemID, uint8 status)
Definition: PlanetDB.cpp:187
virtual void Abandon()
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
Timer m_deleteTimer
Definition: Container.h:171
SystemEntity * mySE
Definition: Container.h:230
bool ValidateAddItem(EVEItemFlags flag, InventoryItemRef iRef) const
Definition: Inventory.cpp:747
uint16 typeID() const
uint32 itemID() const
Definition: InventoryItem.h:98
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
uint32 m_launchedByID
Definition: Container.h:274
virtual void Delete()
Definition: Container.cpp:432
Python long integer.
Definition: PyRep.h:261
#define sDataMgr
const ItemType & type() const
Definition: Container.h:83
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81
static WreckContainerRef Load(uint32 containerID)
Definition: Container.cpp:398