|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
class Globals { |
|
4
|
|
|
protected static array $HIDDEN_PLAYERS; |
|
5
|
|
|
protected static array $LEVEL_REQUIREMENTS; |
|
6
|
|
|
protected static array $RACES; |
|
7
|
|
|
protected static array $GOODS; |
|
8
|
|
|
protected static array $HARDWARE_TYPES; |
|
9
|
|
|
protected static bool $FEATURE_REQUEST_OPEN; |
|
10
|
|
|
protected static array $RACE_RELATIONS; |
|
11
|
|
|
protected static array $AVAILABLE_LINKS = []; |
|
12
|
|
|
protected static Smr\Database $db; |
|
13
|
|
|
|
|
14
|
|
|
protected static function initialiseDatabase() : void { |
|
15
|
|
|
if (!isset(self::$db)) { |
|
16
|
|
|
self::$db = Smr\Database::getInstance(); |
|
17
|
|
|
} |
|
18
|
|
|
} |
|
19
|
|
|
|
|
20
|
|
|
public static function getAvailableLinks() : array { |
|
21
|
|
|
return self::$AVAILABLE_LINKS; |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
public static function canAccessPage(string $pageName, AbstractSmrPlayer $player, array $extraInfo) : void { |
|
25
|
|
|
switch ($pageName) { |
|
26
|
|
|
case 'AllianceMOTD': |
|
27
|
|
|
if ($player->getAllianceID() != $extraInfo['AllianceID']) { |
|
28
|
|
|
logException(new Exception('Tried to access page without permission.')); |
|
29
|
|
|
create_error('You cannot access this page.'); |
|
30
|
|
|
} |
|
31
|
|
|
break; |
|
32
|
|
|
} |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public static function getHiddenPlayers() : array { |
|
36
|
|
|
if (!isset(self::$HIDDEN_PLAYERS)) { |
|
37
|
|
|
self::initialiseDatabase(); |
|
38
|
|
|
$dbResult = self::$db->read('SELECT account_id FROM hidden_players'); |
|
39
|
|
|
self::$HIDDEN_PLAYERS = array(0); //stop errors |
|
40
|
|
|
foreach ($dbResult->records() as $dbRecord) { |
|
41
|
|
|
self::$HIDDEN_PLAYERS[] = $dbRecord->getInt('account_id'); |
|
42
|
|
|
} |
|
43
|
|
|
} |
|
44
|
|
|
return self::$HIDDEN_PLAYERS; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public static function getGalacticPostEditorIDs(int $gameID) : array { |
|
48
|
|
|
self::initialiseDatabase(); |
|
49
|
|
|
$editorIDs = []; |
|
50
|
|
|
$dbResult = self::$db->read('SELECT account_id FROM galactic_post_writer WHERE position=\'editor\' AND game_id=' . self::$db->escapeNumber($gameID)); |
|
51
|
|
|
foreach ($dbResult->records() as $dbRecord) { |
|
52
|
|
|
$editorIDs[] = $dbRecord->getInt('account_id'); |
|
53
|
|
|
} |
|
54
|
|
|
return $editorIDs; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public static function getLevelRequirements() : array { |
|
58
|
|
|
if (!isset(self::$LEVEL_REQUIREMENTS)) { |
|
59
|
|
|
self::initialiseDatabase(); |
|
60
|
|
|
self::$LEVEL_REQUIREMENTS = array(); |
|
61
|
|
|
|
|
62
|
|
|
// determine user level |
|
63
|
|
|
$dbResult = self::$db->read('SELECT * FROM level ORDER BY level_id ASC'); |
|
64
|
|
|
foreach ($dbResult->records() as $dbRecord) { |
|
65
|
|
|
self::$LEVEL_REQUIREMENTS[$dbRecord->getInt('level_id')] = array( |
|
66
|
|
|
'Name' => $dbRecord->getField('level_name'), |
|
67
|
|
|
'Requirement' => $dbRecord->getInt('requirement'), |
|
68
|
|
|
); |
|
69
|
|
|
} |
|
70
|
|
|
} |
|
71
|
|
|
return self::$LEVEL_REQUIREMENTS; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
public static function getColouredRaceNameForRace(int $raceID, int $gameID, int $fromRaceID, bool $linked = true) : string { |
|
75
|
|
|
$raceRelations = Globals::getRaceRelations($gameID, $fromRaceID); |
|
76
|
|
|
return self::getColouredRaceName($raceID, $raceRelations[$raceID], $linked); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public static function getColouredRaceName(int $raceID, int $relations, bool $linked = true) : string { |
|
80
|
|
|
$raceName = get_colored_text($relations, Smr\Race::getName($raceID)); |
|
81
|
|
|
if ($linked === true) { |
|
82
|
|
|
$container = Page::create('skeleton.php', 'council_list.php', array('race_id' => $raceID)); |
|
83
|
|
|
$raceName = create_link($container, $raceName); |
|
84
|
|
|
} |
|
85
|
|
|
return $raceName; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public static function getGoods() : array { |
|
89
|
|
|
if (!isset(self::$GOODS)) { |
|
90
|
|
|
self::initialiseDatabase(); |
|
91
|
|
|
self::$GOODS = array(); |
|
92
|
|
|
|
|
93
|
|
|
// determine user level |
|
94
|
|
|
$dbResult = self::$db->read('SELECT * FROM good ORDER BY good_id'); |
|
95
|
|
|
foreach ($dbResult->records() as $dbRecord) { |
|
96
|
|
|
self::$GOODS[$dbRecord->getInt('good_id')] = array( |
|
97
|
|
|
'Type' => 'Good', |
|
98
|
|
|
'ID' => $dbRecord->getInt('good_id'), |
|
99
|
|
|
'Name' => $dbRecord->getField('good_name'), |
|
100
|
|
|
'Max' => $dbRecord->getInt('max_amount'), |
|
101
|
|
|
'BasePrice' => $dbRecord->getInt('base_price'), |
|
102
|
|
|
'Class' => $dbRecord->getInt('good_class'), |
|
103
|
|
|
'ImageLink' => 'images/port/' . $dbRecord->getInt('good_id') . '.png', |
|
104
|
|
|
'AlignRestriction' => $dbRecord->getInt('align_restriction'), |
|
105
|
|
|
); |
|
106
|
|
|
} |
|
107
|
|
|
} |
|
108
|
|
|
return self::$GOODS; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
public static function getGood(int $goodID) : array { |
|
112
|
|
|
return Globals::getGoods()[$goodID]; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
public static function getGoodName(int $goodID) : string { |
|
116
|
|
|
if ($goodID == GOODS_NOTHING) { |
|
117
|
|
|
return 'Nothing'; |
|
118
|
|
|
} |
|
119
|
|
|
return Globals::getGoods()[$goodID]['Name']; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
public static function getHardwareTypes(int $hardwareTypeID = null) : array { |
|
123
|
|
|
if (!isset(self::$HARDWARE_TYPES)) { |
|
124
|
|
|
self::initialiseDatabase(); |
|
125
|
|
|
self::$HARDWARE_TYPES = array(); |
|
126
|
|
|
|
|
127
|
|
|
// determine user level |
|
128
|
|
|
$dbResult = self::$db->read('SELECT * FROM hardware_type ORDER BY hardware_type_id'); |
|
129
|
|
|
foreach ($dbResult->records() as $dbRecord) { |
|
130
|
|
|
self::$HARDWARE_TYPES[$dbRecord->getInt('hardware_type_id')] = array( |
|
131
|
|
|
'Type' => 'Hardware', |
|
132
|
|
|
'ID' => $dbRecord->getInt('hardware_type_id'), |
|
133
|
|
|
'Name' => $dbRecord->getField('hardware_name'), |
|
134
|
|
|
'Cost' => $dbRecord->getInt('cost'), |
|
135
|
|
|
); |
|
136
|
|
|
} |
|
137
|
|
|
} |
|
138
|
|
|
if ($hardwareTypeID === null) { |
|
139
|
|
|
return self::$HARDWARE_TYPES; |
|
140
|
|
|
} |
|
141
|
|
|
return self::$HARDWARE_TYPES[$hardwareTypeID]; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
public static function getHardwareName(int $hardwareTypeID) : string { |
|
145
|
|
|
return Globals::getHardwareTypes()[$hardwareTypeID]['Name']; |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
public static function getHardwareCost(int $hardwareTypeID) : int { |
|
149
|
|
|
return Globals::getHardwareTypes()[$hardwareTypeID]['Cost']; |
|
150
|
|
|
} |
|
151
|
|
|
|
|
152
|
|
|
public static function isValidGame(int $gameID) : bool { |
|
153
|
|
|
try { |
|
154
|
|
|
SmrGame::getGame($gameID); |
|
155
|
|
|
return true; |
|
156
|
|
|
} catch (GameNotFoundException $e) { |
|
157
|
|
|
return false; |
|
158
|
|
|
} |
|
159
|
|
|
} |
|
160
|
|
|
|
|
161
|
|
|
public static function getGameType(int $gameID) : string { |
|
162
|
|
|
return SmrGame::getGame($gameID)->getGameType(); |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
public static function isFeatureRequestOpen() : bool { |
|
166
|
|
|
if (!isset(self::$FEATURE_REQUEST_OPEN)) { |
|
167
|
|
|
self::initialiseDatabase(); |
|
168
|
|
|
$dbResult = self::$db->read('SELECT open FROM open_forms WHERE type=\'FEATURE\''); |
|
169
|
|
|
|
|
170
|
|
|
self::$FEATURE_REQUEST_OPEN = $dbResult->record()->getBoolean('open'); |
|
171
|
|
|
} |
|
172
|
|
|
return self::$FEATURE_REQUEST_OPEN; |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
public static function getRaceRelations(int $gameID, int $raceID) : array { |
|
176
|
|
|
if (!isset(self::$RACE_RELATIONS[$gameID][$raceID])) { |
|
177
|
|
|
self::initialiseDatabase(); |
|
178
|
|
|
//get relations |
|
179
|
|
|
self::$RACE_RELATIONS[$gameID][$raceID] = array(); |
|
180
|
|
|
foreach (Smr\Race::getAllIDs() as $otherRaceID) { |
|
181
|
|
|
self::$RACE_RELATIONS[$gameID][$raceID][$otherRaceID] = 0; |
|
182
|
|
|
} |
|
183
|
|
|
$dbResult = self::$db->read('SELECT race_id_2,relation FROM race_has_relation WHERE race_id_1=' . self::$db->escapeNumber($raceID) . ' AND game_id=' . self::$db->escapeNumber($gameID)); |
|
184
|
|
|
foreach ($dbResult->records() as $dbRecord) { |
|
185
|
|
|
self::$RACE_RELATIONS[$gameID][$raceID][$dbRecord->getInt('race_id_2')] = $dbRecord->getInt('relation'); |
|
186
|
|
|
} |
|
187
|
|
|
} |
|
188
|
|
|
return self::$RACE_RELATIONS[$gameID][$raceID]; |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
public static function getFeatureRequestHREF() : string { |
|
192
|
|
|
return Page::create('skeleton.php', 'feature_request.php')->href(); |
|
193
|
|
|
} |
|
194
|
|
|
|
|
195
|
|
|
public static function getCurrentSectorHREF() : string { |
|
196
|
|
|
return self::$AVAILABLE_LINKS['CurrentSector'] = Page::create('skeleton.php', 'current_sector.php')->href(); |
|
197
|
|
|
} |
|
198
|
|
|
|
|
199
|
|
|
public static function getLocalMapHREF() : string { |
|
200
|
|
|
return self::$AVAILABLE_LINKS['LocalMap'] = Page::create('skeleton.php', 'map_local.php')->href(); |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
public static function getCurrentPlayersHREF() : string { |
|
204
|
|
|
return self::$AVAILABLE_LINKS['CurrentPlayers'] = Page::create('skeleton.php', 'current_players.php')->href(); |
|
205
|
|
|
} |
|
206
|
|
|
|
|
207
|
|
|
public static function getTradeHREF() : string { |
|
208
|
|
|
return self::$AVAILABLE_LINKS['EnterPort'] = Page::create('skeleton.php', 'shop_goods.php')->href(); |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
public static function getAttackTraderHREF(int $accountID) : string { |
|
212
|
|
|
$container = Page::create('trader_attack_processing.php'); |
|
213
|
|
|
$container['target'] = $accountID; |
|
214
|
|
|
return self::$AVAILABLE_LINKS['AttackTrader'] = $container->href(); |
|
215
|
|
|
} |
|
216
|
|
|
|
|
217
|
|
|
public static function getPodScreenHREF() : string { |
|
218
|
|
|
return Page::create('death_processing.php')->href(); |
|
219
|
|
|
} |
|
220
|
|
|
|
|
221
|
|
|
public static function getBetaFunctionsHREF() : string { //BETA |
|
222
|
|
|
return Page::create('skeleton.php', 'beta_functions.php')->href(); |
|
223
|
|
|
} |
|
224
|
|
|
|
|
225
|
|
|
public static function getBugReportProcessingHREF() : string { |
|
226
|
|
|
return Page::create('bug_report_processing.php')->href(); |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
public static function getWeaponReorderHREF(int $weaponOrderID, string $direction) : string { |
|
230
|
|
|
$container = Page::create('weapon_reorder_processing.php'); |
|
231
|
|
|
$container[$direction] = $weaponOrderID; |
|
232
|
|
|
return $container->href(); |
|
233
|
|
|
} |
|
234
|
|
|
|
|
235
|
|
|
public static function getSmrFileCreateHREF(int $adminCreateGameID = null) : string { |
|
236
|
|
|
$container = Page::create('skeleton.php', 'smr_file_create.php'); |
|
237
|
|
|
$container['AdminCreateGameID'] = $adminCreateGameID; |
|
238
|
|
|
return $container->href(); |
|
239
|
|
|
} |
|
240
|
|
|
|
|
241
|
|
|
public static function getCurrentSectorMoveHREF(AbstractSmrPlayer $player, int $toSector) : string { |
|
242
|
|
|
return self::getSectorMoveHREF($player, $toSector, 'current_sector.php'); |
|
243
|
|
|
} |
|
244
|
|
|
|
|
245
|
|
|
public static function getSectorMoveHREF(AbstractSmrPlayer $player, int $toSector, string $targetPage) : string { |
|
246
|
|
|
$container = Page::create('sector_move_processing.php'); |
|
247
|
|
|
$container['target_page'] = $targetPage; |
|
248
|
|
|
$container['target_sector'] = $toSector; |
|
249
|
|
|
return self::$AVAILABLE_LINKS['Move' . $player->getSector()->getSectorDirection($toSector)] = $container->href(); |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
public static function getSectorScanHREF(AbstractSmrPlayer $player, int $toSector) : string { |
|
253
|
|
|
$container = Page::create('skeleton.php', 'sector_scan.php'); |
|
254
|
|
|
$container['target_sector'] = $toSector; |
|
255
|
|
|
return self::$AVAILABLE_LINKS['Scan' . $player->getSector()->getSectorDirection($toSector)] = $container->href(); |
|
256
|
|
|
} |
|
257
|
|
|
|
|
258
|
|
|
public static function getPlotCourseHREF(int $fromSector = null, int $toSector = null) : string { |
|
259
|
|
|
if ($fromSector === null && $toSector === null) { |
|
260
|
|
|
return self::$AVAILABLE_LINKS['PlotCourse'] = Page::create('skeleton.php', 'course_plot.php')->href(); |
|
261
|
|
|
} else { |
|
262
|
|
|
return Page::create('course_plot_processing.php', '', array('from'=>$fromSector, 'to'=>$toSector))->href(); |
|
263
|
|
|
} |
|
264
|
|
|
} |
|
265
|
|
|
|
|
266
|
|
|
public static function getPlanetMainHREF() : string { |
|
267
|
|
|
return Page::create('skeleton.php', 'planet_main.php')->href(); |
|
268
|
|
|
} |
|
269
|
|
|
|
|
270
|
|
|
public static function getPlanetConstructionHREF() : string { |
|
271
|
|
|
return Page::create('skeleton.php', 'planet_construction.php')->href(); |
|
272
|
|
|
} |
|
273
|
|
|
|
|
274
|
|
|
public static function getPlanetDefensesHREF() : string { |
|
275
|
|
|
return Page::create('skeleton.php', 'planet_defense.php')->href(); |
|
276
|
|
|
} |
|
277
|
|
|
|
|
278
|
|
|
public static function getPlanetOwnershipHREF() : string { |
|
279
|
|
|
return Page::create('skeleton.php', 'planet_ownership.php')->href(); |
|
280
|
|
|
} |
|
281
|
|
|
|
|
282
|
|
|
public static function getPlanetStockpileHREF() : string { |
|
283
|
|
|
return Page::create('skeleton.php', 'planet_stockpile.php')->href(); |
|
284
|
|
|
} |
|
285
|
|
|
|
|
286
|
|
|
public static function getPlanetFinancesHREF() : string { |
|
287
|
|
|
return Page::create('skeleton.php', 'planet_financial.php')->href(); |
|
288
|
|
|
} |
|
289
|
|
|
|
|
290
|
|
|
public static function getAllianceHREF(int $allianceID = null) : string { |
|
291
|
|
|
if ($allianceID > 0) { |
|
292
|
|
|
return self::getAllianceMotdHREF($allianceID); |
|
|
|
|
|
|
293
|
|
|
} else { |
|
294
|
|
|
return self::getAllianceListHREF(); |
|
295
|
|
|
} |
|
296
|
|
|
} |
|
297
|
|
|
|
|
298
|
|
|
public static function getAllianceBankHREF(int $allianceID = null) : string { |
|
299
|
|
|
$container = Page::create('skeleton.php', 'bank_alliance.php'); |
|
300
|
|
|
$container['alliance_id'] = $allianceID; |
|
301
|
|
|
return $container->href(); |
|
302
|
|
|
} |
|
303
|
|
|
|
|
304
|
|
|
public static function getAllianceRosterHREF(int $allianceID = null) : string { |
|
305
|
|
|
$container = Page::create('skeleton.php', 'alliance_roster.php'); |
|
306
|
|
|
$container['alliance_id'] = $allianceID; |
|
307
|
|
|
return $container->href(); |
|
308
|
|
|
} |
|
309
|
|
|
|
|
310
|
|
|
public static function getAllianceListHREF() : string { |
|
311
|
|
|
return Page::create('skeleton.php', 'alliance_list.php')->href(); |
|
312
|
|
|
} |
|
313
|
|
|
|
|
314
|
|
|
public static function getAllianceNewsHREF(int $allianceID) : string { |
|
315
|
|
|
return Page::create('skeleton.php', 'news_read_advanced.php', array('allianceID'=>$allianceID, 'submit' => 'Search For Alliance'))->href(); |
|
316
|
|
|
} |
|
317
|
|
|
|
|
318
|
|
|
public static function getAllianceMotdHREF(int $allianceID) : string { |
|
319
|
|
|
return Page::create('skeleton.php', 'alliance_mod.php', array('alliance_id'=>$allianceID))->href(); |
|
320
|
|
|
} |
|
321
|
|
|
|
|
322
|
|
|
public static function getAllianceMessageHREF(int $allianceID) : string { |
|
323
|
|
|
return Page::create('skeleton.php', 'alliance_broadcast.php', array('alliance_id'=>$allianceID))->href(); |
|
324
|
|
|
} |
|
325
|
|
|
|
|
326
|
|
|
public static function getAllianceMessageBoardHREF(int $allianceID) : string { |
|
327
|
|
|
return Page::create('skeleton.php', 'alliance_message.php', array('alliance_id'=>$allianceID))->href(); |
|
328
|
|
|
} |
|
329
|
|
|
|
|
330
|
|
|
public static function getAllianceForcesHREF(int $allianceID) : string { |
|
331
|
|
|
return Page::create('skeleton.php', 'alliance_forces.php', array('alliance_id'=>$allianceID))->href(); |
|
332
|
|
|
} |
|
333
|
|
|
|
|
334
|
|
|
public static function getAllianceOptionsHREF(int $allianceID) : string { |
|
335
|
|
|
return Page::create('skeleton.php', 'alliance_option.php', array('alliance_id'=>$allianceID))->href(); |
|
336
|
|
|
} |
|
337
|
|
|
|
|
338
|
|
|
public static function getPlanetListHREF(int $allianceID) : string { |
|
339
|
|
|
return Page::create('skeleton.php', 'planet_list.php', array('alliance_id'=>$allianceID))->href(); |
|
340
|
|
|
} |
|
341
|
|
|
|
|
342
|
|
|
public static function getPlanetListFinancialHREF(int $allianceID) : string { |
|
343
|
|
|
return Page::create('skeleton.php', 'planet_list_financial.php', array('alliance_id'=>$allianceID))->href(); |
|
344
|
|
|
} |
|
345
|
|
|
|
|
346
|
|
|
public static function getViewMessageBoxesHREF() : string { |
|
347
|
|
|
return Page::create('skeleton.php', 'message_box.php')->href(); |
|
348
|
|
|
} |
|
349
|
|
|
|
|
350
|
|
|
public static function getSendGlobalMessageHREF() : string { |
|
351
|
|
|
return Page::create('skeleton.php', 'message_send.php')->href(); |
|
352
|
|
|
} |
|
353
|
|
|
|
|
354
|
|
|
public static function getManageBlacklistHREF() : string { |
|
355
|
|
|
return Page::create('skeleton.php', 'message_blacklist.php')->href(); |
|
356
|
|
|
} |
|
357
|
|
|
|
|
358
|
|
|
public static function getSendCouncilMessageHREF(int $raceID) : string { |
|
359
|
|
|
$container = Page::create('skeleton.php', 'council_send_message.php'); |
|
360
|
|
|
$container['race_id'] = $raceID; |
|
361
|
|
|
$container['folder_id'] = MSG_POLITICAL; |
|
362
|
|
|
return $container->href(); |
|
363
|
|
|
} |
|
364
|
|
|
|
|
365
|
|
|
public static function getTraderStatusHREF() : string { |
|
366
|
|
|
return Page::create('skeleton.php', 'trader_status.php')->href(); |
|
367
|
|
|
} |
|
368
|
|
|
|
|
369
|
|
|
public static function getCouncilHREF(int $raceID = null) : string { |
|
370
|
|
|
$container = Page::create('skeleton.php', 'council_list.php'); |
|
371
|
|
|
$container['race_id'] = $raceID; |
|
372
|
|
|
return $container->href(); |
|
373
|
|
|
} |
|
374
|
|
|
|
|
375
|
|
|
public static function getTraderRelationsHREF() : string { |
|
376
|
|
|
return Page::create('skeleton.php', 'trader_relations.php')->href(); |
|
377
|
|
|
} |
|
378
|
|
|
|
|
379
|
|
|
public static function getTraderBountiesHREF() : string { |
|
380
|
|
|
return Page::create('skeleton.php', 'trader_bounties.php')->href(); |
|
381
|
|
|
} |
|
382
|
|
|
|
|
383
|
|
|
public static function getPoliticsHREF() : string { |
|
384
|
|
|
return Page::create('skeleton.php', 'council_list.php')->href(); |
|
385
|
|
|
} |
|
386
|
|
|
|
|
387
|
|
|
public static function getCasinoHREF() : string { |
|
388
|
|
|
return Page::create('skeleton.php', 'chess.php')->href(); |
|
389
|
|
|
} |
|
390
|
|
|
|
|
391
|
|
|
public static function getChessHREF() : string { |
|
392
|
|
|
return Page::create('skeleton.php', 'chess.php')->href(); |
|
393
|
|
|
} |
|
394
|
|
|
|
|
395
|
|
|
public static function getChessCreateHREF() : string { |
|
396
|
|
|
return Page::create('chess_create_processing.php')->href(); |
|
397
|
|
|
} |
|
398
|
|
|
|
|
399
|
|
|
public static function getBarMainHREF() : string { |
|
400
|
|
|
$container = Page::create('skeleton.php', 'bar_main.php'); |
|
401
|
|
|
$container->addVar('LocationID'); |
|
402
|
|
|
return $container->href(); |
|
403
|
|
|
} |
|
404
|
|
|
|
|
405
|
|
|
public static function getBarLottoPlayHREF() : string { |
|
406
|
|
|
$container = Page::create('skeleton.php', 'bar_lotto_buy.php'); |
|
407
|
|
|
$container->addVar('LocationID'); |
|
408
|
|
|
return $container->href(); |
|
409
|
|
|
} |
|
410
|
|
|
|
|
411
|
|
|
public static function getBarBlackjackHREF() : string { |
|
412
|
|
|
$container = Page::create('skeleton.php', 'bar_gambling_bet.php'); |
|
413
|
|
|
$container->addVar('LocationID'); |
|
414
|
|
|
return $container->href(); |
|
415
|
|
|
} |
|
416
|
|
|
|
|
417
|
|
|
public static function getBuyMessageNotificationsHREF() : string { |
|
418
|
|
|
return Page::create('skeleton.php', 'buy_message_notifications.php')->href(); |
|
419
|
|
|
} |
|
420
|
|
|
|
|
421
|
|
|
public static function getBuyShipNameHREF() : string { |
|
422
|
|
|
return Page::create('skeleton.php', 'buy_ship_name.php')->href(); |
|
423
|
|
|
} |
|
424
|
|
|
|
|
425
|
|
|
public static function getBuyShipNameCosts() : array { |
|
426
|
|
|
return [ |
|
427
|
|
|
'text' => CREDITS_PER_TEXT_SHIP_NAME, |
|
428
|
|
|
'html' => CREDITS_PER_HTML_SHIP_NAME, |
|
429
|
|
|
'logo' => CREDITS_PER_SHIP_LOGO, |
|
430
|
|
|
]; |
|
431
|
|
|
} |
|
432
|
|
|
|
|
433
|
|
|
public static function getSectorBBLink(int $sectorID) : string { |
|
434
|
|
|
return '[sector=' . $sectorID . ']'; |
|
435
|
|
|
} |
|
436
|
|
|
|
|
437
|
|
|
public static function getAvailableTemplates() : array { |
|
438
|
|
|
return array_keys(CSS_URLS); |
|
439
|
|
|
} |
|
440
|
|
|
|
|
441
|
|
|
public static function getAvailableColourSchemes(string $templateName) : array { |
|
442
|
|
|
return array_keys(CSS_COLOUR_URLS[$templateName]); |
|
443
|
|
|
} |
|
444
|
|
|
|
|
445
|
|
|
/** |
|
446
|
|
|
* Returns an array of history databases for which we have ancient saved |
|
447
|
|
|
* game data. Array keys are database names and values are the columns in |
|
448
|
|
|
* the `account` table with the linked historical account ID's. |
|
449
|
|
|
*/ |
|
450
|
|
|
public static function getHistoryDatabases() : array { |
|
451
|
|
|
if (defined('HISTORY_DATABASES')) { |
|
452
|
|
|
return HISTORY_DATABASES; |
|
|
|
|
|
|
453
|
|
|
} else { |
|
454
|
|
|
return array(); |
|
455
|
|
|
} |
|
456
|
|
|
} |
|
457
|
|
|
|
|
458
|
|
|
} |
|
459
|
|
|
|