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

#include "Container.h"

Inheritance diagram for ContainerSE:
Collaboration diagram for ContainerSE:

Public Member Functions

 ContainerSE (CargoContainerRef self, PyServiceMgr &services, SystemManager *system, const FactionData &data)
 
virtual ~ContainerSE ()
 
virtual bool isGlobal ()
 
virtual ContainerSEGetContSE ()
 
virtual bool IsContainerSE ()
 
virtual void Process ()
 
virtual void EncodeDestiny (Buffer &into)
 
virtual PyDictMakeSlimItem ()
 
virtual void MakeDamageState (DoDestinyDamageState &into)
 
void Activate (int32 effectID)
 
void Deactivate (int32 effectID)
 
void AnchorContainer ()
 
bool IsEmpty ()
 
bool IsAnchored ()
 
void SetGlobal (bool set=false)
 
- Public Member Functions inherited from ItemSystemEntity
 ItemSystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~ItemSystemEntity ()
 
virtual ItemSystemEntityGetItemSE ()
 
virtual bool IsInanimateSE ()
 
virtual bool IsItemEntity ()
 
- Public Member Functions inherited from SystemEntity
 SystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~SystemEntity ()
 
virtual bool ProcessTic ()
 
virtual SystemEntityGetSE ()
 
virtual StaticSystemEntityGetStaticSE ()
 
virtual StationSEGetStationSE ()
 
virtual PlanetSEGetPlanetSE ()
 
virtual MoonSEGetMoonSE ()
 
virtual StargateSEGetGateSE ()
 
virtual BeltSEGetBeltSE ()
 
virtual WreckSEGetWreckSE ()
 
virtual AnomalySEGetAnomalySE ()
 
virtual WormholeSEGetWormholeSE ()
 
virtual FieldSEGetFieldSE ()
 
virtual ProbeSEGetProbeSE ()
 
virtual ObjectSystemEntityGetObjectSE ()
 
virtual AsteroidSEGetAsteroidSE ()
 
virtual StructureSEGetPOSSE ()
 
virtual StructureSEGetJammerSE ()
 
virtual JumpBridgeSEGetJumpBridgeSE ()
 
virtual StructureSEGetOutpostSE ()
 
virtual TowerSEGetTowerSE ()
 
virtual ArraySEGetArraySE ()
 
virtual WeaponSEGetWeaponSE ()
 
virtual BatterySEGetBatterySE ()
 
virtual DeployableSEGetDeployableSE ()
 
virtual SentryGetSentrySE ()
 
virtual ModuleSEGetModuleSE ()
 
virtual ReactorSEGetReactorSE ()
 
virtual CustomsSEGetCOSE ()
 
virtual TCUSEGetTCUSE ()
 
virtual SBUSEGetSBUSE ()
 
virtual IHubSEGetIHubSE ()
 
virtual DynamicSystemEntityGetDynamicSE ()
 
virtual NPCGetNPCSE ()
 
virtual DroneSEGetDroneSE ()
 
virtual MissileGetMissileSE ()
 
virtual ShipSEGetShipSE ()
 
virtual ConcordGetConcordSE ()
 
virtual bool IsSystemEntity ()
 
virtual bool IsStaticEntity ()
 
virtual bool IsBeltSE ()
 
virtual bool IsGateSE ()
 
virtual bool IsPlanetSE ()
 
virtual bool IsMoonSE ()
 
virtual bool IsStationSE ()
 
virtual bool IsAnomalySE ()
 
virtual bool IsWormholeSE ()
 
virtual bool IsCelestialSE ()
 
virtual bool IsFieldSE ()
 
virtual bool IsProbeSE ()
 
virtual bool IsObjectEntity ()
 
virtual bool IsSentrySE ()
 
virtual bool IsPOSSE ()
 
virtual bool IsCOSE ()
 
virtual bool IsTCUSE ()
 
virtual bool IsSBUSE ()
 
virtual bool IsIHubSE ()
 
virtual bool IsTowerSE ()
 
virtual bool IsArraySE ()
 
virtual bool IsJammerSE ()
 
virtual bool IsWeaponSE ()
 
virtual bool IsBatterySE ()
 
virtual bool IsModuleSE ()
 
virtual bool IsMoonMiner ()
 
virtual bool IsOutpostSE ()
 
virtual bool IsAsteroidSE ()
 
virtual bool IsDeployableSE ()
 
virtual bool IsJumpBridgeSE ()
 
virtual bool IsReactorSE ()
 
virtual bool IsOperSE ()
 
virtual bool IsDynamicEntity ()
 
virtual bool IsLogin ()
 
virtual bool IsInvul ()
 
virtual bool IsFrozen ()
 
virtual bool IsNPCSE ()
 
virtual bool IsDroneSE ()
 
virtual bool IsWreckSE ()
 
virtual bool IsMissileSE ()
 
virtual bool IsShipSE ()
 
virtual bool IsConcord ()
 
PyServiceMgrGetServices ()
 
SystemBubbleSysBubble ()
 
SystemManagerSystemMgr ()
 
TargetManagerTargetMgr ()
 
DestinyManagerDestinyMgr ()
 
InventoryItemRef GetSelf ()
 
uint16 GetTypeID ()
 
uint32 GetGroupID ()
 
uint8 GetCategoryID ()
 
EVEItemFlags GetFlag ()
 
uint32 GetID ()
 
double GetRadius ()
 
uint32 GetLocationID ()
 
const char * GetName () const
 
const GPointGetPosition () const
 
void SetPosition (const GPoint &pos)
 
double x ()
 
double y ()
 
double z ()
 
int32 GetAllianceID ()
 
int32 GetWarFactionID ()
 
uint32 GetCorporationID ()
 
uint32 GetOwnerID ()
 
uint32 GetFleetID ()
 
void SetFleetID (uint32 set)
 
int8 GetHarmonic ()
 
void SetHarmonic (int8 set)
 
void DropLoot (WreckContainerRef wreckRef, uint32 groupID, uint32 owner)
 
void AwardSecurityStatus (InventoryItemRef iRef, Character *pChar)
 
void SendDamageStateChanged ()
 
bool ApplyDamage (Damage &d)
 
double DistanceTo2 (const SystemEntity *other)
 
PyTupleMakeDamageState ()
 
virtual void Abandon ()
 
const bool IsDead ()
 
const GVectorGetVelocity ()
 
virtual void Killed (Damage &fatal_blow)
 
virtual void MissileLaunched (Missile *pMissile)
 
virtual void UpdateDamage ()
 
virtual bool LoadExtras ()
 
virtual void Delete ()
 
virtual void SetPilot (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 

Protected Attributes

CargoContainerRef m_contRef
 
Timer m_deleteTimer
 
bool m_global
 
double m_shieldCharge
 
double m_armorDamage
 
double m_hullDamage
 
- Protected Attributes inherited from SystemEntity
SystemBubblem_bubble
 
SystemManagerm_system
 
TargetManagerm_targMgr
 
DestinyManagerm_destiny
 
PyServiceMgrm_services
 
InventoryItemRef m_self
 
bool m_killed
 
double m_radius
 
int32 m_harmonic
 
int32 m_warID
 
int32 m_allyID
 
uint32 m_corpID
 
uint32 m_fleetID
 
uint32 m_ownerID
 

Detailed Description

Definition at line 139 of file Container.h.

Constructor & Destructor Documentation

ContainerSE::ContainerSE ( CargoContainerRef  self,
PyServiceMgr services,
SystemManager system,
const FactionData data 
)

Definition at line 229 of file Container.cpp.

References FactionData::allianceID, AttrCapacity, ItemType::capacity(), FactionData::corporationID, FactionData::factionID, InventoryItem::locationID(), SystemEntity::m_allyID, SystemEntity::m_corpID, m_deleteTimer, SystemEntity::m_destiny, m_global, SystemEntity::m_ownerID, SystemEntity::m_self, SystemEntity::m_targMgr, SystemEntity::m_warID, FactionData::ownerID, EVEDB::invTypes::PlanetaryLaunchContainer, sConfig, sDataMgr, InventoryItem::SetAttribute(), Timer::Start(), InventoryItem::type(), and InventoryItem::typeID().

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 }
#define sConfig
A macro for easier access to the singleton.
DestinyManager * m_destiny
Definition: SystemEntity.h:265
uint32 m_ownerID
Definition: SystemEntity.h:283
float capacity() const
Definition: ItemType.h:71
CargoContainerRef m_contRef
Definition: Container.h:169
TargetManager * m_targMgr
Definition: SystemEntity.h:264
const ItemType & type() const
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
uint32 locationID() const
void SetAttribute(uint16 attrID, int num, bool notify=true)
uint32 corporationID
bool m_global
Definition: Container.h:173
ItemSystemEntity(InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
Timer m_deleteTimer
Definition: Container.h:171
uint16 typeID() const
#define sDataMgr
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

ContainerSE::~ContainerSE ( )
virtual

Definition at line 258 of file Container.cpp.

References TargetManager::ClearAllTargets(), TargetManager::ClearModules(), SystemEntity::m_destiny, SystemEntity::m_targMgr, SafeDelete(), and sConsole.

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 }
#define sConsole
DestinyManager * m_destiny
Definition: SystemEntity.h:265
void ClearAllTargets(bool notify=true)
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
TargetManager * m_targMgr
Definition: SystemEntity.h:264

Here is the call graph for this function:

Member Function Documentation

void ContainerSE::Activate ( int32  effectID)
Todo:
somehow notify client with one of these effects: effectAnchorDrop = 649 effectAnchorLift = 650 effectAnchorDropForStructures = 1022 effectAnchorLiftForStructures = 1023
Todo:
many more effects to send for.....look into later. effectOnlineForStructures = 901
Note
also note there are timers involved here...

Definition at line 282 of file Container.cpp.

283 {
284  // check effectID, check current state, check current timer, set new state, update timer
285 
297 }
void ContainerSE::AnchorContainer ( )

Definition at line 305 of file Container.cpp.

References Timer::Disable(), m_contRef, m_deleteTimer, and CargoContainer::SetAnchor().

Referenced by SystemBubble::MarkBubble().

306 {
308  m_contRef->SetAnchor(true);
309 }
void Disable()
Definition: timer.h:39
void SetAnchor(bool set=false)
Definition: Container.h:78
CargoContainerRef m_contRef
Definition: Container.h:169
Timer m_deleteTimer
Definition: Container.h:171

Here is the call graph for this function:

Here is the caller graph for this function:

void ContainerSE::Deactivate ( int32  effectID)

Definition at line 299 of file Container.cpp.

300 {
301  // check effectID, check current state, check current timer, set new state, update timer
302 
303 }
void ContainerSE::EncodeDestiny ( Buffer into)
virtual

Reimplemented from ItemSystemEntity.

Definition at line 311 of file Container.cpp.

References _log, Destiny::MassSector::allianceID, Buffer::Append(), Destiny::MassSector::cloak, Destiny::MassSector::corporationID, Destiny::TROLL_Struct::effectStamp, Destiny::BallHeader::entityID, Destiny::BallHeader::flags, Destiny::TROLL_Struct::formationID, SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetRadius(), Destiny::MassSector::harmonic, Destiny::DataSector::inertia, IsAlliance, Destiny::Ball::Flag::IsFree, Destiny::Ball::Flag::IsInteractive, SystemEntity::m_allyID, SystemEntity::m_corpID, SystemEntity::m_harmonic, SystemEntity::m_self, ItemType::mass(), Destiny::MassSector::mass, Destiny::DataSector::maxSpeed, Destiny::BallHeader::mode, Destiny::BallHeader::posX, Destiny::BallHeader::posY, Destiny::BallHeader::posZ, Destiny::BallHeader::radius, sEntityList, Destiny::DataSector::speedfraction, Destiny::Ball::Mode::TROLL, InventoryItem::type(), Destiny::DataSector::velX, Destiny::DataSector::velY, Destiny::DataSector::velZ, SystemEntity::x(), SystemEntity::y(), and SystemEntity::z().

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 }
void Append(const T &value)
Appends a single value to buffer.
Definition: Buffer.h:437
#define _log(type, fmt,...)
Definition: logsys.h:124
double GetRadius()
Definition: SystemEntity.h:208
double y()
Definition: SystemEntity.h:214
#define sEntityList
Definition: EntityList.h:208
int32 m_harmonic
Definition: SystemEntity.h:276
const ItemType & type() const
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
float mass() const
Definition: ItemType.h:69
double z()
Definition: SystemEntity.h:215
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
double x()
Definition: SystemEntity.h:213
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244

Here is the call graph for this function:

virtual ContainerSE* ContainerSE::GetContSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 149 of file Container.h.

149 { return this; }
bool ContainerSE::IsAnchored ( )
inline

Definition at line 164 of file Container.h.

References CargoContainer::IsAnchored(), and m_contRef.

Referenced by ActiveModule::CanActivate().

164 { return m_contRef->IsAnchored(); }
bool IsAnchored()
Definition: Container.h:77
CargoContainerRef m_contRef
Definition: Container.h:169

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool ContainerSE::IsContainerSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 151 of file Container.h.

151 { return true; }
bool ContainerSE::IsEmpty ( )
inline

Definition at line 163 of file Container.h.

References CargoContainer::IsEmpty(), and m_contRef.

163 { return m_contRef->IsEmpty(); }
CargoContainerRef m_contRef
Definition: Container.h:169
bool IsEmpty()
Definition: Container.h:92

Here is the call graph for this function:

virtual bool ContainerSE::isGlobal ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 147 of file Container.h.

References m_global.

147 { return m_global; }
bool m_global
Definition: Container.h:173
void ContainerSE::MakeDamageState ( DoDestinyDamageState &  into)
virtual

Reimplemented from ItemSystemEntity.

Definition at line 346 of file Container.cpp.

References GetFileTimeNow().

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 }
double GetFileTimeNow()
Definition: utils_time.cpp:84

Here is the call graph for this function:

PyDict * ContainerSE::MakeSlimItem ( )
virtual

Reimplemented from ItemSystemEntity.

Definition at line 356 of file Container.cpp.

References _log, EVEPOS::StructureState::Anchored, SystemEntity::GetID(), SystemEntity::GetName(), is_log_enabled, IsAlliance, CargoContainer::IsAnchored(), IsCorp, IsFaction, InventoryItem::itemID(), InventoryItem::itemName(), SystemEntity::m_allyID, m_contRef, SystemEntity::m_corpID, SystemEntity::m_ownerID, SystemEntity::m_self, SystemEntity::m_warID, InventoryItem::name(), PyStatic, and InventoryItem::typeID().

356  {
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 }
#define _log(type, fmt,...)
Definition: logsys.h:124
Python string.
Definition: PyRep.h:430
Python's dictionary.
Definition: PyRep.h:719
uint32 m_ownerID
Definition: SystemEntity.h:283
const char * name()
bool IsAnchored()
Definition: Container.h:77
CargoContainerRef m_contRef
Definition: Container.h:169
#define is_log_enabled(type)
Definition: logsys.h:78
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
Python integer.
Definition: PyRep.h:231
uint32 GetID()
Definition: SystemEntity.h:207
#define PyStatic
Definition: PyRep.h:1209
const char * GetName() const
Definition: SystemEntity.h:210
#define IsCorp(itemID)
Definition: EVE_Defines.h:234
const std::string & itemName() const
#define IsFaction(itemID)
Definition: EVE_Defines.h:250
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244
uint16 typeID() const
uint32 itemID() const
Definition: InventoryItem.h:98
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

void ContainerSE::Process ( )
virtual

Reimplemented from SystemEntity.

Definition at line 271 of file Container.cpp.

References Timer::Check(), CargoContainer::Delete(), Timer::Disable(), InventoryItem::itemID(), m_contRef, m_deleteTimer, SystemEntity::Process(), and sLog.

271  {
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 }
virtual void Process()
void Disable()
Definition: timer.h:39
CargoContainerRef m_contRef
Definition: Container.h:169
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
bool Check(bool reset=true)
Definition: timer.cpp:62
virtual void Delete()
Definition: Container.cpp:114
Timer m_deleteTimer
Definition: Container.h:171
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void ContainerSE::SetGlobal ( bool  set = false)
inline

Definition at line 166 of file Container.h.

References m_global.

Referenced by SystemBubble::MarkBubble().

166 { m_global = set; }
bool m_global
Definition: Container.h:173

Here is the caller graph for this function:

Member Data Documentation

double ContainerSE::m_armorDamage
protected

Definition at line 176 of file Container.h.

CargoContainerRef ContainerSE::m_contRef
protected

Definition at line 169 of file Container.h.

Referenced by AnchorContainer(), IsAnchored(), IsEmpty(), MakeSlimItem(), and Process().

Timer ContainerSE::m_deleteTimer
protected

Definition at line 171 of file Container.h.

Referenced by AnchorContainer(), ContainerSE(), and Process().

bool ContainerSE::m_global
protected

Definition at line 173 of file Container.h.

Referenced by ContainerSE(), isGlobal(), and SetGlobal().

double ContainerSE::m_hullDamage
protected

Definition at line 177 of file Container.h.

double ContainerSE::m_shieldCharge
protected

Definition at line 175 of file Container.h.


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