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

#include "Structure.h"

Inheritance diagram for StructureSE:
Collaboration diagram for StructureSE:

Public Member Functions

virtual ~StructureSE ()
 
virtual StructureSEGetPOSSE ()
 
virtual StructureSEGetOutpostSE ()
 
virtual TowerSEGetTowerSE ()
 
virtual ArraySEGetArraySE ()
 
virtual BatterySEGetBatterySE ()
 
virtual WeaponSEGetWeaponSE ()
 
virtual ReactorSEGetReactorSE ()
 
virtual TCUSEGetTCUSE ()
 
virtual SBUSEGetSBUSE ()
 
virtual IHubSEGetIHubSE ()
 
virtual JumpBridgeSEGetJumpBridgeSE ()
 
virtual bool IsPOSSE ()
 
virtual bool IsTCUSE ()
 
virtual bool IsSBUSE ()
 
virtual bool IsIHubSE ()
 
virtual bool IsJammerSE ()
 
virtual bool IsCynoGeneratorSE ()
 
virtual bool IsMoonMiner ()
 
virtual bool IsOutpostSE ()
 
virtual bool IsJumpBridgeSE ()
 
virtual bool IsTowerSE ()
 
virtual bool IsArraySE ()
 
virtual bool IsBatterySE ()
 
virtual bool IsWeaponSE ()
 
virtual bool IsReactorSE ()
 
virtual void MissileLaunched (Missile *pMissile)
 
virtual void Reinforced ()
 
uint8 GetState () const
 
int8 GetProcState ()
 
float GetStatus ()
 
MoonSEGetMoonSE ()
 
PlanetSEGetPlanetSE ()
 
StargateSEGetGateSE ()
 
void SetPOSState (uint8 state)
 
void SetTimer (uint32 time)
 
int8 CanUse ()
 
int8 CanView ()
 
int8 CanTake ()
 
void SetPlanet (uint32 planetID)
 
uint32 GetPlanetID ()
 
void UpdateTimeStamp ()
 
void UpdateUsageFlags ()
 
bool IsReinforced ()
 
- Public Member Functions inherited from DynamicSystemEntity
 DynamicSystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~DynamicSystemEntity ()
 
virtual DynamicSystemEntityGetDynamicSE ()
 
virtual bool IsDynamicEntity ()
 
virtual void UpdateDamage ()
 
virtual void MakeDamageState (DoDestinyDamageState &into)
 
virtual bool Load ()
 
virtual bool IsInvul ()
 
virtual bool IsFrozen ()
 
void AwardBounty (Client *pClient)
 
void SetInvul (bool invul=false)
 
void SetFrozen (bool frozen=false)
 
- 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 BeltSEGetBeltSE ()
 
virtual ItemSystemEntityGetItemSE ()
 
virtual ContainerSEGetContSE ()
 
virtual WreckSEGetWreckSE ()
 
virtual AnomalySEGetAnomalySE ()
 
virtual WormholeSEGetWormholeSE ()
 
virtual FieldSEGetFieldSE ()
 
virtual ProbeSEGetProbeSE ()
 
virtual ObjectSystemEntityGetObjectSE ()
 
virtual AsteroidSEGetAsteroidSE ()
 
virtual StructureSEGetJammerSE ()
 
virtual DeployableSEGetDeployableSE ()
 
virtual SentryGetSentrySE ()
 
virtual ModuleSEGetModuleSE ()
 
virtual CustomsSEGetCOSE ()
 
virtual NPCGetNPCSE ()
 
virtual DroneSEGetDroneSE ()
 
virtual MissileGetMissileSE ()
 
virtual ShipSEGetShipSE ()
 
virtual ConcordGetConcordSE ()
 
virtual bool isGlobal ()
 
virtual bool IsSystemEntity ()
 
virtual bool IsInanimateSE ()
 
virtual bool IsStaticEntity ()
 
virtual bool IsBeltSE ()
 
virtual bool IsGateSE ()
 
virtual bool IsPlanetSE ()
 
virtual bool IsMoonSE ()
 
virtual bool IsStationSE ()
 
virtual bool IsItemEntity ()
 
virtual bool IsAnomalySE ()
 
virtual bool IsWormholeSE ()
 
virtual bool IsCelestialSE ()
 
virtual bool IsContainerSE ()
 
virtual bool IsFieldSE ()
 
virtual bool IsProbeSE ()
 
virtual bool IsObjectEntity ()
 
virtual bool IsSentrySE ()
 
virtual bool IsCOSE ()
 
virtual bool IsModuleSE ()
 
virtual bool IsAsteroidSE ()
 
virtual bool IsDeployableSE ()
 
virtual bool IsOperSE ()
 
virtual bool IsLogin ()
 
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 bool LoadExtras ()
 
virtual void Delete ()
 
virtual void SetPilot (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 

Protected Attributes

PosMgrDB m_db
 
MoonSEm_moonSE
 
PlanetSEm_planetSE
 
TowerSEm_towerSE
 
TCUSEm_tcuSE
 
SBUSEm_sbuSE
 
IHubSEm_ihubSE
 
JumpBridgeSEm_bridgeSE
 
StargateSEm_gateSE
 
EVEPOS::StructureData m_data
 
int8 m_procState
 
uint32 m_delayTime
 
GVector m_rotation
 
uint32 m_anchorPointID
 
- 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
 

Private Attributes

uint32 m_duration
 
Timer m_procTimer
 
bool m_tcu:1
 
bool m_sbu:1
 
bool m_ihub:1
 
bool m_tower:1
 
bool m_miner:1
 
bool m_bridge:1
 
bool m_jammer:1
 
bool m_generator:1
 
bool m_loaded:1
 
bool m_module:1
 
bool m_reactor:1
 
bool m_outpost:1
 

Structure.cpp

Generic Base Class for POS items and entities.

: Allan

Date
: unknown Updates: James
 StructureSE (StructureItemRef structure, PyServiceMgr &services, SystemManager *system, const FactionData &data)
 
virtual void Process ()
 
virtual void EncodeDestiny (Buffer &into)
 
virtual PyDictMakeSlimItem ()
 
virtual void Killed (Damage &fatal_blow)
 
virtual void Init ()
 
virtual void InitData ()
 
virtual void Scoop ()
 
virtual void SetOnline ()
 
virtual void SetOffline ()
 
virtual void SetInvulnerable ()
 
virtual void SetVulnerable ()
 
virtual void Online ()
 
virtual void SetOperating ()
 
virtual void Operating ()
 
void Drop (SystemBubble *pBubble)
 
void Anchor ()
 
void Offline ()
 
void PullAnchor ()
 
void SetAnchor (Client *pClient, GPoint &pos)
 
void Activate (int32 effectID)
 
void Deactivate (int32 effectID)
 
void GetEffectState (PyList &into)
 
void SetUsageFlags (int8 view=0, int8 take=0, int8 use=0)
 
void SendSlimUpdate ()
 
void SendEffectUpdate (int16 effectID, bool active)
 

Detailed Description

Definition at line 98 of file Structure.h.

Constructor & Destructor Documentation

StructureSE::StructureSE ( StructureItemRef  structure,
PyServiceMgr services,
SystemManager system,
const FactionData data 
)
Todo:
this is direction from customs office to planet and set when co is created

Definition at line 193 of file Structure.cpp.

References _log, FactionData::allianceID, FactionData::corporationID, Timer::Disable(), FactionData::factionID, SystemEntity::m_allyID, SystemEntity::m_corpID, m_data, SystemEntity::m_ownerID, m_procTimer, SystemEntity::m_warID, FactionData::ownerID, EVEPOS::StructureData::state, and EVEPOS::EntityState::Unanchored.

194  : DynamicSystemEntity(structure, services, system),
195  m_moonSE(nullptr),
196  m_planetSE(nullptr),
197  m_towerSE(nullptr),
198  m_tcuSE(nullptr),
199  m_sbuSE(nullptr),
200  m_ihubSE(nullptr),
201  m_gateSE(nullptr),
202  m_bridgeSE(nullptr),
203  m_procTimer(10000), // arbitrary default
204  m_tcu(false),
205  m_sbu(false),
206  m_ihub(false),
207  m_miner(false),
208  m_tower(false),
209  m_bridge(false),
210  m_jammer(false),
211  m_generator(false),
212  m_loaded(false),
213  m_module(false),
214  m_outpost(false),
215  m_reactor(false),
216  m_duration(0),
217  m_anchorPointID(0),
218  m_delayTime(0),
222  m_data(EVEPOS::StructureData())// zero-init data
223 {
225 
226  m_warID = data.factionID;
227  m_allyID = data.allianceID;
228  m_corpID = data.corporationID;
229  m_ownerID = data.ownerID;
230 
231  // update StructureItem with SE;
232  structure->SetMySE(this);
233 
234  // set valid stateName
236 
237  _log(SE__DEBUG, "Created StructureSE for item %s (%u).", structure->name(), structure->itemID());
238 }
bool m_loaded
Definition: Structure.h:236
bool m_tower
Definition: Structure.h:231
bool m_outpost
Definition: Structure.h:239
#define _log(type, fmt,...)
Definition: logsys.h:124
SBUSE * m_sbuSE
Definition: Structure.h:207
void Disable()
Definition: timer.h:39
uint32 m_ownerID
Definition: SystemEntity.h:283
uint32 m_delayTime
Definition: Structure.h:217
IHubSE * m_ihubSE
Definition: Structure.h:208
StargateSE * m_gateSE
Definition: Structure.h:210
bool m_ihub
Definition: Structure.h:230
bool m_reactor
Definition: Structure.h:238
Timer m_procTimer
Definition: Structure.h:226
int8 m_procState
Definition: Structure.h:214
uint32 m_duration
Definition: Structure.h:224
bool m_jammer
Definition: Structure.h:234
bool m_generator
Definition: Structure.h:235
bool m_tcu
Definition: Structure.h:228
PlanetSE * m_planetSE
Definition: Structure.h:204
uint32 m_corpID
Definition: SystemEntity.h:281
static const GPoint NULL_ORIGIN(0, 0, 0)
JumpBridgeSE * m_bridgeSE
Definition: Structure.h:209
TowerSE * m_towerSE
Definition: Structure.h:205
EVEPOS::StructureData m_data
Definition: Structure.h:212
uint32 corporationID
GVector m_rotation
Definition: Structure.h:220
TCUSE * m_tcuSE
Definition: Structure.h:206
bool m_miner
Definition: Structure.h:232
MoonSE * m_moonSE
Definition: Structure.h:203
bool m_sbu
Definition: Structure.h:229
DynamicSystemEntity(InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
bool m_module
Definition: Structure.h:237
uint32 m_anchorPointID
Definition: Structure.h:221
bool m_bridge
Definition: Structure.h:233

Here is the call graph for this function:

virtual StructureSE::~StructureSE ( )
inlinevirtual

Definition at line 103 of file Structure.h.

103 { /* do nothing here */ }

Member Function Documentation

void StructureSE::Activate ( int32  effectID)
Todo:
check for other modules changing state...only allow one at a time

Definition at line 775 of file Structure.cpp.

References _log, UserError::AddAmount(), UserError::AddFormatValue(), EVEPOS::StructureState::Anchored, AttrCpu, AttrCpuOutput, AttrOnliningDelay, AttrPower, AttrPowerOutput, EvilNumber::get_float(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), TowerSE::GetCPULoad(), GetFileTimeNow(), TowerSE::GetPGLoad(), SystemEntity::GetSelf(), TowerSE::HasCPU(), TowerSE::HasPG(), EVEPOS::StructureData::itemID, m_data, m_db, m_delayTime, SystemEntity::m_destiny, m_ihub, m_module, m_procState, m_procTimer, m_sbu, SystemEntity::m_self, m_tcu, m_tower, m_towerSE, InventoryItem::name(), TowerSE::OnlineModule(), EVEPOS::ProcState::Onlining, EVEPOS::StructureState::Onlining, SendSlimUpdate(), DestinyManager::SendSpecialEffect(), Timer::SetTimer(), EVEPOS::StructureData::state, EVEPOS::StructureData::timestamp, EVEPOS::StructureData::towerID, InventoryItem::typeID(), and PosMgrDB::UpdateBaseData().

776 {
778  return; // make error here?
779 
782  // check effectID, check current state, check current timer, set new state, update timer
783 
784  if (m_tower)
785  {
786  // if tower, check fuel quantity for onlining
787  // if qty sufficient, begin online proc and send OnSlimItemChange and OnSpecialFX
788  }
789  else if (m_module)
790  {
791  if (m_towerSE == nullptr)
792  {
793  _log(POS__ERROR, "POS Module %s(%u) has no TowerSE for tower %u", m_self->name(), m_data.itemID, m_data.towerID);
794  return;
795  }
797  {
798  // throwing an error negates further processing
800  float remaining = total - m_towerSE->GetCPULoad();
801  throw UserError ("NotEnoughCpu")
802  .AddAmount ("total", total)
803  .AddAmount ("require", m_self->GetAttribute (AttrCpu).get_float ())
804  .AddAmount ("remaining", remaining)
805  .AddFormatValue ("moduleType", new PyInt (m_self->typeID ()));
806  }
808  {
809  // throwing an error negates further processing
811  float remaining = total - m_towerSE->GetPGLoad();
812  throw UserError ("NotEnoughPower")
813  .AddAmount ("total", total)
814  .AddAmount ("require", m_self->GetAttribute (AttrPower).get_float ())
815  .AddAmount ("remaining", remaining)
816  .AddFormatValue ("moduleType", new PyInt (m_self->typeID ()));
817  }
818  }
819 
820  // check for things that DONT use a tower. not sure if we need anymore checks here.
821  //yes....all sov structures will need checks for activation
822  // ?? can you activate a sov structure?
823  else if (m_tcu)
824  {
825  // Check some things for TCU onlining
826 
827  /*
828  Is there already a TCU in the system?
829  */
830  }
831  else if (m_sbu)
832  {
833  // Check some things for SBU onlining
834  }
835  else if (m_ihub)
836  {
837  // Check some things for IHUB onlining
838  }
839 
845 
846  SendSlimUpdate();
847  m_destiny->SendSpecialEffect(m_data.itemID, m_data.itemID, m_self->typeID(), 0, 0, "effects.StructureOnline", 0, 1, 1, -1, 0);
848 
849  // should this be done here?
850  if (m_module)
851  m_towerSE->OnlineModule(this);
852 
854 }
bool m_tower
Definition: Structure.h:231
#define _log(type, fmt,...)
Definition: logsys.h:124
DestinyManager * m_destiny
Definition: SystemEntity.h:265
void SetTimer(uint32 setTimerTime=0)
Definition: timer.cpp:102
void UpdateBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:132
float GetCPULoad()
Definition: Tower.h:115
uint32 m_delayTime
Definition: Structure.h:217
bool m_ihub
Definition: Structure.h:230
Timer m_procTimer
Definition: Structure.h:226
int8 m_procState
Definition: Structure.h:214
UserError & AddFormatValue(const char *name, PyRep *value)
Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.
const char * name()
bool HasCPU(float amount)
Definition: Tower.h:112
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
bool m_tcu
Definition: Structure.h:228
UserError & AddAmount(const char *name, int quantity)
Shorthand method for adding a quantity value.
InventoryItemRef m_self
Definition: SystemEntity.h:269
InventoryItemRef GetSelf()
Definition: SystemEntity.h:202
float GetPGLoad()
Definition: Tower.h:114
uint32 get_uint32()
Definition: EvilNumber.cpp:173
Python integer.
Definition: PyRep.h:231
TowerSE * m_towerSE
Definition: Structure.h:205
EVEPOS::StructureData m_data
Definition: Structure.h:212
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
double GetFileTimeNow()
Definition: utils_time.cpp:84
void SendSlimUpdate()
Definition: Structure.cpp:966
EvilNumber GetAttribute(const uint16 attrID) const
bool m_sbu
Definition: Structure.h:229
void OnlineModule(StructureSE *pSE)
Definition: Tower.h:106
float get_float()
Definition: EvilNumber.cpp:184
PosMgrDB m_db
Definition: Structure.h:201
bool m_module
Definition: Structure.h:237
bool HasPG(float amount)
Definition: Tower.h:110
uint16 typeID() const

Here is the call graph for this function:

void StructureSE::Anchor ( )

Definition at line 1378 of file Structure.cpp.

1379 {
1380 }
int8 StructureSE::CanTake ( )
inline

Definition at line 183 of file Structure.h.

References m_data, and EVEPOS::StructureData::take.

183 { return m_data.take; }
EVEPOS::StructureData m_data
Definition: Structure.h:212
int8 StructureSE::CanUse ( )
inline

Definition at line 181 of file Structure.h.

References m_data, and EVEPOS::StructureData::use.

181 { return m_data.use; }
EVEPOS::StructureData m_data
Definition: Structure.h:212
int8 StructureSE::CanView ( )
inline

Definition at line 182 of file Structure.h.

References m_data, and EVEPOS::StructureData::view.

182 { return m_data.view; }
EVEPOS::StructureData m_data
Definition: Structure.h:212
void StructureSE::Deactivate ( int32  effectID)

Definition at line 856 of file Structure.cpp.

References GetFileTimeNow(), m_data, m_db, m_delayTime, m_procState, m_procTimer, EVEPOS::ProcState::Offlining, SendSlimUpdate(), Timer::SetTimer(), EVEPOS::StructureData::timestamp, and PosMgrDB::UpdateBaseData().

857 {
859  m_delayTime = 500 /*m_self->GetAttribute(AttrOnliningDelay).get_uint32()*/;
862 
864 
865  SendSlimUpdate();
866  //m_destiny->SendSpecialEffect(m_data.itemID,m_data.itemID,m_self->typeID(),0,0,"effects.StructureOnline",0,0,0,-1,0);
867 }
void SetTimer(uint32 setTimerTime=0)
Definition: timer.cpp:102
void UpdateBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:132
uint32 m_delayTime
Definition: Structure.h:217
Timer m_procTimer
Definition: Structure.h:226
int8 m_procState
Definition: Structure.h:214
EVEPOS::StructureData m_data
Definition: Structure.h:212
double GetFileTimeNow()
Definition: utils_time.cpp:84
void SendSlimUpdate()
Definition: Structure.cpp:966
PosMgrDB m_db
Definition: Structure.h:201

Here is the call graph for this function:

void StructureSE::Drop ( SystemBubble pBubble)

Definition at line 561 of file Structure.cpp.

References Init(), and SystemEntity::m_bubble.

562 {
563  // this is for dropping POS where Init() and Add() each need info from the other.
564  m_bubble = pBubble;
565  Init();
566  // now null bubble to be added correctly
567  m_bubble = nullptr;
568 }
SystemBubble * m_bubble
Definition: SystemEntity.h:262
virtual void Init()
Definition: Structure.cpp:275

Here is the call graph for this function:

void StructureSE::EncodeDestiny ( Buffer into)
virtual
Todo:
these may need more work....

Reimplemented from DynamicSystemEntity.

Definition at line 1017 of file Structure.cpp.

References _log, Destiny::MassSector::allianceID, EVEPOS::StructureState::Anchored, Buffer::Append(), Destiny::MassSector::cloak, Destiny::MassSector::corporationID, Destiny::BallHeader::entityID, Destiny::BallHeader::flags, Destiny::STOP_Struct::formationID, Destiny::RIGID_Struct::formationID, SystemEntity::GetName(), SystemEntity::GetRadius(), Destiny::MassSector::harmonic, Destiny::DataSector::inertia, IsAlliance, Destiny::Ball::Flag::IsFree, Destiny::Ball::Flag::IsGlobal, EVEPOS::StructureData::itemID, SystemEntity::m_allyID, SystemEntity::m_corpID, m_data, SystemEntity::m_harmonic, m_ihub, m_sbu, SystemEntity::m_self, m_tcu, m_tower, main(), ItemType::mass(), Destiny::MassSector::mass, Destiny::DataSector::maxSpeed, Destiny::BallHeader::mode, Destiny::BallHeader::posX, Destiny::BallHeader::posY, Destiny::BallHeader::posZ, Destiny::BallHeader::radius, Destiny::Ball::Mode::RIGID, Destiny::DataSector::speedfraction, EVEPOS::StructureData::state, Destiny::Ball::Mode::STOP, InventoryItem::type(), Destiny::DataSector::velX, Destiny::DataSector::velY, Destiny::DataSector::velZ, SystemEntity::x(), SystemEntity::y(), and SystemEntity::z().

1018 {
1019  using namespace Destiny;
1020  //const uint16 miniballsCount = GetMiniBalls();
1021  BallHeader head = BallHeader();
1022  head.entityID = m_data.itemID;
1023  head.radius = GetRadius();
1024  head.posX = x();
1025  head.posY = y();
1026  head.posZ = z();
1027  if (m_tcu or m_ihub or m_sbu)
1028  {
1029  // may need to update this after things are working
1030  head.mode = Ball::Mode::RIGID;
1031  head.flags = Ball::Flag::IsGlobal;
1032  }
1033  else if (m_tower)
1034  {
1035  head.mode = Ball::Mode::STOP;
1036  head.flags = (m_data.state < EVEPOS::StructureState::Anchored ? Ball::Flag::IsFree : 0) /*Ball::Flag::HasMiniBalls*/;
1037  }
1038  else
1039  {
1040  head.mode = Ball::Mode::RIGID;
1041  //TODO check for miniballs and add here if found.
1042  head.flags = (m_data.state < EVEPOS::StructureState::Anchored ? Ball::Flag::IsFree : 0 /*Ball::Flag::IsMassive*/) /*Ball::Flag::HasMiniBalls*/;
1043  }
1044  into.Append(head);
1045 
1047  if (head.mode != Ball::Mode::RIGID)
1048  {
1049  MassSector mass = MassSector();
1050  mass.cloak = 0;
1051  mass.corporationID = m_corpID;
1052  mass.allianceID = (IsAlliance(m_allyID) ? m_allyID : -1);
1053  mass.harmonic = m_harmonic;
1054  mass.mass = m_self->type().mass();
1055  into.Append(mass);
1056  }
1057 
1059  DataSector data = DataSector();
1060  data.inertia = 1;
1061  data.velX = 0;
1062  data.velY = 0;
1063  data.velZ = 0;
1064  data.maxSpeed = 1;
1065  data.speedfraction = 0;
1066  into.Append( data );
1067  }
1068 
1069 
1070  /* TODO query and configure miniballs for entity
1071  * NOTE MiniBalls are BROKEN!!! DO NOT USE!
1072  into.Append( miniballsCount );
1073  MiniBall miniball;
1074  for (int16 i; i<miniballsCount; i++) {
1075  miniball.x = -7701.181;
1076  miniball.y = 8060.06;
1077  miniball.z = 27878.900;
1078  miniball.radius = 1639.241;
1079  into.Append( miniball );
1080  miniball.clear();
1081  }
1082  [MiniBall]
1083  [Radius: 963.8593]
1084  [Offset: (0, -2302, 1)]
1085  [MiniBall]
1086  [Radius: 1166.27]
1087  [Offset: (0, 1298, 1)]
1088  [MiniBall]
1089  [Radius: 876.2357]
1090  [Offset: (0, -502, 1)]
1091  [MiniBall]
1092  [Radius: 796.5781]
1093  [Offset: (0, 2598, 1)]
1094  */
1095  if (head.mode == Ball::Mode::RIGID)
1096  {
1098  main.formationID = 0xFF;
1099  into.Append(main);
1100  }
1101  else if (head.mode == Ball::Mode::STOP)
1102  {
1103  STOP_Struct main;
1104  main.formationID = 0xFF;
1105  into.Append(main);
1106  }
1107 
1108  _log(SE__DESTINY, "StructureSE::EncodeDestiny(): %s - id:%li, mode:%u, flags:0x%X", GetName(), head.entityID, head.mode, head.flags);
1109  _log(POS__DESTINY, "StructureSE::EncodeDestiny(): %s - id:%li, mode:%u, flags:0x%X", GetName(), head.entityID, head.mode, head.flags);
1110 }
void Append(const T &value)
Appends a single value to buffer.
Definition: Buffer.h:437
bool m_tower
Definition: Structure.h:231
#define _log(type, fmt,...)
Definition: logsys.h:124
double GetRadius()
Definition: SystemEntity.h:208
double y()
Definition: SystemEntity.h:214
bool m_ihub
Definition: Structure.h:230
int32 m_harmonic
Definition: SystemEntity.h:276
const ItemType & type() const
bool m_tcu
Definition: Structure.h:228
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
const char * GetName() const
Definition: SystemEntity.h:210
EVEPOS::StructureData m_data
Definition: Structure.h:212
double x()
Definition: SystemEntity.h:213
int main(int argc, char *argv[])
bool m_sbu
Definition: Structure.h:229
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244

Here is the call graph for this function:

virtual ArraySE* StructureSE::GetArraySE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in ArraySE.

Definition at line 109 of file Structure.h.

109 { return nullptr; }
virtual BatterySE* StructureSE::GetBatterySE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in BatterySE.

Definition at line 110 of file Structure.h.

110 { return nullptr; }
void StructureSE::GetEffectState ( PyList into)

Definition at line 1182 of file Structure.cpp.

References PyList::AddItem(), EVEPOS::StructureData::itemID, m_data, m_module, SystemEntity::m_self, EVEPOS::StructureState::Online, EVEPOS::StructureState::Operating, EVEPOS::StructureData::state, EVEPOS::StructureData::timestamp, EVEPOS::StructureData::towerID, and InventoryItem::typeID().

1183 {
1184  // this is for sending structure state info in destiny state data
1186  return;
1187 
1188  OnSpecialFX13 effect;
1189  if (m_module)
1190  {
1191  effect.entityID = m_data.towerID; /* control tower id */
1192  }
1193  else
1194  {
1195  effect.entityID = m_data.itemID; /* control tower id */
1196  }
1197  effect.moduleID = m_data.itemID; /* structure/module id as part of above tower system */
1198  effect.moduleTypeID = m_self->typeID();
1199  effect.duration = -1;
1200  effect.guid = "effects.StructureOnline"; // this is sent in destiny::SetState. check for actual effect of this pos
1201  effect.isOffensive = false;
1202  effect.start = 1;
1203  effect.active = 1;
1204  effect.startTime = m_data.timestamp; /* time this effect started */
1205  into.AddItem(effect.Encode());
1206 }
void AddItem(PyRep *i)
Definition: PyRep.h:701
InventoryItemRef m_self
Definition: SystemEntity.h:269
EVEPOS::StructureData m_data
Definition: Structure.h:212
bool m_module
Definition: Structure.h:237
uint16 typeID() const

Here is the call graph for this function:

StargateSE* StructureSE::GetGateSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 175 of file Structure.h.

References m_gateSE.

175 { return m_gateSE; }
StargateSE * m_gateSE
Definition: Structure.h:210
virtual IHubSE* StructureSE::GetIHubSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in IHubSE.

Definition at line 115 of file Structure.h.

115 { return nullptr; }
virtual JumpBridgeSE* StructureSE::GetJumpBridgeSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in JumpBridgeSE.

Definition at line 116 of file Structure.h.

116 { return nullptr; }
MoonSE* StructureSE::GetMoonSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 173 of file Structure.h.

References m_moonSE.

173 { return m_moonSE; }
MoonSE * m_moonSE
Definition: Structure.h:203
virtual StructureSE* StructureSE::GetOutpostSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 107 of file Structure.h.

References m_outpost.

107 { return (m_outpost ? this : nullptr); }
bool m_outpost
Definition: Structure.h:239
uint32 StructureSE::GetPlanetID ( )
inline

Definition at line 187 of file Structure.h.

References m_anchorPointID.

187 { return m_anchorPointID; }
uint32 m_anchorPointID
Definition: Structure.h:221
PlanetSE* StructureSE::GetPlanetSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 174 of file Structure.h.

References m_planetSE.

174 { return m_planetSE; } //Planets are required for sovereignty structures
PlanetSE * m_planetSE
Definition: Structure.h:204
virtual StructureSE* StructureSE::GetPOSSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 106 of file Structure.h.

106 { return this; }
int8 StructureSE::GetProcState ( )
inline

Definition at line 171 of file Structure.h.

References m_procState.

171 { return m_procState; }
int8 m_procState
Definition: Structure.h:214
virtual ReactorSE* StructureSE::GetReactorSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in ReactorSE.

Definition at line 112 of file Structure.h.

112 { return nullptr; }
virtual SBUSE* StructureSE::GetSBUSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in SBUSE.

Definition at line 114 of file Structure.h.

114 { return nullptr; }
uint8 StructureSE::GetState ( ) const
inline

Definition at line 170 of file Structure.h.

References m_data, and EVEPOS::StructureData::state.

Referenced by StructureItem::Rename(), and TargetManager::StartTargeting().

170 { return m_data.state; }
EVEPOS::StructureData m_data
Definition: Structure.h:212

Here is the caller graph for this function:

float StructureSE::GetStatus ( )
inline

Definition at line 172 of file Structure.h.

References m_data, and EVEPOS::StructureData::status.

172 { return m_data.status; }
EVEPOS::StructureData m_data
Definition: Structure.h:212
virtual TCUSE* StructureSE::GetTCUSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in TCUSE.

Definition at line 113 of file Structure.h.

113 { return nullptr; }
virtual TowerSE* StructureSE::GetTowerSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in TowerSE.

Definition at line 108 of file Structure.h.

108 { return nullptr; }
virtual WeaponSE* StructureSE::GetWeaponSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in WeaponSE.

Definition at line 111 of file Structure.h.

111 { return nullptr; }
void StructureSE::Init ( )
virtual
Todo:
(Allan) do we need anything else here? check for and set system-wide cyno jammer? as we're nowhere even close to needing/using cyno, this can wait note: set generator active in mapDynamicData on activation of this module
Todo:
check for timestamp here and see if any processes are running. if so, set varaibles accordingly and continue.

Reimplemented in ReactorSE, JumpBridgeSE, TCUSE, TowerSE, ModuleSE, IHubSE, SBUSE, ArraySE, BatterySE, and WeaponSE.

Definition at line 275 of file Structure.cpp.

References _log, TowerSE::AddModule(), EVEPOS::StructureState::Anchored, EVEPOS::StructureData::anchorpointID, AttrPosControlTowerPeriod, EVEDB::invGroups::Control_Tower, EVEDB::invGroups::Cynosural_Generator_Array, EVEDB::invGroups::Cynosural_System_Jammer, flagStructureActive, flagStructureInactive, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), PosMgrDB::GetBaseData(), SystemEntity::GetGateSE(), SystemEntity::GetIHubSE(), SystemEntity::GetJumpBridgeSE(), SystemEntity::GetMoonSE(), SystemEntity::GetPosition(), SystemEntity::GetSBUSE(), SystemManager::GetSE(), SystemEntity::GetTCUSE(), SystemEntity::GetTowerSE(), InventoryItem::groupID(), EVEDB::invGroups::Infrastructure_Hubs, InitData(), IsStaticMapItem, EVEPOS::StructureData::itemID, InventoryItem::itemID(), EVEDB::invGroups::Jump_Portal_Array, m_bridge, m_bridgeSE, m_data, m_db, m_duration, m_gateSE, m_generator, m_ihub, m_ihubSE, m_jammer, m_loaded, m_miner, m_module, m_moonSE, m_reactor, m_rotation, m_sbu, m_sbuSE, SystemEntity::m_self, SystemEntity::m_system, m_tcu, m_tcuSE, m_tower, m_towerSE, EVEDB::invGroups::Mobile_Reactor, EVEDB::invGroups::Moon_Mining, InventoryItem::name(), Ga::GaVec3::normalize(), EVEDB::invGroups::Orbital_Infrastructure, InventoryItem::position(), SystemManager::RemoveEntity(), PosMgrDB::SaveBaseData(), InventoryItem::SetFlag(), EVEDB::invGroups::Silo, sLog, EVEDB::invGroups::Sovereignty_Blockade_Units, EVEPOS::StructureData::state, EVEDB::invGroups::Territorial_Claim_Units, EVEPOS::StructureData::timestamp, EVEPOS::StructureData::towerID, EvE::traceStack(), and EVEPOS::StructureState::Unanchored.

Referenced by Drop(), ArraySE::Init(), BatterySE::Init(), WeaponSE::Init(), ModuleSE::Init(), SBUSE::Init(), IHubSE::Init(), TCUSE::Init(), TowerSE::Init(), JumpBridgeSE::Init(), and ReactorSE::Init().

276 {
277  // are we already initialized?
278  if (m_loaded)
279  return;
280 
281  // init all data here.
282  m_data.itemID = m_self->itemID();
283  if (m_data.itemID == 0)
284  {
285  // how the hell is itemID 0 here??
286  sLog.Error("StructureSE::Init", "ItemID is 0.");
287  EvE::traceStack();
288  m_system->RemoveEntity(this); //this may segfault here....
289  return;
290  }
293 
294  switch (m_self->groupID()) {
296  // should not hit here, but dont want to use 'default'
297  sLog.Error("StructureSE::Init", "groupID is Orbital_Infrastructure.");
298  EvE::traceStack();
299  } break;
301  m_sbu = true;
302  } break;
304  m_tower = true;
306  } break;
308  m_tcu = true;
309  } break;
311  m_bridge = true;
312  m_module = true;
313  } break;
319  m_jammer = true;
320  m_module = true;
321  } break;
323  m_generator = true;
324  m_module = true;
325  } break;
328  m_module = true;
329  m_reactor = true;
330  } break;
332  m_miner = true;
333  m_module = true;
334  m_reactor = true;
335  } break;
337  m_ihub = true;
338  } break;
339  default: {
340  m_module = true;
341  }
342  }
343 
344  if (!m_db.GetBaseData(m_data))
345  {
346  _log(POS__MESSAGE, "StructureSE::Init %s(%u) has no saved data. Initializing default set.", m_self->name(), m_data.itemID);
347  InitData();
349  }
350 
351  m_loaded = true;
352 
353  if (m_tcu or m_ihub) {
356  return;
357  }
358 
360  // make error here. this should never hit.
361  _log(POS__MESSAGE, "StructureSE::Init %s(%u) - anchorpointID is invalid. Load Failure.", m_self->name(), m_data.itemID);
362  m_loaded = false;
363  return;
364  }
365 
366  //Get entity for anchor point (type is determined by what is being anchored)
368  if (pSE == nullptr)
369  {
370  _log(POS__WARNING, "StructureSE::Init %s(%u) - Cannot find SE for anchorpointID %u. Load Failure.", \
372  m_loaded = false;
373  return;
374  }
375 
376  if (m_tcu)
377  {
378  m_tcuSE = pSE->GetTCUSE();
379  }
380 
381  if (m_sbu) //anchored near stargates, so we need a stargate
382  {
383  m_sbuSE = pSE->GetSBUSE();
384  if (m_gateSE == nullptr)
385  {
386  m_gateSE = pSE->GetGateSE();
387  }
388  }
389  if (m_ihub)
390  {
391  m_ihubSE = pSE->GetIHubSE();
392  }
393  if (m_bridge)
394  {
395  m_bridgeSE = pSE->GetJumpBridgeSE();
396  }
397  else //everything else is anchored near a moon
398  {
399  if (m_moonSE == nullptr)
400  {
401  m_moonSE = pSE->GetMoonSE();
402  }
403  }
404 
405  if (m_miner)
406  {
407  // need to verify m_moonSE isnt null at this point.
408  if (m_moonSE == nullptr)
409  {
410  //iRef->Delete(); // really delete this?
411  _log(POS__ERROR, "StructureSE::Init MoonSE for %s(%u) is invalid.", m_self->name(), m_data.itemID);
412  return;
413  }
415  dir.normalize();
416  m_rotation = dir;
417  }
418 
419  // all POS have 1h duration
420  if (m_tower)
421  {
423  }
424  else if (m_module)
425  {
427  if (pSE == nullptr)
428  {
429  _log(POS__ERROR, "StructureSE::Init %s(%u) is invalid. why are we here?", m_self->name(), m_data.itemID);
430  return;
431  }
432  m_towerSE = pSE->GetTowerSE();
433  m_towerSE->AddModule(this);
434  m_duration = 3600000; // modules default to 1h
435  }
436 
440  if (m_data.timestamp > 0)
441  {
442  // do something constructive here.
443  }
444 
447 }
bool m_loaded
Definition: Structure.h:236
bool m_tower
Definition: Structure.h:231
SystemEntity * GetSE(uint32 entityID) const
#define _log(type, fmt,...)
Definition: logsys.h:124
SBUSE * m_sbuSE
Definition: Structure.h:207
virtual MoonSE * GetMoonSE()
Definition: SystemEntity.h:102
bool SetFlag(EVEItemFlags flag, bool notify=false)
const GPoint & position() const
IHubSE * m_ihubSE
Definition: Structure.h:208
StargateSE * m_gateSE
Definition: Structure.h:210
bool m_ihub
Definition: Structure.h:230
bool m_reactor
Definition: Structure.h:238
const char * name()
uint32 m_duration
Definition: Structure.h:224
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
bool m_jammer
Definition: Structure.h:234
uint16 groupID() const
GaExpInl GaFloat normalize()
Definition: GaTypes.h:163
bool m_generator
Definition: Structure.h:235
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
bool m_tcu
Definition: Structure.h:228
InventoryItemRef m_self
Definition: SystemEntity.h:269
void SaveBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:122
void RemoveEntity(SystemEntity *pSE)
uint32 get_uint32()
Definition: EvilNumber.cpp:173
SystemManager * m_system
Definition: SystemEntity.h:263
JumpBridgeSE * m_bridgeSE
Definition: Structure.h:209
TowerSE * m_towerSE
Definition: Structure.h:205
virtual void InitData()
Definition: Structure.cpp:240
virtual SBUSE * GetSBUSE()
Definition: SystemEntity.h:130
EVEPOS::StructureData m_data
Definition: Structure.h:212
virtual JumpBridgeSE * GetJumpBridgeSE()
Definition: SystemEntity.h:118
GVector m_rotation
Definition: Structure.h:220
virtual TowerSE * GetTowerSE()
Definition: SystemEntity.h:120
TCUSE * m_tcuSE
Definition: Structure.h:206
bool m_miner
Definition: Structure.h:232
EvilNumber GetAttribute(const uint16 attrID) const
#define IsStaticMapItem(itemID)
Definition: EVE_Defines.h:270
MoonSE * m_moonSE
Definition: Structure.h:203
bool m_sbu
Definition: Structure.h:229
bool GetBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:97
void AddModule(StructureSE *pSE)
Definition: Tower.h:92
void traceStack(void)
Definition: misc.cpp:169
virtual StargateSE * GetGateSE()
Definition: SystemEntity.h:103
Definition: gpoint.h:70
PosMgrDB m_db
Definition: Structure.h:201
virtual TCUSE * GetTCUSE()
Definition: SystemEntity.h:129
bool m_module
Definition: Structure.h:237
virtual IHubSE * GetIHubSE()
Definition: SystemEntity.h:131
bool m_bridge
Definition: Structure.h:233
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::InitData ( )
virtual

Reimplemented in ReactorSE, and TowerSE.

Definition at line 240 of file Structure.cpp.

References EVEPOS::JumpBridgeData::allowAlliance, EVEPOS::JumpBridgeData::allowCorp, EVEPOS::JumpBridgeData::allyID, EVEPOS::StructureData::anchorpointID, EVEPOS::JumpBridgeData::corpID, SystemManager::GetClosestGateSE(), SystemManager::GetClosestMoonSE(), SystemEntity::GetGateSE(), SystemManager::GetID(), SystemEntity::GetID(), SystemEntity::GetMoonSE(), SystemEntity::GetPosition(), SystemBubble::GetTowerSE(), SystemBubble::HasTower(), EVEPOS::StructureData::itemID, EVEPOS::JumpBridgeData::itemID, SystemEntity::m_allyID, m_bridge, SystemEntity::m_bubble, SystemEntity::m_corpID, m_data, m_db, m_gateSE, m_module, m_moonSE, m_sbu, SystemEntity::m_system, PosMgrDB::SaveBridgeData(), EVEPOS::JumpBridgeData::systemID, EVEPOS::StructureData::towerID, and EVEPOS::JumpBridgeData::towerID.

Referenced by Init(), and TowerSE::InitData().

241 {
242  // this item is a module. get towerID from bubble and save
243  if (m_module)
244  if (m_bubble->HasTower())
246 
247  if (m_bridge)
248  {
251 
253  data.itemID = m_data.itemID;
254  data.towerID = m_data.towerID;
255  data.corpID = m_corpID;
256  data.allyID = m_allyID;
257  data.systemID = m_system->GetID();
258  data.allowCorp = false;
259  data.allowAlliance = false;
260  m_db.SaveBridgeData(data);
261  }
262 
263  if (m_sbu)
264  { //SBUs are placed near stargates
267  }
268  else
269  { //Everything else is places near a moon
272  }
273 }
virtual MoonSE * GetMoonSE()
Definition: SystemEntity.h:102
SystemEntity * GetClosestGateSE(const GPoint &myPos)
SystemBubble * m_bubble
Definition: SystemEntity.h:262
StargateSE * m_gateSE
Definition: Structure.h:210
uint32 GetID() const
Definition: SystemManager.h:80
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
TowerSE * GetTowerSE()
Definition: SystemBubble.h:142
uint32 m_corpID
Definition: SystemEntity.h:281
void SaveBridgeData(EVEPOS::JumpBridgeData &data)
Definition: PosMgrDB.cpp:222
SystemManager * m_system
Definition: SystemEntity.h:263
uint32 GetID()
Definition: SystemEntity.h:207
EVEPOS::StructureData m_data
Definition: Structure.h:212
SystemEntity * GetClosestMoonSE(const GPoint &myPos)
bool HasTower()
Definition: SystemBubble.h:141
MoonSE * m_moonSE
Definition: Structure.h:203
bool m_sbu
Definition: Structure.h:229
virtual StargateSE * GetGateSE()
Definition: SystemEntity.h:103
PosMgrDB m_db
Definition: Structure.h:201
bool m_module
Definition: Structure.h:237
bool m_bridge
Definition: Structure.h:233

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool StructureSE::IsArraySE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in ArraySE.

Definition at line 129 of file Structure.h.

129 { return false; }
virtual bool StructureSE::IsBatterySE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in BatterySE.

Definition at line 130 of file Structure.h.

130 { return false; }
virtual bool StructureSE::IsCynoGeneratorSE ( )
inlinevirtual

Definition at line 124 of file Structure.h.

References m_generator.

124 { return m_generator; }
bool m_generator
Definition: Structure.h:235
virtual bool StructureSE::IsIHubSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in IHubSE.

Definition at line 122 of file Structure.h.

122 { return false; }
virtual bool StructureSE::IsJammerSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 123 of file Structure.h.

References m_jammer.

123 { return m_jammer; }
bool m_jammer
Definition: Structure.h:234
virtual bool StructureSE::IsJumpBridgeSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in JumpBridgeSE.

Definition at line 127 of file Structure.h.

127 { return false; }
virtual bool StructureSE::IsMoonMiner ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 125 of file Structure.h.

References m_miner.

125 { return m_miner; }
bool m_miner
Definition: Structure.h:232
virtual bool StructureSE::IsOutpostSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 126 of file Structure.h.

References m_outpost.

126 { return m_outpost; }
bool m_outpost
Definition: Structure.h:239
virtual bool StructureSE::IsPOSSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 119 of file Structure.h.

119 { return true; }
virtual bool StructureSE::IsReactorSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in ReactorSE.

Definition at line 132 of file Structure.h.

132 { return false; }
bool StructureSE::IsReinforced ( )
inline
virtual bool StructureSE::IsSBUSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in SBUSE.

Definition at line 121 of file Structure.h.

121 { return false; }
virtual bool StructureSE::IsTCUSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in TCUSE.

Definition at line 120 of file Structure.h.

120 { return false; }
virtual bool StructureSE::IsTowerSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in TowerSE.

Definition at line 128 of file Structure.h.

128 { return false; }
virtual bool StructureSE::IsWeaponSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in WeaponSE.

Definition at line 131 of file Structure.h.

131 { return false; }
void StructureSE::Killed ( Damage fatal_blow)
virtual
Todo:
check for tower/tcu/sbu/jammer and make killmail
Todo:
send pos mail/notification to corp members

Reimplemented from SystemEntity.

Definition at line 1208 of file Structure.cpp.

References _log, MapDB::AddFactionKill(), MapDB::AddKill(), DBSystemDynamicEntity::allianceID, AttrArmorHP, AttrHP, AttrShieldCapacity, SystemEntity::AwardSecurityStatus(), EVEDB::invCategories::Blueprint, SystemManager::BuildDynamicEntity(), DBSystemDynamicEntity::categoryID, EVEDB::invCategories::Celestial, DBSystemDynamicEntity::corporationID, SystemEntity::DropLoot(), DBSystemDynamicEntity::factionID, CharKillData::finalAllianceID, CharKillData::finalCharacterID, CharKillData::finalCorporationID, CharKillData::finalDamageDone, CharKillData::finalFactionID, CharKillData::finalSecurityStatus, CharKillData::finalShipTypeID, CharKillData::finalWeaponTypeID, flagNone, RefPtr< X >::get(), EvilNumber::get_uint32(), SystemEntity::GetAllianceID(), InventoryItem::GetAttribute(), Client::GetChar(), Client::GetCharacterID(), SystemEntity::GetCorporationID(), GetFileTimeNow(), SystemManager::GetID(), SystemEntity::GetID(), Inventory::GetInventoryMap(), SystemEntity::GetLocationID(), InventoryItem::GetMyInventory(), SystemEntity::GetName(), SystemEntity::GetPilot(), DestinyManager::GetPosition(), SystemEntity::GetSelf(), SystemManager::GetSystemSecurityRating(), Damage::GetTotal(), SystemEntity::GetTypeID(), SystemEntity::GetWarFactionID(), InventoryItem::groupID(), DBSystemDynamicEntity::groupID, SystemEntity::HasPilot(), is_log_enabled, SystemEntity::IsDroneSE(), IsEven(), Ga::GaVec3::isNaN(), IsWreckTypeID, InventoryItem::itemID(), DBSystemDynamicEntity::itemID, InventoryItem::itemName(), DBSystemDynamicEntity::itemName, itoa(), CharKillData::killBlob, CharKillData::killTime, SystemEntity::m_allyID, SystemEntity::m_bubble, SystemEntity::m_corpID, SystemEntity::m_destiny, m_moonSE, SystemEntity::m_self, SystemEntity::m_system, m_tower, SystemEntity::m_warID, MakeRandomInt(), CharKillData::moonID, InventoryItem::name(), InventoryItem::ownerID(), DBSystemDynamicEntity::ownerID, DBSystemDynamicEntity::position, ServiceDB::SaveKillOrLoss(), sDataMgr, DestinyManager::SendJettisonPacket(), sEntityList, SystemBubble::SetTowerSE(), sItemFactory, sLog, CharKillData::solarSystemID, Damage::srcSE, RefPtr< X >::StaticCast(), InventoryItem::typeID(), DBSystemDynamicEntity::typeID, CharKillData::victimAllianceID, CharKillData::victimCharacterID, CharKillData::victimCorporationID, CharKillData::victimDamageTaken, CharKillData::victimFactionID, CharKillData::victimShipTypeID, Damage::weaponRef, EVEDB::invGroups::Wreck, Ga::GaVec3::x, SystemEntity::x(), Ga::GaVec3::y, SystemEntity::y(), Ga::GaVec3::z, and SystemEntity::z().

1209 {
1210  if ((m_bubble == nullptr) or (m_destiny == nullptr) or (m_system == nullptr))
1211  return; // make error here?
1212 
1213  if (m_tower)
1214  m_bubble->SetTowerSE(nullptr);
1215 
1216  uint32 killerID = 0;
1217  Client *pClient(nullptr);
1218  SystemEntity *killer = fatal_blow.srcSE;
1219 
1220  if (killer->HasPilot())
1221  {
1222  pClient = killer->GetPilot();
1223  killerID = pClient->GetCharacterID();
1224  }
1225  else if (killer->IsDroneSE())
1226  {
1227  pClient = sEntityList.FindClientByCharID(killer->GetSelf()->ownerID());
1228  if (pClient == nullptr)
1229  {
1230  sLog.Error("StructureSE::Killed()", "killer == IsDrone and pPlayer == nullptr");
1231  }
1232  else
1233  {
1234  killerID = pClient->GetCharacterID();
1235  }
1236  }
1237  else
1238  {
1239  killerID = killer->GetID();
1240  }
1241 
1242  std::stringstream blob;
1243  blob << "<items>";
1244  std::vector<InventoryItemRef> survivedItems;
1245  std::map<uint32, InventoryItemRef> deadShipInventory;
1246  deadShipInventory.clear();
1247  m_self->GetMyInventory()->GetInventoryMap(deadShipInventory);
1248  if (!deadShipInventory.empty())
1249  {
1250  uint32 s = 0, d = 0, x = 0;
1251  for (auto cur : deadShipInventory)
1252  {
1253  d = 0;
1254  x = cur.second->quantity();
1255  s = (cur.second->isSingleton() ? 1 : 0);
1256  if (cur.second->categoryID() == EVEDB::invCategories::Blueprint)
1257  {
1258  // singleton for bpo = 1, bpc = 2.
1259  BlueprintRef bpRef = BlueprintRef::StaticCast(cur.second);
1260  s = (bpRef->copy() ? 2 : s);
1261  }
1262  blob << "<i t=" << cur.second->typeID() << " f=" << cur.second->flag() << " s=" << s;
1263  // all items have 50% chance of drop, even from popped ship
1264  if (IsEven(MakeRandomInt(0, 100)))
1265  {
1266  // item survived. check qty for drop
1267  if (x > 1)
1268  {
1269  d = MakeRandomInt(0, x);
1270  x -= d;
1271  }
1272  // move item to vector for insertion into wreck later on
1273  survivedItems.push_back(cur.second);
1274  }
1275  blob << " d=" << d << " x=" << x << "/>";
1276  }
1277  }
1278  blob << "</items>";
1279 
1280  /* populate kill data for killMail and save to db -allan 01May16 --updated 13July17 */
1283  CharKillData data = CharKillData();
1284  data.solarSystemID = m_system->GetID();
1285  data.victimCharacterID = 0; // charID = 0 means strucuture/item
1287  data.victimAllianceID = m_allyID;
1288  data.victimFactionID = m_warID;
1289  data.victimShipTypeID = GetTypeID();
1290 
1291  data.finalCharacterID = killerID;
1292  data.finalCorporationID = killer->GetCorporationID();
1293  data.finalAllianceID = killer->GetAllianceID();
1294  data.finalFactionID = killer->GetWarFactionID();
1295  data.finalShipTypeID = killer->GetTypeID();
1296  data.finalWeaponTypeID = fatal_blow.weaponRef->typeID();
1297  data.finalSecurityStatus = 0; /* fix this */
1298  data.finalDamageDone = fatal_blow.GetTotal();
1299 
1300  uint32 totalHP = m_self->GetAttribute(AttrHP).get_uint32();
1301  totalHP += m_self->GetAttribute(AttrArmorHP).get_uint32();
1303  data.victimDamageTaken = totalHP;
1304 
1305  data.killBlob = blob.str().c_str();
1306  data.killTime = GetFileTimeNow();
1307  data.moonID = m_moonSE->GetID(); /* denotes moonID for POS/Structure kills */
1308 
1310 
1311  uint32 locationID = GetLocationID();
1312  // log faction kill in dynamic data -allan
1313  MapDB::AddKill(locationID);
1314  MapDB::AddFactionKill(locationID);
1315 
1316  if (pClient != nullptr)
1317  {
1318  //award kill bounty.
1319  //AwardBounty( pClient );
1320  if (m_system->GetSystemSecurityRating() > 0)
1321  AwardSecurityStatus(m_self, pClient->GetChar().get()); // this awards secStatusChange for npcs in empire space
1322  }
1323 
1324  GPoint wreckPosition = m_destiny->GetPosition();
1325  if (wreckPosition.isNaN())
1326  {
1327  sLog.Error("StructureSE::Killed()", "Wreck Position is NaN");
1328  return;
1329  }
1330  uint32 wreckTypeID = sDataMgr.GetWreckID(m_self->typeID());
1331  if (!IsWreckTypeID(wreckTypeID))
1332  {
1333  sLog.Error("StructureSE::Killed()", "Could not get wreckType for %s of type %u", m_self->name(), m_self->typeID());
1334  // default to generic frigate wreck till i get better checks and/or complete wreck data
1335  wreckTypeID = 26557;
1336  }
1337 
1338  std::string wreck_name = m_self->itemName();
1339  wreck_name += " Wreck";
1340  ItemData wreckItemData(wreckTypeID, killerID, locationID, flagNone, wreck_name.c_str(), wreckPosition, itoa(m_allyID));
1341  WreckContainerRef wreckItemRef = sItemFactory.SpawnWreckContainer(wreckItemData);
1342  if (wreckItemRef.get() == nullptr)
1343  {
1344  sLog.Error("StructureSE::Killed()", "Creating Wreck Item Failed for %s of type %u", wreck_name.c_str(), wreckTypeID);
1345  return;
1346  }
1347 
1348  if (is_log_enabled(PHYSICS__TRACE))
1349  _log(PHYSICS__TRACE, "StructureSE::Killed() - Structure %s(%u) Position: %.2f,%.2f,%.2f. Wreck %s(%u) Position: %.2f,%.2f,%.2f.",
1350  GetName(), GetID(), x(), y(), z(), wreckItemRef->name(), wreckItemRef->itemID(), wreckPosition.x, wreckPosition.y, wreckPosition.z);
1351 
1353  wreckEntity.allianceID = killer->GetAllianceID();
1355  wreckEntity.corporationID = killer->GetCorporationID();
1356  wreckEntity.factionID = m_warID;
1357  wreckEntity.groupID = EVEDB::invGroups::Wreck;
1358  wreckEntity.itemID = wreckItemRef->itemID();
1359  wreckEntity.itemName = wreck_name;
1360  wreckEntity.ownerID = killerID;
1361  wreckEntity.typeID = wreckTypeID;
1362  wreckEntity.position = wreckPosition;
1363 
1364  if (!m_system->BuildDynamicEntity(wreckEntity, m_self->itemID()))
1365  {
1366  sLog.Error("StructureSE::Killed()", "Spawning Wreck Failed: typeID or typeName not supported: '%u'", wreckTypeID);
1367  wreckItemRef->Delete();
1368  return;
1369  }
1371 
1372  DropLoot(wreckItemRef, m_self->groupID(), killerID);
1373 
1374  for (auto cur : survivedItems)
1375  cur->Move(wreckItemRef->itemID(), flagNone); // populate wreck with items that survived
1376 }
bool m_tower
Definition: Structure.h:231
uint32 finalDamageDone
uint32 finalCorporationID
uint32 victimDamageTaken
#define _log(type, fmt,...)
Definition: logsys.h:124
#define IsWreckTypeID(typeID)
Definition: EVE_Defines.h:203
DestinyManager * m_destiny
Definition: SystemEntity.h:265
uint32 finalCharacterID
uint32 ownerID() const
Definition: InventoryItem.h:99
void SendJettisonPacket() const
double y()
Definition: SystemEntity.h:214
virtual bool HasPilot()
Definition: SystemEntity.h:258
GaExpInl bool isNaN() const
Definition: GaTypes.h:194
static void AddKill(uint32 sysID)
Definition: MapDB.cpp:250
virtual Client * GetPilot()
Definition: SystemEntity.h:259
SystemBubble * m_bubble
Definition: SystemEntity.h:262
int32 GetCharacterID() const
Definition: Client.h:113
static void AddFactionKill(uint32 sysID)
Definition: MapDB.cpp:256
SystemEntity * srcSE
Definition: Damage.h:84
#define sEntityList
Definition: EntityList.h:208
const float GetSystemSecurityRating()
Definition: SystemManager.h:86
uint32 GetID() const
Definition: SystemManager.h:80
static void SaveKillOrLoss(CharKillData &data)
Definition: ServiceDB.cpp:212
int32 victimFactionID
const char * name()
GaFloat x
Definition: GaTypes.h:207
bool BuildDynamicEntity(const DBSystemDynamicEntity &entity, uint32 launcherID=0)
uint16 groupID() const
#define is_log_enabled(type)
Definition: logsys.h:78
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Definition: gpoint.h:33
InventoryItemRef m_self
Definition: SystemEntity.h:269
bool IsEven(int64 number)
Definition: misc.h:88
InventoryItemRef GetSelf()
Definition: SystemEntity.h:202
uint32 m_corpID
Definition: SystemEntity.h:281
uint32 GetLocationID()
Definition: SystemEntity.h:209
uint32 solarSystemID
uint32 get_uint32()
Definition: EvilNumber.cpp:173
uint32 victimCorporationID
SystemManager * m_system
Definition: SystemEntity.h:263
uint16 finalShipTypeID
double z()
Definition: SystemEntity.h:215
int32 GetAllianceID()
Definition: SystemEntity.h:216
uint32 GetID()
Definition: SystemEntity.h:207
uint32 victimCharacterID
int32 finalFactionID
const char * GetName() const
Definition: SystemEntity.h:210
double x()
Definition: SystemEntity.h:213
Definition: Client.h:66
double finalSecurityStatus
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
Definition: RefPtr.h:238
unsigned __int32 uint32
Definition: eve-compat.h:50
void GetInventoryMap(std::map< uint32, InventoryItemRef > &invMap)
Definition: Inventory.cpp:453
GaFloat y
Definition: GaTypes.h:207
double GetFileTimeNow()
Definition: utils_time.cpp:84
int64 MakeRandomInt(int64 low, int64 high)
Generates random integer from interval [low; high].
Definition: misc.cpp:109
uint32 GetCorporationID()
Definition: SystemEntity.h:218
const std::string & itemName() const
float GetTotal() const
Definition: Damage.h:48
void SetTowerSE(TowerSE *pTower)
Definition: SystemBubble.h:143
void DropLoot(WreckContainerRef wreckRef, uint32 groupID, uint32 owner)
EvilNumber GetAttribute(const uint16 attrID) const
uint16 finalWeaponTypeID
uint16 victimShipTypeID
MoonSE * m_moonSE
Definition: Structure.h:203
void AwardSecurityStatus(InventoryItemRef iRef, Character *pChar)
const GPoint & GetPosition() const
#define sItemFactory
Definition: ItemFactory.h:165
uint16 GetTypeID()
Definition: SystemEntity.h:203
int32 finalAllianceID
Inventory * GetMyInventory()
Definition: InventoryItem.h:91
InventoryItemRef weaponRef
Definition: Damage.h:86
int32 victimAllianceID
std::string killBlob
virtual bool IsDroneSE()
Definition: SystemEntity.h:187
uint16 typeID() const
GaFloat z
Definition: GaTypes.h:207
const char * itoa(int64 num)
Convers num to string.
uint32 itemID() const
Definition: InventoryItem.h:98
int32 GetWarFactionID()
Definition: SystemEntity.h:217
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr

Here is the call graph for this function:

PyDict * StructureSE::MakeSlimItem ( )
virtual
Todo:
(Allan) *Timestamp will need to be set to time current state is started.

Reimplemented from DynamicSystemEntity.

Reimplemented in TowerSE.

Definition at line 1112 of file Structure.cpp.

References _log, PyRep::Dump(), SystemEntity::GetName(), EVEPOS::StructureState::Incapacitated, is_log_enabled, IsAlliance, IsCorp, IsFaction, EVEPOS::StructureData::itemID, InventoryItem::itemName(), SystemEntity::m_allyID, SystemEntity::m_corpID, m_data, m_delayTime, m_miner, m_module, m_outpost, SystemEntity::m_ownerID, m_rotation, SystemEntity::m_self, m_tcu, m_tower, SystemEntity::m_warID, PyStatic, PyTuple::SetItem(), PyDict::SetItemString(), EVEPOS::StructureData::state, EVEPOS::StructureData::timestamp, EVEPOS::StructureData::towerID, InventoryItem::typeID(), Ga::GaVec3::x, Ga::GaVec3::y, and Ga::GaVec3::z.

1113 {
1114  _log(SE__SLIMITEM, "MakeSlimItem for StructureSE %u", m_data.itemID);
1115  _log(POS__SLIMITEM, "MakeSlimItem for StructureSE %u", m_data.itemID);
1117  PyDict *slim = new PyDict();
1118  slim->SetItemString("name", new PyString(m_self->itemName()));
1119  slim->SetItemString("itemID", new PyLong(m_data.itemID));
1120  slim->SetItemString("typeID", new PyInt(m_self->typeID()));
1121  slim->SetItemString("posState", new PyInt(m_data.state));
1122 
1123  slim->SetItemString("ownerID", new PyInt(m_ownerID));
1124  slim->SetItemString("corpID", IsCorp(m_corpID) ? new PyInt(m_corpID) : PyStatic.NewNone());
1125  slim->SetItemString("allianceID", IsAlliance(m_allyID) ? new PyInt(m_allyID) : PyStatic.NewNone());
1126  slim->SetItemString("warFactionID", IsFaction(m_warID) ? new PyInt(m_warID) : PyStatic.NewNone());
1127 
1128  if (m_module or m_tower)
1129  { // for control towers and structures
1130  slim->SetItemString("posTimestamp", new PyLong(m_data.timestamp));
1131  slim->SetItemString("incapacitated", new PyInt(m_data.state == EVEPOS::StructureState::Incapacitated));
1132  slim->SetItemString("posDelayTime", new PyInt(m_delayTime));
1133  }
1134  if (m_outpost)
1135  {
1136  slim->SetItemString("startTimestamp", new PyLong(m_data.timestamp));
1137  slim->SetItemString("structureState", new PyInt(m_data.state));
1138  slim->SetItemString("posDelayTime", new PyInt(m_delayTime));
1139  }
1140  else if (m_tcu)
1141  {
1142  slim->SetItemString("posDelayTime", new PyInt(m_delayTime));
1143  slim->SetItemString("posTimestamp", PyStatic.NewNone());
1144  }
1145  else if (m_miner)
1146  {
1147  PyTuple *tuple = new PyTuple(3);
1148  tuple->SetItem(0, new PyFloat(m_rotation.x));
1149  tuple->SetItem(1, new PyFloat(m_rotation.y));
1150  tuple->SetItem(2, new PyFloat(m_rotation.z));
1151  slim->SetItemString("dunRotation", tuple); // direction to moon
1152  slim->SetItemString("controlTowerID", new PyLong(m_data.towerID));
1153  }
1154 
1155  if (m_module)
1156  slim->SetItemString("controlTowerID", new PyLong(m_data.towerID));
1157 
1158  if (is_log_enabled(POS__SLIMITEM))
1159  {
1160  _log(POS__SLIMITEM, "StructureSE::MakeSlimItem() - %s(%u)", GetName(), m_data.itemID);
1161  slim->Dump(POS__SLIMITEM, " ");
1162  }
1163  return slim;
1164 }
bool m_tower
Definition: Structure.h:231
bool m_outpost
Definition: Structure.h:239
#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
uint32 m_delayTime
Definition: Structure.h:217
Python floating point number.
Definition: PyRep.h:292
Python tuple.
Definition: PyRep.h:567
GaFloat x
Definition: GaTypes.h:207
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
bool m_tcu
Definition: Structure.h:228
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
#define PyStatic
Definition: PyRep.h:1209
const char * GetName() const
Definition: SystemEntity.h:210
EVEPOS::StructureData m_data
Definition: Structure.h:212
#define IsCorp(itemID)
Definition: EVE_Defines.h:234
GVector m_rotation
Definition: Structure.h:220
GaFloat y
Definition: GaTypes.h:207
const std::string & itemName() const
bool m_miner
Definition: Structure.h:232
#define IsFaction(itemID)
Definition: EVE_Defines.h:250
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244
bool m_module
Definition: Structure.h:237
uint16 typeID() const
GaFloat z
Definition: GaTypes.h:207
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

virtual void StructureSE::MissileLaunched ( Missile pMissile)
inlinevirtual

Reimplemented from SystemEntity.

Reimplemented in TowerSE.

Definition at line 146 of file Structure.h.

146 { /* Do nothing here */ }
void StructureSE::Offline ( )

Definition at line 1381 of file Structure.cpp.

1382 {
1383 }
void StructureSE::Online ( )
virtual

Reimplemented in TowerSE.

Definition at line 918 of file Structure.cpp.

References m_duration, m_tower, and SetTimer().

Referenced by TowerSE::Online(), and Process().

919 {
920  // structure online, but not operating
921  // take resources or whatever needs to be done
922 
923  if (!m_tower)
924  {
925  // do module shit here....tower online methods handled in tower class
926  }
927 
929 }
bool m_tower
Definition: Structure.h:231
void SetTimer(uint32 time)
Definition: Structure.h:178
uint32 m_duration
Definition: Structure.h:224

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::Operating ( )
virtual

Reimplemented in TowerSE.

Definition at line 945 of file Structure.cpp.

References m_duration, m_tower, and SetTimer().

Referenced by TowerSE::Operating(), and Process().

946 {
947  // structure operating
948  // take resources, move items, process reactions or whatever needs to be done (follow PI proc code)
949 
950  if (!m_tower)
951  {
952  // do module shit here....tower operating methods handled in tower class
953  }
954 
956 }
bool m_tower
Definition: Structure.h:231
void SetTimer(uint32 time)
Definition: Structure.h:178
uint32 m_duration
Definition: Structure.h:224

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::Process ( )
virtual

Reimplemented from SystemEntity.

Reimplemented in ReactorSE, ModuleSE, TowerSE, ArraySE, BatterySE, JumpBridgeSE, TCUSE, WeaponSE, IHubSE, and SBUSE.

Definition at line 458 of file Structure.cpp.

References _log, EVEPOS::StructureState::Anchored, EVEPOS::ProcState::Anchoring, EVEPOS::ProcState::ArmorReinforcing, Timer::Check(), Timer::Disable(), flagStructureInactive, SystemEntity::GetName(), GetTimeMSeconds(), Calendar::Flag::Invalid, EVEPOS::StructureState::Invulnerable, EVEPOS::StructureData::itemID, m_data, m_db, m_delayTime, SystemEntity::m_destiny, m_gateSE, m_moonSE, m_procState, m_procTimer, m_sbu, SystemEntity::m_self, m_tower, EVEPOS::ProcState::Offlining, Online, Online(), EVEPOS::ProcState::Onlining, EVEPOS::ProcState::Operating, Operating(), SystemEntity::Process(), EVEPOS::ProcState::Reinforcing, sDataMgr, SendSlimUpdate(), DestinyManager::SendSpecialEffect(), InventoryItem::SetFlag(), SetOffline(), SetOnline(), StargateSE::SetSBU(), MoonSE::SetTower(), EVEPOS::ProcState::SheildReinforcing, EVEPOS::StructureData::state, EVEPOS::StructureData::timestamp, InventoryItem::typeID(), EVEPOS::ProcState::Unanchoring, and PosMgrDB::UpdateBaseData().

Referenced by IHubSE::Process(), SBUSE::Process(), BatterySE::Process(), TCUSE::Process(), ArraySE::Process(), WeaponSE::Process(), JumpBridgeSE::Process(), TowerSE::Process(), ModuleSE::Process(), and ReactorSE::Process().

459 {
460  /* called by EntityList::Process on every loop */
461  /* Enable base call to Process Targeting and Movement */
463 
464  if (m_procTimer.Check(false))
465  {
467  m_delayTime = 0;
468 
469  _log(POS__DEBUG, "Module %s(%u) Processing State '%s'", GetName(), m_data.itemID, sDataMgr.GetProcStateName(m_procState));
470 
471  using namespace EVEPOS;
472  switch (m_procState)
473  {
475  {
476  SendSlimUpdate();
477  m_destiny->SendSpecialEffect(m_data.itemID, m_data.itemID, m_self->typeID(), 0, 0, "effects.AnchorLift", 0, 0, 0, -1, 0);
479  }
480  break;
482  {
483  SendSlimUpdate();
484  m_destiny->SendSpecialEffect(m_data.itemID, m_data.itemID, m_self->typeID(), 0, 0, "effects.AnchorDrop", 0, 0, 0, -1, 0);
485  if (m_tower)
486  m_moonSE->SetTower(this);
487  if (m_sbu)
488  m_gateSE->SetSBU(this);
489 
491  }
492  break;
494  {
496  SetOffline();
497  SendSlimUpdate();
499  }
500  break;
501  case ProcState::Onlining:
502  {
504  SetOnline();
505  SendSlimUpdate();
507  }
508  break;
509  case ProcState::Online:
510  {
511  Online();
512  }
513  break;
515  {
516  // this is virtual, overridden in specific class' for their needs
517  // take resources or whatever needs to be done
518  Operating();
519  }
520  break;
521  // those below are not coded yet
525  {
528  //m_data.state = StructureState::Reinforced;
530  // set timer for time to come out of reinforced
531  /*Reinforcement is an established system in EVE where a structure becomes invulnerable for a period of time.
532  * The purpose is for the defending corporation to have a chance to react when their structure is attacked.
533  * The Control Tower enters reinforced mode when it reaches 25% shield and exits reinforcement somewhere
534  * within the time of day, specified by the owner at least 24 hours after it entered reinforcement.
535  * So if you set the reinforcement time to “23.00 – 01.00” that means that the Control Tower will, if attacked,
536  * exit reinforcement at some time between 23.00 and 01.00 the day after the attack was initiated.
537  * Your corporation will receive notification if your Control Tower enters reinforcement mode and that leaves you
538  * at least 24 hours to plan the defense.
539  * In order to reset the reinforcement cycle, the Control Tower Shield must be repaired back above 25%;
540  * note that it exits reinforcement with 0% shield.
541  *
542  */
543  }
544  break;
545  default:
546  case ProcState::Invalid:
547  {
548  // not sure what needs to be done at this point....we're nowhere close to having this coded.
549  }
550  break;
551  }
552 
553  // this will need more work
555 
558  }
559 }
bool m_tower
Definition: Structure.h:231
virtual void Process()
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
DestinyManager * m_destiny
Definition: SystemEntity.h:265
bool SetFlag(EVEItemFlags flag, bool notify=false)
void UpdateBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:132
uint32 m_delayTime
Definition: Structure.h:217
StargateSE * m_gateSE
Definition: Structure.h:210
virtual void SetOnline()
Definition: Structure.cpp:869
Timer m_procTimer
Definition: Structure.h:226
int8 m_procState
Definition: Structure.h:214
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
InventoryItemRef m_self
Definition: SystemEntity.h:269
double GetTimeMSeconds()
Definition: utils_time.cpp:104
bool Check(bool reset=true)
Definition: timer.cpp:62
const char * GetName() const
Definition: SystemEntity.h:210
EVEPOS::StructureData m_data
Definition: Structure.h:212
virtual void Online()
Definition: Structure.cpp:918
virtual void SetOffline()
Definition: Structure.cpp:888
void SetSBU(StructureSE *pSE)
Definition: SystemEntity.h:361
void SendSlimUpdate()
Definition: Structure.cpp:966
MoonSE * m_moonSE
Definition: Structure.h:203
virtual void Operating()
Definition: Structure.cpp:945
void SetTower(StructureSE *pSE)
Definition: Moon.h:47
bool m_sbu
Definition: Structure.h:229
PosMgrDB m_db
Definition: Structure.h:201
uint16 typeID() const
Definition: EVE_POS.h:14
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::PullAnchor ( )
Todo:
check for other modules changing state...only allow one at a time
Todo:
make sure there are NO modules within the SOI of tower if Unanchoring tower.

Definition at line 734 of file Structure.cpp.

References EVEPOS::StructureState::Anchored, AttrUnanchoringDelay, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), GetFileTimeNow(), EVEPOS::StructureData::itemID, SystemEntity::m_bubble, m_data, m_delayTime, SystemEntity::m_destiny, m_procState, m_procTimer, SystemEntity::m_self, m_tower, SendSlimUpdate(), DestinyManager::SendSpecialEffect(), Timer::SetTimer(), SystemBubble::SetTowerSE(), EVEPOS::StructureData::state, EVEPOS::StructureData::timestamp, InventoryItem::typeID(), EVEPOS::StructureState::Unanchored, and EVEPOS::ProcState::Unanchoring.

735 {
737  return; // make error here?
738 
742  //m_towerSE->GetSOI();
743 
749 
750  SendSlimUpdate();
751 
752  if (m_tower)
753  m_bubble->SetTowerSE(nullptr);
754 
755  /*
756  if (m_tower)
757  SendEffectUpdate(anchorLiftForStructures, true);
758  else if (m_co)
759  SendEffectUpdate(anchorLiftForOrbitals, true);
760  else
761  */
762  m_destiny->SendSpecialEffect(m_data.itemID, m_data.itemID, m_self->typeID(), 0, 0, "effects.AnchorLift", 0, 1, 1, -1, 0);
763 }
bool m_tower
Definition: Structure.h:231
DestinyManager * m_destiny
Definition: SystemEntity.h:265
void SetTimer(uint32 setTimerTime=0)
Definition: timer.cpp:102
uint32 m_delayTime
Definition: Structure.h:217
SystemBubble * m_bubble
Definition: SystemEntity.h:262
Timer m_procTimer
Definition: Structure.h:226
int8 m_procState
Definition: Structure.h:214
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 get_uint32()
Definition: EvilNumber.cpp:173
EVEPOS::StructureData m_data
Definition: Structure.h:212
double GetFileTimeNow()
Definition: utils_time.cpp:84
void SetTowerSE(TowerSE *pTower)
Definition: SystemBubble.h:143
void SendSlimUpdate()
Definition: Structure.cpp:966
EvilNumber GetAttribute(const uint16 attrID) const
uint16 typeID() const

Here is the call graph for this function:

virtual void StructureSE::Reinforced ( )
inlinevirtual

Reimplemented in TowerSE.

Definition at line 158 of file Structure.h.

158 { /* do nothing here yet */ }
void StructureSE::Scoop ( )
virtual

Reimplemented in TowerSE.

Definition at line 449 of file Structure.cpp.

References InventoryItem::ChangeSingleton(), PosMgrDB::DeleteData(), EVEPOS::StructureData::itemID, m_data, m_db, and SystemEntity::m_self.

Referenced by TowerSE::Scoop().

450 {
453 
454  // repackage item?
455  m_self->ChangeSingleton(false);
456 }
InventoryItemRef m_self
Definition: SystemEntity.h:269
EVEPOS::StructureData m_data
Definition: Structure.h:212
void DeleteData(uint32 itemID)
Definition: PosMgrDB.cpp:17
bool ChangeSingleton(bool singleton, bool notify=false)
PosMgrDB m_db
Definition: Structure.h:201

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::SendEffectUpdate ( int16  effectID,
bool  active 
)
protected

Definition at line 989 of file Structure.cpp.

References PyList::AddItem(), GetFileTimeNow(), EVEPOS::StructureData::itemID, m_data, SystemEntity::m_destiny, SystemEntity::m_ownerID, PyStatic, and DestinyManager::SendSingleDestinyEvent().

990 {
991  GodmaEnvironment ge;
992  ge.selfID = m_data.itemID;
993  ge.charID = m_ownerID;
994  ge.shipID = m_data.itemID;
995  ge.target = PyStatic.NewNone();
996  ge.subLoc = PyStatic.NewNone();
997  ge.area = new PyList();
998  ge.effectID = effectID;
999  Notify_OnGodmaShipEffect shipEff;
1000  shipEff.itemID = ge.selfID;
1001  shipEff.effectID = effectID;
1002  shipEff.timeNow = GetFileTimeNow();
1003  shipEff.start = (active ? 1 : 0);
1004  shipEff.active = (active ? 1 : 0);
1005  shipEff.environment = ge.Encode();
1006  shipEff.startTime = shipEff.timeNow; // do we need to adjust this?
1007  shipEff.duration = (active ? 0 : -1);
1008  shipEff.repeat = (active ? 1 : 0);
1009  shipEff.error = PyStatic.NewNone();
1010  PyList *events = new PyList();
1011  events->AddItem(shipEff.Encode());
1012  PyTuple *event = new PyTuple(1);
1013  event->SetItem(0, events);
1014  m_destiny->SendSingleDestinyEvent(&event); // consumed
1015 }
DestinyManager * m_destiny
Definition: SystemEntity.h:265
uint32 m_ownerID
Definition: SystemEntity.h:283
Python tuple.
Definition: PyRep.h:567
void AddItem(PyRep *i)
Definition: PyRep.h:701
#define PyStatic
Definition: PyRep.h:1209
EVEPOS::StructureData m_data
Definition: Structure.h:212
double GetFileTimeNow()
Definition: utils_time.cpp:84
void SendSingleDestinyEvent(PyTuple **ev, bool self_only=false) const
Python list.
Definition: PyRep.h:639

Here is the call graph for this function:

void StructureSE::SendSlimUpdate ( )

Definition at line 966 of file Structure.cpp.

References IsAlliance, IsCorp, IsFaction, EVEPOS::StructureData::itemID, InventoryItem::itemName(), SystemEntity::m_allyID, SystemEntity::m_corpID, m_data, m_delayTime, SystemEntity::m_destiny, SystemEntity::m_ownerID, SystemEntity::m_self, SystemEntity::m_warID, PyStatic, DestinyManager::SendSingleDestinyUpdate(), PyTuple::SetItem(), PyDict::SetItemString(), EVEPOS::StructureData::state, EVEPOS::StructureData::timestamp, and InventoryItem::typeID().

Referenced by Activate(), Deactivate(), Process(), PullAnchor(), StructureItem::Rename(), SetAnchor(), SetInvulnerable(), TowerSE::SetOnline(), SetOperating(), and SetVulnerable().

967 {
968  PyDict *slim = new PyDict();
969  slim->SetItemString("name", new PyString(m_self->itemName()));
970  slim->SetItemString("itemID", new PyLong(m_data.itemID));
971  slim->SetItemString("typeID", new PyInt(m_self->typeID()));
972  slim->SetItemString("ownerID", new PyInt(m_ownerID));
973  slim->SetItemString("corpID", IsCorp(m_corpID) ? new PyInt(m_corpID) : PyStatic.NewNone());
974  slim->SetItemString("allianceID", IsAlliance(m_allyID) ? new PyInt(m_allyID) : PyStatic.NewNone());
975  slim->SetItemString("warFactionID", IsFaction(m_warID) ? new PyInt(m_warID) : PyStatic.NewNone());
976  slim->SetItemString("posTimestamp", new PyLong(m_data.timestamp));
977  slim->SetItemString("posState", new PyInt(m_data.state));
978  slim->SetItemString("incapacitated", new PyInt(0));
979  slim->SetItemString("posDelayTime", new PyInt(m_delayTime));
980  PyTuple *shipData = new PyTuple(2);
981  shipData->SetItem(0, new PyLong(m_data.itemID));
982  shipData->SetItem(1, new PyObject("foo.SlimItem", slim));
983  PyTuple *sItem = new PyTuple(2);
984  sItem->SetItem(0, new PyString("OnSlimItemChange"));
985  sItem->SetItem(1, shipData);
986  m_destiny->SendSingleDestinyUpdate(&sItem); // consumed
987 }
Python string.
Definition: PyRep.h:430
DestinyManager * m_destiny
Definition: SystemEntity.h:265
Python's dictionary.
Definition: PyRep.h:719
uint32 m_ownerID
Definition: SystemEntity.h:283
uint32 m_delayTime
Definition: Structure.h:217
Python tuple.
Definition: PyRep.h:567
InventoryItemRef m_self
Definition: SystemEntity.h:269
Python object.
Definition: PyRep.h:826
uint32 m_corpID
Definition: SystemEntity.h:281
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
#define PyStatic
Definition: PyRep.h:1209
EVEPOS::StructureData m_data
Definition: Structure.h:212
void SendSingleDestinyUpdate(PyTuple **up, bool self_only=false) const
#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
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::SetAnchor ( Client pClient,
GPoint pos 
)
Todo:
check for other modules changing state...only allow one at a time

Definition at line 600 of file Structure.cpp.

References _log, EVEPOS::StructureState::Anchored, EVEPOS::ProcState::Anchoring, AttrAnchorDistanceMax, AttrAnchoringDelay, AttranchoringRequiresSovUpgrade1, AttrMoonAnchorDistance, SovereigntyData::beaconID, Inventory::ContainsTypeQty(), EvE::Trig::Deg2Rad(), Ga::GaVec3::distance(), EvilNumber::get_int(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), GetFileTimeNow(), Client::GetLocationID(), InventoryItem::GetMyInventory(), SystemEntity::GetName(), SystemEntity::GetPosition(), SystemEntity::GetRadius(), MoonSE::HasTower(), SovereigntyData::hubID, is_log_enabled, EVEPOS::StructureData::itemID, InventoryItem::itemID(), SovereigntyData::jammerID, m_bridge, m_data, m_delayTime, SystemEntity::m_destiny, m_gateSE, m_generator, m_ihub, m_jammer, m_moonSE, m_procState, m_procTimer, m_sbu, SystemEntity::m_self, m_tcu, m_tower, InventoryItem::name(), InventoryItem::position(), InventoryItem::radius(), InventoryItem::SaveItem(), sBubbleMgr, DestinyManager::SendDestinyUpdate(), Client::SendErrorMsg(), SendSlimUpdate(), DestinyManager::SendSpecialEffect(), DestinyManager::SetPosition(), Timer::SetTimer(), sItemFactory, EVEPOS::StructureData::state, svDataMgr, EVEPOS::StructureData::timestamp, InventoryItem::typeID(), EVEPOS::StructureState::Unanchored, Ga::GaVec3::x, Ga::GaVec3::y, and Ga::GaVec3::z.

601 {
603  {
604  pClient->SendErrorMsg("The %s is already anchored", m_self->name());
605  return; // make error here?
606  }
607 
608  /* returns SetBallPosition for towers.
609  * ct will anchor in the middle of the grid that you warp-in to....supposed to, but i dont know how yet.
610  */
611 
614  /* @todo set min/max anchor distances....this will need more work...
615  uint32 anchorMin(m_self->GetAttribute(AttrAnchorDistanceMin).get_uint32());
616  uint32 anchorMax(m_self->GetAttribute(AttrAnchorDistanceMax).get_uint32());
617  */
618 
619  // this is incomplete. there may be client error msgs (havent looked or found)
620  // these errors should throw instead of return.
621 
622  // Check for required sovereignty upgrades for certain structures
623  if ((m_generator) || (m_jammer) || (m_bridge)) {
624  SovereigntyData sovData = svDataMgr.GetSovereigntyData(pClient->GetLocationID());
625  InventoryItemRef ihubRef = sItemFactory.GetItem(sovData.hubID);
627 
628  if (!ihubRef->GetMyInventory()->ContainsTypeQty(upgType,1)) {
629  pClient->SendErrorMsg("This module requires %s to be installed in the Infrastructure Hub.",
630  sItemFactory.GetType(upgType)->name().c_str());
631  return;
632  }
633 
634  if ((m_generator) && (sovData.jammerID != 0)) {
635  pClient->SendErrorMsg("This module cannot be anchored as the system is currently being jammed.");
636  return;
637  }
638 
639  if ((m_jammer) && (sovData.beaconID != 0)) {
640  pClient->SendErrorMsg("This module cannot be anchored as the system currently has an active beacon.");
641  return;
642  }
643  }
644 
645  if (m_tower)
646  {
647  // hack for warping to moons
648  // this puts ship at Az: 0.785332, Ele: 0.615505, angle: 1.5708
649  //warpToPoint -= (radius * 1.25);
650 
651  uint32 dist = /*BUBBLE_RADIUS_METERS + 10000*/ m_self->GetAttribute(AttrMoonAnchorDistance).get_uint32();
652  uint32 radius = m_moonSE->GetRadius();
653  float rad = EvE::Trig::Deg2Rad(90);
654 
655  pos = m_moonSE->GetPosition();
656  pos.x += radius + dist * std::sin(rad);
657  pos.z += radius + dist * std::cos(rad);
658  m_destiny->SetPosition(pos);
659  sBubbleMgr.Add(this);
660 
661  if (is_log_enabled(POS__TRACE))
662  _log(POS__TRACE, "StructureSE::Anchor() - TowerSE %s(%u) new position %.2f, %.2f, %.2f at %s",
663  GetName(), m_data.itemID, pos.x, pos.y, pos.z, m_moonSE->GetName());
664  }
665  else if (m_sbu)
666  {
667  //verify anchor distance from stargate
669  //uint32 anchorMin(m_self->GetAttribute(AttrAnchorDistanceMin).get_uint32());
671 
672  if (distance > anchorMax) {
673  pClient->SendErrorMsg("You cannot anchor the %s farther than %u meters from a stargate.", \
674  m_self->name(), anchorMax);
675  return;
676  }
677 
678  if (distance < 1000) {
679  pClient->SendErrorMsg("You cannot anchor the %s closer than %u meters from a stargate.", \
680  m_self->name(), 1000);
681  return;
682  }
683 
684  // position is within range. allow anchoring
685  m_destiny->SetPosition(pos);
686 
687  if (is_log_enabled(POS__TRACE))
688  _log(POS__TRACE, "StructureSE::Anchor() - SBUSE %s(%u) is anchoring %u m from %s",
689  GetName(), m_data.itemID, distance, m_gateSE->GetName());
690  }
691  else if (m_tcu or m_ihub)
692  {
693  // these are anchored anywhere in system.
694  m_destiny->SetPosition(pos);
695  }
696  else
697  {
698  if (!m_moonSE->HasTower())
699  {
700  // this should never hit...
701  pClient->SendErrorMsg("There is no tower anchored at this moon. You cannot anchor any structure without a tower");
702  return;
703  }
704  /* few attribs to look into...
705  * maxStructureDistance
706  * posStructureControlDistanceMax (maybe multiply this by tower size, or some fraction thereof?)
707  */
708  m_destiny->SetPosition(pos);
709  }
710 
711  m_self->SaveItem();
712 
718 
719  SendSlimUpdate();
720 
721  std::vector<PyTuple *> updates;
722  SetBallFree sbf;
723  sbf.entityID = m_self->itemID();
724  sbf.is_free = false;
725  updates.push_back(sbf.Encode());
726  SetBallRadius sbr;
727  sbr.entityID = m_self->itemID();
728  sbr.radius = m_self->radius();
729  updates.push_back(sbr.Encode());
730  m_destiny->SendDestinyUpdate(updates); //consumed
731  m_destiny->SendSpecialEffect(m_data.itemID, m_data.itemID, m_self->typeID(), 0, 0, "effects.AnchorDrop", 0, 1, 1, -1, 0);
732 }
bool m_tower
Definition: Structure.h:231
double radius() const
uint32 GetLocationID() const
Definition: Client.h:151
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
#define _log(type, fmt,...)
Definition: logsys.h:124
DestinyManager * m_destiny
Definition: SystemEntity.h:265
double GetRadius()
Definition: SystemEntity.h:208
void SetTimer(uint32 setTimerTime=0)
Definition: timer.cpp:102
const GPoint & position() const
uint32 m_delayTime
Definition: Structure.h:217
void SendDestinyUpdate(std::vector< PyTuple * > &updates, bool self_only=false) const
StargateSE * m_gateSE
Definition: Structure.h:210
bool m_ihub
Definition: Structure.h:230
Timer m_procTimer
Definition: Structure.h:226
int8 m_procState
Definition: Structure.h:214
const char * name()
GaFloat x
Definition: GaTypes.h:207
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
bool m_jammer
Definition: Structure.h:234
bool m_generator
Definition: Structure.h:235
#define is_log_enabled(type)
Definition: logsys.h:78
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
bool m_tcu
Definition: Structure.h:228
InventoryItemRef m_self
Definition: SystemEntity.h:269
int64 get_int()
Definition: EvilNumber.cpp:166
double Deg2Rad(double deg)
Definition: Trig.h:25
uint32 get_uint32()
Definition: EvilNumber.cpp:173
const char * GetName() const
Definition: SystemEntity.h:210
EVEPOS::StructureData m_data
Definition: Structure.h:212
unsigned __int32 uint32
Definition: eve-compat.h:50
void SetPosition(const GPoint &pt, bool update=false)
bool HasTower()
Definition: Moon.h:46
GaFloat y
Definition: GaTypes.h:207
double GetFileTimeNow()
Definition: utils_time.cpp:84
void SendSlimUpdate()
Definition: Structure.cpp:966
EvilNumber GetAttribute(const uint16 attrID) const
MoonSE * m_moonSE
Definition: Structure.h:203
bool m_sbu
Definition: Structure.h:229
#define sItemFactory
Definition: ItemFactory.h:165
GaExpInl GaFloat distance(const GaVec3 &oth) const
Definition: GaTypes.h:158
#define svDataMgr
#define sBubbleMgr
Inventory * GetMyInventory()
Definition: InventoryItem.h:91
uint16 typeID() const
bool ContainsTypeQty(uint16 typeID, uint32 qty=0) const
Definition: Inventory.cpp:526
bool m_bridge
Definition: Structure.h:233
GaFloat z
Definition: GaTypes.h:207
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void StructureSE::SetInvulnerable ( )
virtual
void StructureSE::SetOffline ( )
virtual

Reimplemented in TowerSE, JumpBridgeSE, TCUSE, IHubSE, and SBUSE.

Definition at line 888 of file Structure.cpp.

References flagStructureInactive, InventoryItem::locationID(), m_generator, m_jammer, m_module, SystemEntity::m_self, m_towerSE, TowerSE::OfflineModule(), InventoryItem::SetFlag(), and svDataMgr.

Referenced by Process(), IHubSE::SetOffline(), SBUSE::SetOffline(), TCUSE::SetOffline(), JumpBridgeSE::SetOffline(), and TowerSE::SetOffline().

889 {
891  if (m_module)
892  m_towerSE->OfflineModule(this);
893  if (m_generator) {
894  svDataMgr.UpdateSystemBeaconID(m_self->locationID(),0);
895  }
896  if (m_jammer) {
897  svDataMgr.UpdateSystemJammerID(m_self->locationID(),0);
898  }
899 }
bool SetFlag(EVEItemFlags flag, bool notify=false)
bool m_jammer
Definition: Structure.h:234
void OfflineModule(StructureSE *pSE)
Definition: Tower.h:107
bool m_generator
Definition: Structure.h:235
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 locationID() const
TowerSE * m_towerSE
Definition: Structure.h:205
#define svDataMgr
bool m_module
Definition: Structure.h:237

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::SetOnline ( )
virtual

Reimplemented in TowerSE, JumpBridgeSE, TCUSE, IHubSE, and SBUSE.

Definition at line 869 of file Structure.cpp.

References flagStructureActive, EVEPOS::StructureData::itemID, InventoryItem::itemID(), InventoryItem::locationID(), m_data, m_db, SystemEntity::m_destiny, m_duration, m_generator, m_jammer, m_procState, SystemEntity::m_self, EVEPOS::ProcState::Online, EVEPOS::StructureState::Online, DestinyManager::SendSpecialEffect(), InventoryItem::SetFlag(), SetTimer(), EVEPOS::StructureData::state, svDataMgr, InventoryItem::typeID(), and PosMgrDB::UpdateBaseData().

Referenced by Process(), IHubSE::SetOnline(), SBUSE::SetOnline(), TCUSE::SetOnline(), and JumpBridgeSE::SetOnline().

870 {
871  // this state is persistent until out of resources or changed
875 
878  m_destiny->SendSpecialEffect(m_data.itemID, m_data.itemID, m_self->typeID(), 0, 0, "effects.StructureOnline", 0, 1, 1, -1, 0);
879 
880  if (m_generator) {
881  svDataMgr.UpdateSystemBeaconID(m_self->locationID(),m_self->itemID());
882  }
883  if (m_jammer) {
884  svDataMgr.UpdateSystemJammerID(m_self->locationID(),m_self->itemID());
885  }
886 }
void SetTimer(uint32 time)
Definition: Structure.h:178
DestinyManager * m_destiny
Definition: SystemEntity.h:265
bool SetFlag(EVEItemFlags flag, bool notify=false)
void UpdateBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:132
int8 m_procState
Definition: Structure.h:214
uint32 m_duration
Definition: Structure.h:224
bool m_jammer
Definition: Structure.h:234
bool m_generator
Definition: Structure.h:235
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 locationID() const
EVEPOS::StructureData m_data
Definition: Structure.h:212
PosMgrDB m_db
Definition: Structure.h:201
#define svDataMgr
uint16 typeID() const
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::SetOperating ( )
virtual

Definition at line 931 of file Structure.cpp.

References GetFileTimeNow(), m_data, m_db, m_duration, m_procState, EVEPOS::ProcState::Operating, EVEPOS::StructureState::Operating, SendSlimUpdate(), SetTimer(), EVEPOS::StructureData::state, EVEPOS::StructureData::timestamp, and PosMgrDB::UpdateBaseData().

932 {
933  // this state is persistant until out of resources or changed
937 
939 
940  SendSlimUpdate();
941 
943 }
void SetTimer(uint32 time)
Definition: Structure.h:178
void UpdateBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:132
int8 m_procState
Definition: Structure.h:214
uint32 m_duration
Definition: Structure.h:224
EVEPOS::StructureData m_data
Definition: Structure.h:212
double GetFileTimeNow()
Definition: utils_time.cpp:84
void SendSlimUpdate()
Definition: Structure.cpp:966
PosMgrDB m_db
Definition: Structure.h:201

Here is the call graph for this function:

void StructureSE::SetPlanet ( uint32  planetID)
inline

Definition at line 186 of file Structure.h.

References m_anchorPointID.

186 { m_anchorPointID = planetID; }
uint32 m_anchorPointID
Definition: Structure.h:221
void StructureSE::SetPOSState ( uint8  state)
inline

Definition at line 177 of file Structure.h.

References m_data, EVEPOS::StructureData::state, and state.

177 { m_data.state = state; }
EVEPOS::StructureData m_data
Definition: Structure.h:212
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 kick all and halt server immediate command list all items in current location s gives list of cargo contents and volumes in all holds list current session values show current ship DNA show current objects in their destiny state
void StructureSE::SetTimer ( uint32  time)
inline

Definition at line 178 of file Structure.h.

References m_procTimer, and Timer::SetTimer().

Referenced by Online(), Operating(), TowerSE::SetOnline(), SetOnline(), SetOperating(), and SetVulnerable().

178 { m_procTimer.SetTimer(time); }
void SetTimer(uint32 setTimerTime=0)
Definition: timer.cpp:102
Timer m_procTimer
Definition: Structure.h:226

Here is the call graph for this function:

Here is the caller graph for this function:

void StructureSE::SetUsageFlags ( int8  view = 0,
int8  take = 0,
int8  use = 0 
)

Definition at line 958 of file Structure.cpp.

References m_data, m_db, EVEPOS::StructureData::take, PosMgrDB::UpdateBaseData(), EVEPOS::StructureData::use, and EVEPOS::StructureData::view.

959 {
960  m_data.use = use;
961  m_data.view = view;
962  m_data.take = take;
964 }
void UpdateBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:132
EVEPOS::StructureData m_data
Definition: Structure.h:212
PosMgrDB m_db
Definition: Structure.h:201

Here is the call graph for this function:

void StructureSE::SetVulnerable ( )
virtual

Definition at line 909 of file Structure.cpp.

References m_data, m_db, m_duration, m_procState, EVEPOS::ProcState::Online, SendSlimUpdate(), SetTimer(), EVEPOS::StructureData::state, PosMgrDB::UpdateBaseData(), and EVEPOS::StructureState::Vulnerable.

910 {
914  SendSlimUpdate();
916 }
void SetTimer(uint32 time)
Definition: Structure.h:178
void UpdateBaseData(EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:132
int8 m_procState
Definition: Structure.h:214
uint32 m_duration
Definition: Structure.h:224
EVEPOS::StructureData m_data
Definition: Structure.h:212
void SendSlimUpdate()
Definition: Structure.cpp:966
PosMgrDB m_db
Definition: Structure.h:201

Here is the call graph for this function:

void StructureSE::UpdateTimeStamp ( )
inline

Definition at line 190 of file Structure.h.

References EVEPOS::StructureData::itemID, m_data, m_db, and PosMgrDB::UpdateTimeStamp().

EVEPOS::StructureData m_data
Definition: Structure.h:212
PosMgrDB m_db
Definition: Structure.h:201
void UpdateTimeStamp(int32 itemID, EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:386

Here is the call graph for this function:

void StructureSE::UpdateUsageFlags ( )
inline

Definition at line 191 of file Structure.h.

References EVEPOS::StructureData::itemID, m_data, m_db, and PosMgrDB::UpdateUsageFlags().

EVEPOS::StructureData m_data
Definition: Structure.h:212
void UpdateUsageFlags(int32 itemID, EVEPOS::StructureData &data)
Definition: PosMgrDB.cpp:447
PosMgrDB m_db
Definition: Structure.h:201

Here is the call graph for this function:

Member Data Documentation

uint32 StructureSE::m_anchorPointID
protected

Definition at line 221 of file Structure.h.

Referenced by GetPlanetID(), and SetPlanet().

bool StructureSE::m_bridge
private

Definition at line 233 of file Structure.h.

Referenced by Init(), InitData(), and SetAnchor().

JumpBridgeSE* StructureSE::m_bridgeSE
protected

Definition at line 209 of file Structure.h.

Referenced by Init().

uint32 StructureSE::m_delayTime
protected
uint32 StructureSE::m_duration
private

Definition at line 224 of file Structure.h.

Referenced by Init(), Online(), Operating(), SetOnline(), SetOperating(), and SetVulnerable().

StargateSE* StructureSE::m_gateSE
protected

Definition at line 210 of file Structure.h.

Referenced by GetGateSE(), Init(), InitData(), Process(), and SetAnchor().

bool StructureSE::m_generator
private

Definition at line 235 of file Structure.h.

Referenced by Init(), IsCynoGeneratorSE(), SetAnchor(), SetOffline(), and SetOnline().

bool StructureSE::m_ihub
private

Definition at line 230 of file Structure.h.

Referenced by Activate(), EncodeDestiny(), Init(), and SetAnchor().

IHubSE* StructureSE::m_ihubSE
protected

Definition at line 208 of file Structure.h.

Referenced by Init().

bool StructureSE::m_jammer
private

Definition at line 234 of file Structure.h.

Referenced by Init(), IsJammerSE(), SetAnchor(), SetOffline(), and SetOnline().

bool StructureSE::m_loaded
private

Definition at line 236 of file Structure.h.

Referenced by Init().

bool StructureSE::m_miner
private

Definition at line 232 of file Structure.h.

Referenced by Init(), IsMoonMiner(), and MakeSlimItem().

bool StructureSE::m_module
private

Definition at line 237 of file Structure.h.

Referenced by Activate(), GetEffectState(), Init(), InitData(), MakeSlimItem(), and SetOffline().

MoonSE* StructureSE::m_moonSE
protected
bool StructureSE::m_outpost
private

Definition at line 239 of file Structure.h.

Referenced by GetOutpostSE(), IsOutpostSE(), and MakeSlimItem().

PlanetSE* StructureSE::m_planetSE
protected

Definition at line 204 of file Structure.h.

Referenced by GetPlanetSE().

Timer StructureSE::m_procTimer
private

Definition at line 226 of file Structure.h.

Referenced by Activate(), Deactivate(), Process(), PullAnchor(), SetAnchor(), SetTimer(), and StructureSE().

bool StructureSE::m_reactor
private

Definition at line 238 of file Structure.h.

Referenced by Init().

GVector StructureSE::m_rotation
protected

Definition at line 220 of file Structure.h.

Referenced by Init(), and MakeSlimItem().

bool StructureSE::m_sbu
private

Definition at line 229 of file Structure.h.

Referenced by Activate(), EncodeDestiny(), Init(), InitData(), Process(), and SetAnchor().

SBUSE* StructureSE::m_sbuSE
protected

Definition at line 207 of file Structure.h.

Referenced by Init().

bool StructureSE::m_tcu
private

Definition at line 228 of file Structure.h.

Referenced by Activate(), EncodeDestiny(), Init(), MakeSlimItem(), and SetAnchor().

TCUSE* StructureSE::m_tcuSE
protected

Definition at line 206 of file Structure.h.

Referenced by Init().

bool StructureSE::m_tower
private
TowerSE* StructureSE::m_towerSE
protected

Definition at line 205 of file Structure.h.

Referenced by Activate(), Init(), and SetOffline().


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