EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Probes.h
Go to the documentation of this file.
1 
10 #ifndef EVEMU_EXPLORE_PROBES_H_
11 #define EVEMU_EXPLORE_PROBES_H_
12 
13 
14 #include "EVEServerConfig.h"
15 #include "StaticDataMgr.h"
16 #include "../../eve-common/EVE_Scanning.h"
18 #include "system/SystemEntity.h"
19 
20 
24 class ProbeItem
25 : public InventoryItem
26 {
27  friend class InventoryItem; // to let it construct us
28 public:
29  ProbeItem(uint32 itemID, const ItemType &_type, const ItemData &_data);
30  virtual ~ProbeItem() { /* Do nothing here */ }
31 
32  /* virtual functions default to base class and overridden as needed */
33  virtual void Delete(); //totally removes item from game and deletes from the DB.
34 
35 
36  static ProbeItemRef Load( uint32 itemID);
37  static ProbeItemRef Spawn( ItemData &data);
38 
39 protected:
41  //virtual bool _Load();
42 
43  // Template loader:
44  template<class _Ty>
45  static RefPtr<_Ty> _LoadItem( uint32 itemID, const ItemType &type, const ItemData &data)
46  {
49  //and (type.groupID() != EVEDB::invGroups::Warp_Disruption_Probe) this wont work here...
51  _log(ITEM__ERROR, "Trying to load %s as Probe.", sDataMgr.GetCategoryName(type.categoryID()));
52  if (sConfig.debug.StackTrace)
54  return RefPtr<_Ty>();
55  }
56 
57  return ProbeItemRef( new ProbeItem(itemID, type, data));
58  }
59 
60  static uint32 CreateItemID( ItemData &data);
61 };
62 
63 
64 
68 class PyServiceMgr;
69 class Scan;
70 
71 class ProbeSE : public DynamicSystemEntity {
72 public:
73  // abandoned probe c'tor
75  // launched probe c'tor
76  ProbeSE(ProbeItemRef self, PyServiceMgr& services, SystemManager* system, InventoryItemRef moduleRef, ShipItemRef shipRef);
77  virtual ~ProbeSE();
78 
79  /* Process Calls - Overridden as needed in derived classes */
80  virtual bool ProcessTic();
81 
82  /* class type pointer querys. */
83  virtual ProbeSE* GetProbeSE() { return this; }
84  /* class type tests. */
85  /* Base */
86  virtual bool IsProbeSE() { return true; }
87 
88  /* virtual functions default to base class and overridden as needed */
89  virtual void MakeDamageState(DoDestinyDamageState &into);
90  virtual PyDict* MakeSlimItem();
91 
92  /* specific functions handled in this class. */
93  void RecoverProbe(PyList* list);
94  void UpdateProbe(ProbeData& data);
95  // removes probe from system and scan map, and sends RemoveProbe call to client
96  // does not remove probe from entity list
97  void RemoveProbe();
98  void SendNewProbe();
99  void SendSlimChange();
101  void SendWarpStart(float travelTime);
102  void SendWarpEnd();
103 
104  void SetScan(Scan* pScan) { m_scan = pScan; }
105  void RemoveScan() { m_scan = nullptr; }
106  void StartStateTimer(uint16 time) { m_stateTimer.Start(time); }
107 
108  bool IsMoving();
109 
111  uint8 GetState() { return m_state; }
113 
114  // remaining move time in ms
117 
118  // return deviation in meters based on current probe settings
119  float GetDeviation();
120  // return probe scan range setting in km
121  float GetScanRange() { return m_scanRange; }
122  float GetRangeModifier(float dist);
123 
124  // total probe scan strength, based on data modified by char skills, ship, launcher, and range
125  float GetScanStrength();
126 
128  const char* GetStateName(uint8 state);
129 
130  bool CanScanShips() { return m_scanShips; }
131 
132  bool IsRing() { return m_ring; }
133  bool IsSphere() { return m_sphere; }
134  void SetRing(bool set=false) { m_ring = set; }
135  void SetSphere(bool set=false) { m_sphere = set; }
136 
137 
138  // this will allow players with Sensor Linking L5 and Signal Acquisition L5
139  // to add another set of probe results to the signal being scanned (max of 4)
140  bool HasMaxSkill();
141 
142 private:
146 
149 
151 
154 
156  bool m_ring; // used to send additional data to client for partial hit
157  bool m_sphere; // used to send additional data to client for partial hit
158 
160  uint8 m_rangeStep; // range 'click'. values are 1 to 8. sent from client
161  uint8 m_rangeFactor; // exponent for range checks
162 
163  uint32 m_baseScanRange; // lowest scan radius, in km
164 
165  int64 m_expiry; // probe lifetime as filetime
166 
167  float m_secStatus;
168  float m_scanRange; // in km. sent from client
169  float m_scanStrength; // scan str in decimal. unsure of uom
170  float m_scanDeviation; // max scan deviation for this probe, in % where 1.0 = 100
171 
172 };
173 
174 #endif // EVEMU_EXPLORE_PROBES_H_
int64 m_expiry
Definition: Probes.h:165
virtual ~ProbeSE()
Definition: Probes.cpp:244
#define sConfig
A macro for easier access to the singleton.
uint32 m_baseScanRange
Definition: Probes.h:163
GPoint m_destination
Definition: Probes.h:150
bool m_ring
Definition: Probes.h:156
unsigned __int8 uint8
Definition: eve-compat.h:46
bool CanScanShips()
Definition: Probes.h:130
void RemoveProbe()
Definition: Probes.cpp:384
#define _log(type, fmt,...)
Definition: logsys.h:124
void UpdateProbe(ProbeData &data)
Definition: Probes.cpp:299
Python's dictionary.
Definition: PyRep.h:719
uint16 groupID() const
Definition: ItemType.h:64
virtual void Delete()
Definition: Probes.cpp:61
void StartStateTimer(uint16 time)
Definition: Probes.h:106
void SetRing(bool set=false)
Definition: Probes.h:134
float m_secStatus
Definition: Probes.h:167
uint8 m_rangeFactor
Definition: Probes.h:161
RefPtr< ProbeItem > ProbeItemRef
Definition: ItemRef.h:56
virtual ProbeSE * GetProbeSE()
Definition: Probes.h:83
virtual bool _Load()
float GetRangeModifier(float dist)
Definition: Probes.cpp:475
uint32 GetRemainingTime() const
Definition: timer.cpp:114
void RemoveScan()
Definition: Probes.h:105
Timer m_returnTimer
Definition: Probes.h:144
uint8 categoryID() const
Definition: ItemType.h:66
uint8 GetState()
Definition: Probes.h:111
GPoint GetDestination()
Definition: Probes.h:127
virtual bool ProcessTic()
Definition: Probes.cpp:249
const ItemType & type() const
void SendNewProbe()
Definition: Probes.cpp:348
bool HasMaxSkill()
Definition: Probes.cpp:482
Definition: gpoint.h:33
void SetState(uint8 state=Probe::State::Idle)
Definition: Probes.h:110
bool IsSphere()
Definition: Probes.h:133
PyTuple * MakeDamageState()
Definition: Probes.h:71
float GetScanStrength()
Definition: Probes.cpp:469
virtual PyDict * MakeSlimItem()
Definition: Probes.cpp:489
virtual bool IsProbeSE()
Definition: Probes.h:86
Timer m_stateTimer
Definition: Probes.h:145
void SetScan(Scan *pScan)
Definition: Probes.h:104
ProbeSE(ProbeItemRef self, PyServiceMgr &services, SystemManager *system)
Definition: Probes.cpp:83
void SendStateChange(uint8 state)
Definition: Probes.cpp:369
uint8 m_rangeStep
Definition: Probes.h:160
Client * m_client
Definition: Probes.h:148
static ProbeItemRef Spawn(ItemData &data)
Definition: Probes.cpp:52
Definition: Client.h:66
static RefPtr< _Ty > _LoadItem(uint32 itemID, const ItemType &type, const ItemData &data)
Definition: Probes.h:45
bool IsRing()
Definition: Probes.h:132
unsigned __int32 uint32
Definition: eve-compat.h:50
ShipItemRef m_shipRef
Definition: Probes.h:152
float m_scanStrength
Definition: Probes.h:169
float m_scanRange
Definition: Probes.h:168
signed __int64 int64
Definition: eve-compat.h:51
InventoryItemRef m_moduleRef
Definition: Probes.h:153
float m_scanDeviation
Definition: Probes.h:170
void SetSphere(bool set=false)
Definition: Probes.h:135
float GetDeviation()
Definition: Probes.cpp:463
int64 GetExpiryTime()
Definition: Probes.h:116
const char * GetStateName(uint8 state)
Definition: Probes.cpp:449
bool m_scanShips
Definition: Probes.h:155
void RecoverProbe(PyList *list)
Definition: Probes.cpp:324
bool m_sphere
Definition: Probes.h:157
Scan * m_scan
Definition: Probes.h:147
uint8 m_state
Definition: Probes.h:159
uint8 GetRangeStep()
Definition: Probes.h:112
void traceStack(void)
Definition: misc.cpp:169
float GetScanRange()
Definition: Probes.h:121
void SendWarpStart(float travelTime)
Definition: Probes.cpp:405
Definition: timer.h:30
static uint32 CreateItemID(ItemData &data)
Definition: Probes.cpp:42
virtual ~ProbeItem()
Definition: Probes.h:30
void SendSlimChange()
Definition: Probes.cpp:513
unsigned __int16 uint16
Definition: eve-compat.h:48
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 SendWarpEnd()
Definition: Probes.cpp:438
static ProbeItemRef Load(uint32 itemID)
Definition: Probes.cpp:47
uint16 GetMoveTime()
Definition: Probes.h:115
Definition: Scan.h:32
Python list.
Definition: PyRep.h:639
uint32 itemID() const
Definition: InventoryItem.h:98
Timer m_lifeTimer
Definition: Probes.h:143
ProbeItem(uint32 itemID, const ItemType &_type, const ItemData &_data)
Definition: Probes.cpp:31
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81
bool IsMoving()
Definition: Probes.cpp:283