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

#include "MapConnections.h"

Static Public Member Functions

static void PopulateConnections ()
 

Detailed Description

Definition at line 16 of file MapConnections.h.

Member Function Documentation

void MapCon::PopulateConnections ( )
static

Definition at line 20 of file MapConnections.cpp.

References Map::Jumptype::Constellation, DBQueryResult::GetRow(), GetTimeMSeconds(), DBResultRow::GetUInt(), Map::Jumptype::Region, sDatabase, sLog, and Map::Jumptype::System.

20  {
21  double starttime = GetTimeMSeconds();
22  sLog.Warning("PopulateConnections()", "Populating mapConnections.");
23  uint16 loops = 14335; //14334
24  uint16 count = 1;
25  uint8 ctype = 3;
26  uint32 fromreg = 0, fromcon = 0, tocon = 0, toreg = 0;
27 
28  DBerror err;
29  DBQueryResult res;
30  DBResultRow row;
31 
32  while ( count < loops ) {
33  sDatabase.RunQuery(res, "SELECT fromreg, fromcon, tocon, toreg FROM mapConnections WHERE AI = %u", count );
34 
35  res.GetRow(row);
36  fromreg = row.GetUInt(0);
37  fromcon = row.GetUInt(1);
38  tocon = row.GetUInt(2);
39  toreg = row.GetUInt(3);
40 
41  if (fromreg != toreg) {
42  ctype = Map::Jumptype::Region;
43  } else if (fromcon != tocon) {
45  } else {
46  ctype = Map::Jumptype::System;
47  }
48 
49  sDatabase.RunQuery(err, "UPDATE mapConnections SET ctype = %u WHERE AI = %u", ctype, count);
50 
51  //res.Reset();
52  ++count;
53  }
54 
55  sLog.Green("PopulateConnections()", "mapConnections Populated in %.3f ms. Please disable this function.", (GetTimeMSeconds() -starttime));
56 }
unsigned __int8 uint8
Definition: eve-compat.h:46
#define sDatabase
Definition: dbcore.h:199
uint32 GetUInt(uint32 index) const
Definition: dbcore.cpp:658
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
double GetTimeMSeconds()
Definition: utils_time.cpp:104
unsigned __int32 uint32
Definition: eve-compat.h:50
unsigned __int16 uint16
Definition: eve-compat.h:48
Definition: dbcore.h:39

Here is the call graph for this function:


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