EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
EVE_Consts.h
Go to the documentation of this file.
1 /* EVEmu Constants
2  * this file is a common location for all static-type defined data
3  */
4 
5 #ifndef EVE_CONSTANTS_H
6 #define EVE_CONSTANTS_H
7 
8 #include <array>
9 
10 // define default home page for IGB
11 const std::string HomePageURL = "https://evemu.dev/";
12 
13 /*
14  * misc static consts
15  */
16 
17 static const char numList[] = "0123456789";
18 static const char hexList[] = "0123456789ABCDEF";
19 static const char alphaList[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
20 static const char asciiList[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()[]{};:'<>?";
21 
22 /* marshaled Python string "None" */
23 static const uint8 marshaledNone[] = { 0x74, 0x04, 0x00, 0x00, 0x00, 0x4E, 0x6F, 0x6E, 0x65 };
24 
25 static const uint16 SHIP_PROCESS_TICK_MS = 5000; // 5s
26 
27 static const GPoint NULL_ORIGIN(0,0,0); // common place for a zero-value gpoint
28 static const GVector NULL_ORIGIN_V(0,0,0);
29 
31 
32 static const float TIC_DURATION_IN_SECONDS(1000); // not used yet
33 
34 static const uint32 minWarpDistance(130000); // 130km here, client and live defined as 150km
35 
36 static const float onlineModInSpace(0.75); // onling modules while NOT docked or using fitting services will take 75% of capacitor capacity.
37 
38 // based on client code...
39 static const int64 ONE_LIGHTYEAR = 9460000000000000; // in meters
40 static const int64 ONE_AU_IN_METERS = 149597870700; // 1 astronomical unit in meters, per EVElopedia: http://wiki.eveonline.com/en/wiki/Astronomical_Unit
41 static const int64 STATION_HANGAR_MAX_CAPACITY = 9000000000000000; //per client
42 static const double MAX_MARKET_PRICE = 9223372036854; //max int64/1000000 (9223372036854775807/1000000)
43 static const int32 INCAPACITATION_DISTANCE = 250000; // drone to ship max distance. after this, drone goes Offline and is considered 'lost'
44 
45 // Cosmic Managers constants here *not used yet*
46 static const uint32 ASTEROID_GROWTH_INTERVAL_MS = 3600000; /* this is grow check in ms (1d) */
47 
48 // gravitational constant (used for orbit math)
49 static const double Gc = 0.000000000066725985; //per client (changed from original 6.673e-11)
50 static const float SMALL_NUMBER = 0.000000000000001;
51 
52 
53 // verify that NO ONE tries to use "ccp" in their name
54 // also check for mysql commands
55 static const std::array<std::string, 28> badWords {
56  {"ccp",
57  "admin",
58  "fucker",
59  "cunt",
60  "concat",
61  "collate",
62  "select",
63  "drop",
64  "truncate",
65  "count",
66  "char",
67  "load",
68  "ascii",
69  "union",
70  "having",
71  "group",
72  "insert",
73  "cast",
74  "version",
75  "exec ",
76  "benchmark",
77  "create",
78  "md5",
79  "sha1",
80  "encode",
81  "compress",
82  "row_",
83  "bulk"}
84 };
85 // check for common mysql injection hacks
86 // special chars are illegal just because
87 static const std::array<std::string, 18> badChars {
88  {";",
89  "--",
90  "#",
91  "/*",
92  "/0",
93  "0x",
94  "|",
95  "' ",
96  "+",
97  "@",
98  "!",
99  "$",
100  "%",
101  "^",
102  "&",
103  "*",
104  "(",
105  ")"}
106 };
107 
108 static const std::array<std::string, 16> badCharsSearch {
109  {";",
110  "--",
111  "#",
112  "/*",
113  "/0",
114  "0x",
115  "|",
116  "' ",
117  "+",
118  "@",
119  "!",
120  "$",
121  "^",
122  "&",
123  "(",
124  ")"}
125 };
126 #endif // EVE_CONSTANTS_H
127 
128 /* misc data
129  * radius constants
130  * moon = 1737km
131  * mars = 3390km
132  * earth = 6371km
133  * jupiter = 69911km
134  *
135  * gravity constants
136  * moon = 1.622 m/s^2
137  * mars = 3.711 m/s^2
138  * earth = 9.807 m/s^2
139  * jupiter = 24.790 m/s^2
140  */
141 
142 /* ship agility by class
143  * class agility
144  * Capsule .06
145  * Shuttle 1.6
146  * Rookie 5
147  * Frigates 3 - 6 (adv. 3 - 4)
148  * Destroyers 4 - 5
149  * Cruisers 4 - 8
150  * T3 Cruiser 2.4 - 2.8
151  * HAC 5 - 7
152  * Battlecruisers 6 - 9
153  * Battleships 8 - 14
154  * Industrials 8 - 12
155  * Marauder ~12
156  * Orca 40
157  * Freighters ~60
158  * Supercarrier ~60
159  * Command ~9
160  * Transport 5 or 19
161  * Barges 10 - 18
162  * Dreadnought ~55
163  * Zephyr 5
164  */
unsigned __int8 uint8
Definition: eve-compat.h:46
static const uint32 ASTEROID_GROWTH_INTERVAL_MS
Definition: EVE_Consts.h:46
static const uint8 marshaledNone[]
Definition: EVE_Consts.h:23
static const uint32 minWarpDistance(130000)
static const int64 ONE_LIGHTYEAR
Definition: EVE_Consts.h:39
static const char asciiList[]
Definition: EVE_Consts.h:20
static const std::array< std::string, 18 > badChars
Definition: EVE_Consts.h:87
static const int64 STATION_HANGAR_MAX_CAPACITY
Definition: EVE_Consts.h:41
static const int32 INCAPACITATION_DISTANCE
Definition: EVE_Consts.h:43
const int32 ITEM_DB_SAVE_TIMER_EXPIRY(10)
static const uint16 SHIP_PROCESS_TICK_MS
Definition: EVE_Consts.h:25
signed __int32 int32
Definition: eve-compat.h:49
static const char numList[]
Definition: EVE_Consts.h:17
Definition: gpoint.h:33
static const float SMALL_NUMBER
Definition: EVE_Consts.h:50
static const std::array< std::string, 28 > badWords
Definition: EVE_Consts.h:55
static const GPoint NULL_ORIGIN(0, 0, 0)
static const float onlineModInSpace(0.75)
static const char hexList[]
Definition: EVE_Consts.h:18
static const GVector NULL_ORIGIN_V(0, 0, 0)
static const char alphaList[]
Definition: EVE_Consts.h:19
unsigned __int32 uint32
Definition: eve-compat.h:50
signed __int64 int64
Definition: eve-compat.h:51
static const std::array< std::string, 16 > badCharsSearch
Definition: EVE_Consts.h:108
const std::string HomePageURL
Definition: EVE_Consts.h:11
Definition: gpoint.h:70
static const float TIC_DURATION_IN_SECONDS(1000)
static const double Gc
Definition: EVE_Consts.h:49
unsigned __int16 uint16
Definition: eve-compat.h:48
static const int64 ONE_AU_IN_METERS
Definition: EVE_Consts.h:40
static const double MAX_MARKET_PRICE
Definition: EVE_Consts.h:42