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

#include "SBU.h"

Inheritance diagram for SBUSE:
Collaboration diagram for SBUSE:

Public Member Functions

virtual ~SBUSE ()
 
virtual SBUSEGetSBUSE ()
 
virtual bool isGlobal ()
 
virtual bool IsOperSE ()
 
virtual bool IsSBUSE ()
 
- Public Member Functions inherited from StructureSE
virtual ~StructureSE ()
 
virtual StructureSEGetPOSSE ()
 
virtual StructureSEGetOutpostSE ()
 
virtual TowerSEGetTowerSE ()
 
virtual ArraySEGetArraySE ()
 
virtual BatterySEGetBatterySE ()
 
virtual WeaponSEGetWeaponSE ()
 
virtual ReactorSEGetReactorSE ()
 
virtual TCUSEGetTCUSE ()
 
virtual IHubSEGetIHubSE ()
 
virtual JumpBridgeSEGetJumpBridgeSE ()
 
virtual bool IsPOSSE ()
 
virtual bool IsTCUSE ()
 
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 ()
 
 StructureSE (StructureItemRef structure, PyServiceMgr &services, SystemManager *system, const FactionData &data)
 
virtual void EncodeDestiny (Buffer &into)
 
virtual PyDictMakeSlimItem ()
 
virtual void Killed (Damage &fatal_blow)
 
virtual void InitData ()
 
virtual void Scoop ()
 
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 ()
 
- 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 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 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 ()
 

SBU.cpp

Class for Sovereignty Blockade Units.

: James

Date
: 8 April 2021
 SBUSE (StructureItemRef structure, PyServiceMgr &services, SystemManager *system, const FactionData &fData)
 
virtual void Process ()
 
virtual void SetOnline ()
 
virtual void SetOffline ()
 
virtual void Init ()
 
float GetGates ()
 
float GetSBUs ()
 
void MarkContested (uint32 systemID, bool contested)
 

Additional Inherited Members

- Protected Member Functions inherited from StructureSE
void SendEffectUpdate (int16 effectID, bool active)
 
- Protected Attributes inherited from StructureSE
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
 

Detailed Description

Definition at line 15 of file SBU.h.

Constructor & Destructor Documentation

SBUSE::SBUSE ( StructureItemRef  structure,
PyServiceMgr services,
SystemManager system,
const FactionData fData 
)

Definition at line 33 of file SBU.cpp.

34  : StructureSE(structure, services, system, fData)
35 {
36 }
StructureSE(StructureItemRef structure, PyServiceMgr &services, SystemManager *system, const FactionData &data)
Definition: Structure.cpp:193
virtual SBUSE::~SBUSE ( )
inlinevirtual

Definition at line 20 of file SBU.h.

20 { /* do nothing here */ }

Member Function Documentation

float SBUSE::GetGates ( )
private

Definition at line 147 of file SBU.cpp.

References SystemManager::GetGates(), and SystemEntity::m_system.

Referenced by SetOffline(), and SetOnline().

148 {
149  return (float)m_system->GetGates().size();
150 }
std::map< uint32, SystemEntity * > GetGates()
SystemManager * m_system
Definition: SystemEntity.h:263

Here is the call graph for this function:

Here is the caller graph for this function:

float SBUSE::GetSBUs ( )
private

Definition at line 153 of file SBU.cpp.

References SystemManager::GetOperationalStatics(), SystemEntity::m_system, and EVEPOS::StructureState::Online.

Referenced by SetOffline(), and SetOnline().

154 {
155  int numberOfSBUs = 0;
156  for (auto cur : m_system->GetOperationalStatics())
157  {
158  if (cur.second->IsSBUSE())
159  {
160  //Only increment the number of SBUs if they are online
161  if (cur.second->GetSBUSE()->GetState() == EVEPOS::StructureState::Online)
162  {
163  numberOfSBUs++;
164  }
165  }
166  }
167  return (float)numberOfSBUs;
168 }
SystemManager * m_system
Definition: SystemEntity.h:263
std::map< uint32, SystemEntity * > GetOperationalStatics()

Here is the call graph for this function:

Here is the caller graph for this function:

virtual SBUSE* SBUSE::GetSBUSE ( )
inlinevirtual

Reimplemented from StructureSE.

Definition at line 23 of file SBU.h.

23 { return this; }
void SBUSE::Init ( )
virtual

Reimplemented from StructureSE.

Definition at line 38 of file SBU.cpp.

References _log, AttrIsGlobal, EvilOne, StructureSE::Init(), InventoryItem::itemID(), SystemEntity::m_bubble, SystemEntity::m_self, InventoryItem::name(), InventoryItem::SetAttribute(), and SystemBubble::SetSBUSE().

39 {
40  _log(SE__TRACE, "SBUSE %s(%u) is being initialised", m_self->name(), m_self->itemID());
42 
43  // check for valid bubble
44  if (m_bubble == nullptr)
45  assert(0);
46  m_bubble->SetSBUSE(this);
47 
48  // set global attribute
50 }
#define _log(type, fmt,...)
Definition: logsys.h:124
SystemBubble * m_bubble
Definition: SystemEntity.h:262
const char * name()
InventoryItemRef m_self
Definition: SystemEntity.h:269
void SetSBUSE(SBUSE *pSBU)
Definition: SystemBubble.h:152
void SetAttribute(uint16 attrID, int num, bool notify=true)
EvilNumber EvilOne
Definition: EvilNumber.cpp:34
virtual void Init()
Definition: Structure.cpp:275
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

virtual bool SBUSE::isGlobal ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 24 of file SBU.h.

24 { return true; }
virtual bool SBUSE::IsOperSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 25 of file SBU.h.

25 { return true; }
virtual bool SBUSE::IsSBUSE ( )
inlinevirtual

Reimplemented from StructureSE.

Definition at line 28 of file SBU.h.

28 { return true; }
void SBUSE::MarkContested ( uint32  systemID,
bool  contested 
)
private

Definition at line 110 of file SBU.cpp.

References _log, SovereigntyData::allianceID, args, SovereigntyData::claimStructureID, SovereigntyData::claimTime, SovereigntyData::corporationID, SovereigntyData::hubID, sEntityList, PyTuple::SetItem(), PyDict::SetItemString(), and svDataMgr.

Referenced by SetOffline(), and SetOnline().

111 {
112  //Send ProcessSovStatusChanged Notification
113  PyDict *args = new PyDict;
114  _log(SOV__DEBUG, "SBUSE::MarkContested(): Sending ProcessSovStatusChanged for %u", systemID);
115 
116  //Update datamgr records with new contested state
117  svDataMgr.MarkContested(systemID, contested);
118 
119  //Get the new sov data so we can send it to the client in a notification
120  SovereigntyData sovData = svDataMgr.GetSovereigntyData(systemID);
121 
122  args->SetItemString("corporationID", new PyInt(sovData.corporationID));
123  args->SetItemString("claimTime", new PyLong(sovData.claimTime));
124  args->SetItemString("claimStructureID", new PyInt(sovData.claimStructureID));
125  args->SetItemString("hubID", new PyInt(sovData.hubID));
126  args->SetItemString("allianceID", new PyInt(sovData.allianceID));
127  args->SetItemString("contested", new PyInt(int(contested)));
128  args->SetItemString("solarSystemID", new PyInt(systemID));
129 
130  PyTuple *data = new PyTuple(2);
131  data->SetItem(0, new PyInt(systemID));
132  data->SetItem(1, new PyObject("util.KeyVal", args));
133 
134  std::vector<Client *> list;
135  sEntityList.GetClients(list);
136  for (auto cur : list)
137  {
138  if (cur->GetChar().get() != nullptr)
139  {
140  cur->SendNotification("ProcessSovStatusChanged", "clientID", &data);
141  _log(SOV__DEBUG, "ProcessSovStatusChanged sent to client %u", cur->GetClientID());
142  }
143  }
144 }
#define _log(type, fmt,...)
Definition: logsys.h:124
Python's dictionary.
Definition: PyRep.h:719
#define sEntityList
Definition: EntityList.h:208
Python tuple.
Definition: PyRep.h:567
* args
Python object.
Definition: PyRep.h:826
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
#define svDataMgr
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 SBUSE::Process ( )
virtual

Reimplemented from StructureSE.

Definition at line 105 of file SBU.cpp.

References StructureSE::Process().

106 {
108 }
virtual void Process()
Definition: Structure.cpp:458

Here is the call graph for this function:

void SBUSE::SetOffline ( )
virtual

Reimplemented from StructureSE.

Definition at line 80 of file SBU.cpp.

References _log, GetGates(), SystemManager::GetID(), SystemManager::GetOperationalStatics(), GetSBUs(), SystemEntity::m_system, MarkContested(), and StructureSE::SetOffline().

81 {
82  // Ensure that the SBU is offline before we check ratio
84 
85  if ((GetSBUs() / GetGates()) <= 0.5)
86  {
87  _log(SOV__DEBUG, "- STATE CHANGE - This system has %u SBUs installed in the total of %u stargates. The TCU is no longer vulnerable to attack.", (int)GetSBUs(), (int)GetGates());
88  // Make the TCU invulnerable
89  for (auto cur : m_system->GetOperationalStatics())
90  {
91  if (cur.second->IsTCUSE())
92  {
93  cur.second->GetTCUSE()->SetOnline();
94  }
95  }
96  // Unmark the system as contested
97  MarkContested(m_system->GetID(), false);
98  }
99  else
100  {
101  _log(SOV__DEBUG, "This system has %u SBUs installed in the total of %u stargates. The TCU is vulnerable.", (int)GetSBUs(), (int)GetGates());
102  }
103 }
#define _log(type, fmt,...)
Definition: logsys.h:124
float GetSBUs()
Definition: SBU.cpp:153
uint32 GetID() const
Definition: SystemManager.h:80
void MarkContested(uint32 systemID, bool contested)
Definition: SBU.cpp:110
SystemManager * m_system
Definition: SystemEntity.h:263
virtual void SetOffline()
Definition: Structure.cpp:888
std::map< uint32, SystemEntity * > GetOperationalStatics()
float GetGates()
Definition: SBU.cpp:147

Here is the call graph for this function:

void SBUSE::SetOnline ( )
virtual

Reimplemented from StructureSE.

Definition at line 52 of file SBU.cpp.

References _log, GetGates(), SystemManager::GetID(), SystemManager::GetOperationalStatics(), GetSBUs(), SystemEntity::m_system, MarkContested(), and StructureSE::SetOnline().

53 {
54  _log(SOV__DEBUG, "Onlining SBU...");
55 
56  // Ensure the SBU is online before we check the ratio
58 
59  // If more than 50 percent of gates have an SBU, the TCU should be vulnerable
60  if ((GetSBUs() / GetGates()) > 0.5)
61  {
62  _log(SOV__DEBUG, "- STATE CHANGE - This system has %u SBUs installed in the total of %u stargates. The TCU is now vulnerable to attack.", (int)GetSBUs(), (int)GetGates());
63  // Make the TCU vulnerable
64  for (auto cur : m_system->GetOperationalStatics())
65  {
66  if (cur.second->IsTCUSE())
67  {
68  cur.second->GetTCUSE()->SetVulnerable();
69  }
70  }
71  // Mark the system as contested
72  MarkContested(m_system->GetID(), true);
73  }
74  else
75  {
76  _log(SOV__DEBUG, "This system has %u SBUs installed in the total of %u stargates. The TCU is invulnerable.", (int)GetSBUs(), (int)GetGates());
77  }
78 }
#define _log(type, fmt,...)
Definition: logsys.h:124
float GetSBUs()
Definition: SBU.cpp:153
uint32 GetID() const
Definition: SystemManager.h:80
virtual void SetOnline()
Definition: Structure.cpp:869
void MarkContested(uint32 systemID, bool contested)
Definition: SBU.cpp:110
SystemManager * m_system
Definition: SystemEntity.h:263
std::map< uint32, SystemEntity * > GetOperationalStatics()
float GetGates()
Definition: SBU.cpp:147

Here is the call graph for this function:


The documentation for this class was generated from the following files:
  • /backups/local/src/eve/EvEmu_Crucible/src/eve-server/pos/sovStructures/SBU.h
  • /backups/local/src/eve/EvEmu_Crucible/src/eve-server/pos/sovStructures/SBU.cpp