1 | <?php |
||
2 | |||
3 | /** |
||
4 | * buildings.php |
||
5 | * |
||
6 | * Allow building of... hmm... buildings |
||
7 | * |
||
8 | * @version 1.3s Security checks by Gorlum for http://supernova.ws |
||
9 | * @version 1.3 |
||
10 | // History version |
||
11 | // 1.0 - Nettoyage modularisation |
||
12 | // 1.1 - Mise au point, mise en fonction pour linarisation du fonctionnement |
||
13 | // 1.2 - Liste de construction batiments |
||
14 | * @copyright 2008 by Chlorel for XNova |
||
15 | */ |
||
16 | |||
17 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
||
18 | |||
19 | define('SN_RENDER_NAVBAR_PLANET', true); |
||
20 | |||
21 | $mode = sys_get_param_escaped('mode'); |
||
22 | $mode = (!$mode || $mode == 'buildings') ? QUE_STRUCTURES : ($mode == 'fleet' ? SUBQUE_FLEET : ($mode == 'defense' ? SUBQUE_DEFENSE : ($mode == 'research' ? QUE_RESEARCH : $mode))); |
||
23 | |||
24 | if($building_sort = sys_get_param_id('sort_elements')) { |
||
25 | if(!empty($lang['player_option_building_sort'][$building_sort])) { |
||
26 | SN::$user_options[array(PLAYER_OPTION_BUILDING_SORT, $mode)] = $building_sort; |
||
27 | SN::$user_options[array(PLAYER_OPTION_BUILDING_SORT_INVERSE, $mode)] = sys_get_param_id('sort_elements_inverse', 0); |
||
28 | } |
||
29 | die(); |
||
30 | } |
||
31 | |||
32 | lng_include('buildings'); |
||
33 | lng_include('infos'); |
||
34 | |||
35 | /** @noinspection PhpUnhandledExceptionInspection */ |
||
36 | $planet = SN::$gc->repoV2->getPlanet($planetrow['id']); |
||
37 | $planet->sn_sys_sector_buy('buildings.php?mode=' . $mode); |
||
38 | |||
39 | require_once('includes/includes/eco_bld_structures.php'); |
||
40 | switch ($mode) { |
||
41 | // case UNIT_MERCENARIES: |
||
42 | // require_once('includes/includes/eco_bld_structures.php'); |
||
43 | // eco_build(QUE_MERCENARY, $user, $planetrow); |
||
44 | // break; |
||
45 | |||
46 | case QUE_RESEARCH: |
||
47 | defined("GAME_RESEARCH_DISABLED") && GAME_RESEARCH_DISABLED ? eco_build(SUBQUE_FLEET, $user, $planetrow) : eco_build(QUE_RESEARCH, $user, $planetrow); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
48 | break; |
||
49 | |||
50 | case SUBQUE_DEFENSE: |
||
51 | case SUBQUE_FLEET: |
||
52 | defined("GAME_DEFENSE_DISABLED") && GAME_DEFENSE_DISABLED ? eco_build(SUBQUE_FLEET, $user, $planetrow) : eco_build($mode, $user, $planetrow); |
||
0 ignored issues
–
show
|
|||
53 | break; |
||
54 | |||
55 | case QUE_STRUCTURES: |
||
56 | default: |
||
57 | defined("GAME_STRUCTURES_DISABLED") && GAME_STRUCTURES_DISABLED ? eco_build(SUBQUE_FLEET, $user, $planetrow) : eco_build(QUE_STRUCTURES, $user, $planetrow); |
||
0 ignored issues
–
show
|
|||
58 | break; |
||
59 | } |
||
60 |