Passed
Branch trunk (7dc288)
by SuperNova.WS
06:07
created

buildings.php (3 issues)

Labels
Severity
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
    classSupernova::$user_options[array(PLAYER_OPTION_BUILDING_SORT, $mode)] = $building_sort;
27
    classSupernova::$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
sn_sys_sector_buy('buildings.php?mode=' . $mode);
36
37
require_once('includes/includes/eco_bld_structures.php');
38
switch ($mode) {
39
//  case UNIT_MERCENARIES:
40
//    require_once('includes/includes/eco_bld_structures.php');
41
//    eco_build(QUE_MERCENARY, $user, $planetrow);
42
//  break;
43
44
  case QUE_RESEARCH:
45
    defined("GAME_RESEARCH_DISABLED") && GAME_RESEARCH_DISABLED ? eco_build(SUBQUE_FLEET, $user, $planetrow) : eco_build(QUE_RESEARCH, $user, $planetrow);
0 ignored issues
show
The constant GAME_RESEARCH_DISABLED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
46
  break;
47
48
  case SUBQUE_DEFENSE:
49
  case SUBQUE_FLEET:
50
    defined("GAME_DEFENSE_DISABLED") && GAME_DEFENSE_DISABLED ? eco_build(SUBQUE_FLEET, $user, $planetrow) : eco_build($mode, $user, $planetrow);
0 ignored issues
show
The constant GAME_DEFENSE_DISABLED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
51
  break;
52
53
  case QUE_STRUCTURES:
54
  default:
55
    defined("GAME_STRUCTURES_DISABLED") && GAME_STRUCTURES_DISABLED ? eco_build(SUBQUE_FLEET, $user, $planetrow) : eco_build(QUE_STRUCTURES, $user, $planetrow);
0 ignored issues
show
The constant GAME_STRUCTURES_DISABLED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
56
  break;
57
}
58