EvEmu
0.8.4
11 September 2021
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
MapConnections.cpp
Go to the documentation of this file.
1
/*
2
* File: MapConnections.cpp
3
* Author: Allan
4
* Purpose: This file was created to hold functions specific to the mapConnections DB table.
5
* The table is used to supply map connection data to the client for drawing maps, and is not supplied by CCP.
6
* The functions in this file will gather approprate data from the DB, and populate mapConnections with the data needed.
7
*
8
* Created on June 29, 2014, 12:40
9
* Updated on December 27, 2014, 12:01
10
* Updated/Corrected cType info on July 11, 2015, 13:20
11
* Updated/Corrected cType info *again* on 13 November 2018
12
*/
13
14
#include "
eve-server.h
"
15
#include "
MapConnections.h
"
16
17
#include "../../eve-common/EVE_Map.h"
18
19
20
void
MapCon::PopulateConnections
() {
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) {
44
ctype =
Map::Jumptype::Constellation
;
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
}
uint8
unsigned __int8 uint8
Definition:
eve-compat.h:46
sDatabase
#define sDatabase
Definition:
dbcore.h:199
Map::Jumptype::Region
Definition:
EVE_Map.h:25
DBResultRow::GetUInt
uint32 GetUInt(uint32 index) const
Definition:
dbcore.cpp:658
DBQueryResult::GetRow
bool GetRow(DBResultRow &into)
Definition:
dbcore.cpp:552
Map::Jumptype::System
Definition:
EVE_Map.h:27
sLog
#define sLog
Evaluates to a NewLog instance.
Definition:
LogNew.h:250
GetTimeMSeconds
double GetTimeMSeconds()
Definition:
utils_time.cpp:104
MapConnections.h
uint32
unsigned __int32 uint32
Definition:
eve-compat.h:50
MapCon::PopulateConnections
static void PopulateConnections()
Definition:
MapConnections.cpp:20
DBQueryResult
Definition:
dbcore.h:62
Map::Jumptype::Constellation
Definition:
EVE_Map.h:26
DBResultRow
Definition:
dbcore.h:96
eve-server.h
uint16
unsigned __int16 uint16
Definition:
eve-compat.h:48
DBerror
Definition:
dbcore.h:39
backups
local
src
eve
EvEmu_Crucible
src
eve-server
map
MapConnections.cpp
Generated on Sat Oct 16 2021 01:20:53 for EvEmu by
1.8.8