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

Namespaces

 Ball
 

Classes

struct  AddBall_header
 
struct  BallHeader
 
struct  DataSector
 
struct  FIELD_Struct
 
struct  FOLLOW_Struct
 
struct  FORMATION_Struct
 
struct  GOTO_Struct
 
struct  MassSector
 
struct  MiniBall
 
struct  MiniBallList
 
struct  MISSILE_Struct
 
struct  MUSHROOM_Struct
 
struct  NameSector
 
struct  ORBIT_Struct
 
struct  RIGID_Struct
 
union  SpecificSectors
 
struct  STOP_Struct
 
struct  TotalStruct
 
struct  TROLL_Struct
 
struct  WARP_Struct
 

Functions

void DumpUpdate (LogType into, const uint8 *data, uint32 len)
 
uint32 DumpBall (LogType into, const uint8 *data, uint32 len)
 
std::string GetFlagNames (uint8 flags)
 

Variables

const char *const modeNames []
 
static const uint8 MAX_DSTBALL = 12
 

Function Documentation

uint32 Destiny::DumpBall ( LogType  into,
const uint8 data,
uint32  len 
)

Definition at line 64 of file DestinyBinDump.cpp.

References _hex, _log, Destiny::MassSector::allianceID, Destiny::Ball::Mode::BOID, Destiny::MassSector::cloak, Destiny::MassSector::corporationID, Destiny::WARP_Struct::effectStamp, Destiny::MISSILE_Struct::effectStamp, Destiny::MUSHROOM_Struct::effectStamp, Destiny::TROLL_Struct::effectStamp, Destiny::FORMATION_Struct::effectStamp, Destiny::BallHeader::entityID, Destiny::Ball::Mode::FIELD, Destiny::BallHeader::flags, Destiny::Ball::Mode::FOLLOW, Destiny::FOLLOW_Struct::followID, Destiny::WARP_Struct::followID, Destiny::FORMATION_Struct::followID, Destiny::FOLLOW_Struct::followRange, Destiny::WARP_Struct::followRange, Destiny::ORBIT_Struct::followRange, Destiny::MISSILE_Struct::followRange, Destiny::MUSHROOM_Struct::followRange, Destiny::FORMATION_Struct::followRange, Destiny::Ball::Mode::FORMATION, Destiny::GOTO_Struct::formationID, Destiny::FOLLOW_Struct::formationID, Destiny::STOP_Struct::formationID, Destiny::WARP_Struct::formationID, Destiny::ORBIT_Struct::formationID, Destiny::MISSILE_Struct::formationID, Destiny::MUSHROOM_Struct::formationID, Destiny::TROLL_Struct::formationID, Destiny::FIELD_Struct::formationID, Destiny::RIGID_Struct::formationID, Destiny::FORMATION_Struct::formationID, GetFlagNames(), Destiny::Ball::Mode::GOTO, Destiny::MassSector::harmonic, Destiny::DataSector::inertia, Destiny::Ball::Flag::IsFree, Destiny::MassSector::mass, MAX_DSTBALL, Destiny::DataSector::maxSpeed, Destiny::Ball::Mode::MINIBALL, Destiny::Ball::Mode::MISSILE, Destiny::BallHeader::mode, Destiny::Ball::Mode::MUSHROOM, Destiny::Ball::Mode::ORBIT, Destiny::MISSILE_Struct::ownerID, Destiny::MUSHROOM_Struct::ownerID, Destiny::BallHeader::posX, Destiny::BallHeader::posY, Destiny::BallHeader::posZ, Destiny::BallHeader::radius, Destiny::Ball::Mode::RIGID, Destiny::WARP_Struct::speed, Destiny::DataSector::speedfraction, Destiny::Ball::Mode::STOP, Destiny::ORBIT_Struct::targetID, Destiny::MISSILE_Struct::targetID, Destiny::WARP_Struct::targX, Destiny::WARP_Struct::targY, Destiny::WARP_Struct::targZ, Destiny::Ball::Mode::TROLL, Destiny::MUSHROOM_Struct::unknown125, Destiny::DataSector::velX, Destiny::DataSector::velY, Destiny::DataSector::velZ, Destiny::Ball::Mode::WARP, Destiny::GOTO_Struct::x, Destiny::MISSILE_Struct::x, Destiny::GOTO_Struct::y, Destiny::MISSILE_Struct::y, Destiny::GOTO_Struct::z, and Destiny::MISSILE_Struct::z.

Referenced by DumpUpdate().

64  {
65  uint32 init_len = len;
66 
67  const BallHeader *ballhead = (const BallHeader *) data;
68  data += sizeof(BallHeader);
69  len -= sizeof(BallHeader);
70 
71  if ((ballhead->entityID == 0) or (ballhead->entityID > 2147483647)) { // max int32
72  _log(into, "Error: Invalid entityID for ball %li", ballhead->entityID);
73  return 0;
74  }
75 
76  if (ballhead->mode > MAX_DSTBALL) {
77  _log(into, "Error: Invalid ball mode %u for ball %li", ballhead->mode, ballhead->entityID);
78  return 0;
79  }
80 
81  /* not used yet.
82  const NameStruct *name = (const NameStruct *) data;
83  data += sizeof(NameStruct);
84  len -= sizeof(NameStruct);
85  if (name->name_len > 0) {
86  _log(into, " Name: len: %u", name->name_len);
87  _log(into, " ~ %s", name->name);
88 
89  data += name->name_len*sizeof(uint16);
90  len -= name->name_len*sizeof(uint16);
91  }
92  */
93  _log(into, "entity: %li, mode: %s(%u) flags: %s", ballhead->entityID, modeNames[ballhead->mode], ballhead->mode, Destiny::GetFlagNames(ballhead->flags).c_str());
94  _log(into, " pos: %.2f, %.2f, %.2f, radius: %.1f", ballhead->posX, ballhead->posY, ballhead->posZ, ballhead->radius);
95 
96  if (ballhead->mode != Ball::Mode::RIGID) {
97  const MassSector *masschunk = (const MassSector *) data;
98  data += sizeof(MassSector);
99  len -= sizeof(MassSector);
100 
101  _log(into, " mass: %.2f, cloak: %u, harmonic: %i, corp: %i, alliance: %li" ,
102  masschunk->mass, masschunk->cloak, masschunk->harmonic, masschunk->corporationID, masschunk->allianceID);
103  }
104 
105  //this seems a little strange, but this is how it works...
106  if ((ballhead->flags & Ball::Flag::IsFree) == Ball::Flag::IsFree) {
107  const DataSector *shipchunk = (const DataSector *) data;
108  data += sizeof(DataSector);
109  len -= sizeof(DataSector);
110 
111  _log(into, " maxSpeed: %.2f, Velocity: %.2f, %.2f, %.2f IM: %.4f, SF: %.3f",
112  shipchunk->maxSpeed,
113  shipchunk->velX, shipchunk->velY, shipchunk->velZ,
114  shipchunk->inertia,
115  shipchunk->speedfraction);
116  }
117 
118  _log(into, " %s:", modeNames[ballhead->mode]);
119  switch(ballhead->mode) {
120  case Ball::Mode::BOID:
121  case Ball::Mode::MINIBALL: {
122  _log(into, " This is not coded (or correct) yet.");
123  return 0;
124  } break;
125  case Ball::Mode::GOTO: {
126  const GOTO_Struct *b = (const GOTO_Struct *) data;
127  data += sizeof(GOTO_Struct);
128  len -= sizeof(GOTO_Struct);
129  _log(into, " formID: %u, direction: %.2f, %.2f, %.2f", b->formationID, b->x, b->y, b->z);
130  } break;
131  case Ball::Mode::FOLLOW: {
132  const FOLLOW_Struct *b = (const FOLLOW_Struct *) data;
133  data += sizeof(FOLLOW_Struct);
134  len -= sizeof(FOLLOW_Struct);
135  _log(into, " formID: %u, followID: %li, distance: %.1f", b->formationID, b->followID, b->followRange);
136  } break;
137  case Ball::Mode::STOP: {
138  const STOP_Struct *b = (const STOP_Struct *) data;
139  data += sizeof(STOP_Struct);
140  len -= sizeof(STOP_Struct);
141  _log(into, " formID: %u ", b->formationID);
142  } break;
143  case Ball::Mode::WARP: {
144  const WARP_Struct *b = (const WARP_Struct *) data;
145  data += sizeof(WARP_Struct);
146  len -= sizeof(WARP_Struct);
147  _log(into, " formID: %u, TargPt: %.2f, %.2f, %.2f start: %i", b->formationID, b->targX, b->targY, b->targZ, b->effectStamp);
148  _log(into, " followRange: %li, followID: %li, warpSpeed: %i", b->followRange, b->followID, b->speed);
149  } break;
150  case Ball::Mode::ORBIT: {
151  const ORBIT_Struct *b = (const ORBIT_Struct *) data;
152  data += sizeof(ORBIT_Struct);
153  len -= sizeof(ORBIT_Struct);
154  _log(into, " formID: %u, targetID: %u, distance: %.1f", b->formationID, b->targetID, b->followRange);
155  } break;
156  case Ball::Mode::MISSILE: {
157  const MISSILE_Struct *b = (const MISSILE_Struct *) data;
158  data += sizeof(MISSILE_Struct);
159  len -= sizeof(MISSILE_Struct);
160  _log(into, " formID: %u, targetID: %li, followRange: %.1f, ownerID: %li, start: %i", b->formationID, b->targetID, b->followRange, b->ownerID, b->effectStamp);
161  _log(into, " pos: %.2f, %.2f, %.2f", b->x, b->y, b->z);
162  } break;
163  case Ball::Mode::MUSHROOM: {
164  const MUSHROOM_Struct *b = (const MUSHROOM_Struct *) data;
165  data += sizeof(MUSHROOM_Struct);
166  len -= sizeof(MUSHROOM_Struct);
167  _log(into, " formID: %u, distance: %.2f, u125: %.3f, start: %i, ownerID: %li", b->formationID, b->followRange, b->unknown125, b->effectStamp, b->ownerID);
168  } break;
169  case Ball::Mode::TROLL: {
170  const TROLL_Struct *b = (const TROLL_Struct *) data;
171  data += sizeof(TROLL_Struct);
172  len -= sizeof(TROLL_Struct);
173  _log(into, " formID: %u, start: %i", b->formationID, b->effectStamp);
174  } break;
175  case Ball::Mode::FIELD: {
176  const FIELD_Struct *b = (const FIELD_Struct *) data;
177  data += sizeof(FIELD_Struct);
178  len -= sizeof(FIELD_Struct);
179  _log(into, " formID: %u ", b->formationID);
180  } break;
181  case Ball::Mode::RIGID: {
182  const RIGID_Struct *b = (const RIGID_Struct *) data;
183  data += sizeof(RIGID_Struct);
184  len -= sizeof(RIGID_Struct);
185  _log(into, " formID: %u ", b->formationID);
186  } break;
187  case Ball::Mode::FORMATION: { // not used
188  const FORMATION_Struct *b = (const FORMATION_Struct *) data;
189  data += sizeof(FORMATION_Struct);
190  len -= sizeof(FORMATION_Struct);
191  _log(into, " formID: %u, followID: %li, followRange: %.2f, start: %i", b->formationID, b->followID, b->followRange, b->effectStamp);
192  } break;
193  default:
194  _log(into, "Error: Unknown ball mode %u!", ballhead->mode);
195  _hex(into, data-sizeof(BallHeader), (len>128)?128:(len+sizeof(BallHeader)));
196  return 0;
197  }
198 
199  /*
200  if (ballhead->flags & HasMiniBalls) {
201  const MiniBallList* mbl = (const MiniBallList*)data;
202  data += sizeof( MiniBallList );
203  len -= sizeof( MiniBallList );
204 
205  if (mbl->count) {
206  _log( into, " MiniBall Count: %d", mbl->count );
207  for( uint16 r = 0; r < mbl->count; ++r ) {
208  const MiniBall* mini = (const MiniBall*)data;
209  data += sizeof( MiniBall );
210  len -= sizeof( MiniBall );
211  _log( into, " [%d] pos=(%.3f, %.3f, %.3f) radius: %.2f", r, mini->x, mini->y, mini->z, mini->radius );
212  }
213  }
214  }
215  */
216  if (len > init_len) {
217  _log(into, "ERROR: Consumed more bytes than given: had %u, used %u", init_len, len);
218  return init_len;
219  }
220  return init_len - len;
221 }
#define _log(type, fmt,...)
Definition: logsys.h:124
static const uint8 MAX_DSTBALL
#define _hex(type, data, len)
Definition: logsys.h:133
unsigned __int32 uint32
Definition: eve-compat.h:50
std::string GetFlagNames(uint8 flags)
const char *const modeNames[]

Here is the call graph for this function:

Here is the caller graph for this function:

void Destiny::DumpUpdate ( LogType  into,
const uint8 data,
uint32  len 
)

Definition at line 49 of file DestinyBinDump.cpp.

References _log, DumpBall(), Destiny::AddBall_header::packet_type, and Destiny::AddBall_header::stamp.

Referenced by SystemBubble::AddBallExclusive(), DestinyDumpLogText(), SystemManager::MakeSetState(), SystemBubble::SendAddBalls(), SystemBubble::SendAddBalls2(), and SystemManager::SendStaticBall().

49  {
50  const AddBall_header *global_head = (const AddBall_header *) data;
51  _log(into, "AddBall: packet_type: %u, len: %u, stamp: %u ", global_head->packet_type, len, global_head->stamp);
52  data += sizeof(AddBall_header);
53  len -= sizeof(AddBall_header);
54 
55  while(len > 0) {
56  uint32 used = DumpBall(into, data, len);
57  if (used == 0)
58  return; //error
59  data += used;
60  len -= used;
61  }
62 }
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 DumpBall(LogType into, const uint8 *data, uint32 len)
unsigned __int32 uint32
Definition: eve-compat.h:50

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Destiny::GetFlagNames ( uint8  flags)

Definition at line 223 of file DestinyBinDump.cpp.

References Destiny::Ball::Flag::HasMiniBalls, Destiny::Ball::Flag::IsFree, Destiny::Ball::Flag::IsGlobal, Destiny::Ball::Flag::IsInteractive, Destiny::Ball::Flag::IsMassive, and Destiny::Ball::Flag::IsMoribund.

Referenced by DumpBall().

224 {
225  std::string res = "";
226  if (flags & Ball::Flag::IsFree) {
227  res += "IsFree";
228  if (flags > Ball::Flag::IsFree)
229  res += ", ";
230  }
231  if (flags & Ball::Flag::IsGlobal) {
232  res += "IsGlobal";
233  if (flags > Ball::Flag::IsGlobal)
234  res += ", ";
235  }
236  if (flags & Ball::Flag::IsMassive) {
237  res += "IsMassive";
238  if (flags > Ball::Flag::IsMassive)
239  res += ", ";
240  }
241  if (flags & Ball::Flag::IsInteractive) {
242  res += "IsInteractive";
243  if (flags > Ball::Flag::IsInteractive)
244  res += ", ";
245  }
246  if (flags & Ball::Flag::IsMoribund) {
247  res += "IsMoribund";
248  if (flags > Ball::Flag::IsMoribund)
249  res += ", ";
250  }
251  if (flags & Ball::Flag::HasMiniBalls)
252  res += "HasMiniBalls";
253 
254  res += "(";
255  res += std::to_string(flags);
256  res += ")";
257  return res;
258 }

Here is the caller graph for this function:

Variable Documentation

const uint8 Destiny::MAX_DSTBALL = 12
static

Definition at line 32 of file DestinyStructs.h.

Referenced by DumpBall().

const char *const Destiny::modeNames
Initial value:
= {
"GOTO",
"FOLLOW",
"STOP",
"WARP",
"ORBIT",
"MISSILE",
"MUSHROOM",
"BOID",
"TROLL",
"MINIBALL",
"FIELD",
"RIGID",
"FORMATION"
}

Definition at line 33 of file DestinyBinDump.cpp.