@@ -14,14 +14,14 @@ |
||
14 | 14 | global $lang, $user, $planetrow; |
15 | 15 | |
16 | 16 | $tech_tree = array(); |
17 | - foreach(get_unit_param('techtree') as $unit_group_id => $unit_list) |
|
17 | + foreach (get_unit_param('techtree') as $unit_group_id => $unit_list) |
|
18 | 18 | { |
19 | 19 | $tech_tree[] = array( |
20 | 20 | 'NAME' => $lang['tech'][$unit_group_id], |
21 | 21 | 'GROUP_ID' => $unit_group_id, |
22 | 22 | ); |
23 | 23 | |
24 | - foreach($unit_list as $unit_id) |
|
24 | + foreach ($unit_list as $unit_id) |
|
25 | 25 | { |
26 | 26 | $sn_data_unit = get_unit_param($unit_id); |
27 | 27 | $level_basic = $sn_data_unit[P_STACKABLE] ? 0 : mrc_get_level($user, $planetrow, $unit_id, false, true); |
@@ -8,8 +8,7 @@ |
||
8 | 8 | |
9 | 9 | classSupernova::$sn_mvc['view']['techtree'][] = 'sn_techtree_view'; |
10 | 10 | |
11 | -function sn_techtree_view($template = null) |
|
12 | -{ |
|
11 | +function sn_techtree_view($template = null) { |
|
13 | 12 | global $user, $planetrow; |
14 | 13 | |
15 | 14 | $tech_tree = array(); |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | |
15 | 15 | $no_data = array('user' => false, 'planet' => false, 'que' => false); |
16 | 16 | |
17 | - if(!$planet) { |
|
17 | + if (!$planet) { |
|
18 | 18 | return $no_data; |
19 | 19 | } |
20 | 20 | |
21 | - if(!$no_user_update) { |
|
21 | + if (!$no_user_update) { |
|
22 | 22 | $user = intval(is_array($user) && $user['id'] ? $user['id'] : $user); |
23 | - if(!$user) { |
|
23 | + if (!$user) { |
|
24 | 24 | // TODO - Убрать позже |
25 | 25 | print('<h1>СООБЩИТЕ ЭТО АДМИНУ: sys_o_get_updated() - USER пустой!</h1>'); |
26 | 26 | $backtrace = debug_backtrace(); |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | $user = db_user_by_id($user, !$simulation, '*', true); |
33 | 33 | } |
34 | 34 | |
35 | - if(empty($user['id'])) { |
|
35 | + if (empty($user['id'])) { |
|
36 | 36 | return $no_data; |
37 | 37 | } |
38 | 38 | |
39 | - if(is_array($planet) && isset($planet['galaxy']) && $planet['galaxy']) { |
|
39 | + if (is_array($planet) && isset($planet['galaxy']) && $planet['galaxy']) { |
|
40 | 40 | $planet = db_planet_by_vector($planet, '', !$simulation); |
41 | 41 | } else { |
42 | 42 | $planet = intval(is_array($planet) && isset($planet['id']) ? $planet['id'] : $planet); |
43 | 43 | $planet = db_planet_by_id($planet, !$simulation); |
44 | 44 | } |
45 | - if(!is_array($planet) || !isset($planet['id'])) { |
|
45 | + if (!is_array($planet) || !isset($planet['id'])) { |
|
46 | 46 | return $no_data; |
47 | 47 | } |
48 | 48 | |
@@ -65,15 +65,15 @@ discard block |
||
65 | 65 | RES_DEUTERIUM => 0, |
66 | 66 | ); |
67 | 67 | |
68 | - switch($planet['planet_type']) { |
|
68 | + switch ($planet['planet_type']) { |
|
69 | 69 | case PT_PLANET: |
70 | - foreach($resources_increase as $resource_id => &$increment) { |
|
70 | + foreach ($resources_increase as $resource_id => &$increment) { |
|
71 | 71 | $resource_name = pname_resource_name($resource_id); |
72 | 72 | $increment = $caps_real['total'][$resource_id] * $ProductionTime / 3600; |
73 | 73 | $store_free = $caps_real['total_storage'][$resource_id] - $planet[$resource_name]; |
74 | 74 | $increment = min($increment, max(0, $store_free)); |
75 | 75 | |
76 | - if($planet[$resource_name] + $increment < 0 && !$simulation) { |
|
76 | + if ($planet[$resource_name] + $increment < 0 && !$simulation) { |
|
77 | 77 | global $debug; |
78 | 78 | $debug->warning("Player ID {$user['id']} have negative resources on ID {$planet['id']}.{$planet['planet_type']} [{$planet['galaxy']}:{$planet['system']}:{$planet['planet']}]. Difference {$planet[$resource_name]} of {$resource_name}", 'Negative Resources', 501); |
79 | 79 | } |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | // TODO пересчитывать размер планеты только при постройке чего-нибудь и при покупке сектора |
96 | 96 | $planet['field_current'] = 0; |
97 | 97 | $sn_group_build_allow = sn_get_groups('build_allow'); |
98 | - if(is_array($sn_group_build_allow[$planet['planet_type']])) { |
|
99 | - foreach($sn_group_build_allow[$planet['planet_type']] as $building_id) { |
|
98 | + if (is_array($sn_group_build_allow[$planet['planet_type']])) { |
|
99 | + foreach ($sn_group_build_allow[$planet['planet_type']] as $building_id) { |
|
100 | 100 | $planet['field_current'] += mrc_get_level($user, $planet, $building_id, !$simulation, true); |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | - if($simulation) { |
|
104 | + if ($simulation) { |
|
105 | 105 | return array('user' => $user, 'planet' => $planet, 'que' => $que); |
106 | 106 | } |
107 | 107 |
@@ -9,6 +9,9 @@ |
||
9 | 9 | * [+] Full rewrote and optimization |
10 | 10 | * |
11 | 11 | */ |
12 | +/** |
|
13 | + * @param integer $UpdateTime |
|
14 | + */ |
|
12 | 15 | function sys_o_get_updated($user, $planet, $UpdateTime, $simulation = false, $no_user_update = false) { |
13 | 16 | sn_db_transaction_check(true); |
14 | 17 |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | function eco_get_planet_caps_modify_production(&$item, $key, $data) { |
4 | 4 | static $modifiers; |
5 | 5 | |
6 | - if(!$modifiers) { |
|
6 | + if (!$modifiers) { |
|
7 | 7 | $modifiers = sn_get_groups('modifiers'); |
8 | 8 | } |
9 | 9 | $item = floor(mrc_modify_value($data['user'], $data['planet'], $modifiers[MODIFIER_RESOURCE_PRODUCTION], $item)); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | static $sn_group_modifiers, $config_resource_multiplier, $config_resource_multiplier_plain, $config_eco_scale_storage; |
17 | 17 | |
18 | - if(!$sn_group_modifiers) { |
|
18 | + if (!$sn_group_modifiers) { |
|
19 | 19 | $sn_group_modifiers = sn_get_groups('modifiers'); |
20 | 20 | $config_resource_multiplier = game_resource_multiplier(); |
21 | 21 | $config_resource_multiplier_plain = game_resource_multiplier(true); |
@@ -26,15 +26,15 @@ discard block |
||
26 | 26 | $caps['storage'][RES_METAL][0] = $config->eco_planet_storage_metal; |
27 | 27 | $caps['storage'][RES_CRYSTAL][0] = $config->eco_planet_storage_crystal; |
28 | 28 | $caps['storage'][RES_DEUTERIUM][0] = $config->eco_planet_storage_deuterium; |
29 | - foreach(sn_get_groups('storages') as $unit_id) { |
|
30 | - foreach(get_unit_param($unit_id, P_STORAGE) as $resource_id => $function) { |
|
29 | + foreach (sn_get_groups('storages') as $unit_id) { |
|
30 | + foreach (get_unit_param($unit_id, P_STORAGE) as $resource_id => $function) { |
|
31 | 31 | $caps['storage'][$resource_id][$unit_id] = floor($config_eco_scale_storage * |
32 | 32 | mrc_modify_value($user, $planet_row, $sn_group_modifiers[MODIFIER_RESOURCE_CAPACITY], $function(mrc_get_level($user, $planet_row, $unit_id))) |
33 | 33 | ); |
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
37 | - if($planet_row['planet_type'] == PT_MOON) { |
|
37 | + if ($planet_row['planet_type'] == PT_MOON) { |
|
38 | 38 | return $caps; |
39 | 39 | } |
40 | 40 | |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | $caps['production_full'][RES_DEUTERIUM][0] = floor($config->deuterium_basic_income * $config_resource_multiplier * (isset($planet_density[RES_DEUTERIUM]) ? $planet_density[RES_DEUTERIUM] : 1)); |
47 | 47 | $caps['production_full'][RES_ENERGY][0] = floor($config->energy_basic_income * $config_resource_multiplier_plain * (isset($planet_density[RES_ENERGY]) ? $planet_density[RES_ENERGY] : 1)); |
48 | 48 | |
49 | - foreach(sn_get_groups('factories') as $unit_id) { |
|
49 | + foreach (sn_get_groups('factories') as $unit_id) { |
|
50 | 50 | $unit_data = get_unit_param($unit_id); |
51 | 51 | $unit_level = mrc_get_level($user, $planet_row, $unit_id); |
52 | 52 | $unit_load = $planet_row[pname_factory_production_field_name($unit_id)]; |
53 | 53 | |
54 | - foreach($unit_data[P_UNIT_PRODUCTION] as $resource_id => $function) { |
|
54 | + foreach ($unit_data[P_UNIT_PRODUCTION] as $resource_id => $function) { |
|
55 | 55 | $caps['production_full'][$resource_id][$unit_id] = $function($unit_level, $unit_load, $user, $planet_row) |
56 | 56 | * ($resource_id == RES_ENERGY ? $config_resource_multiplier_plain : $config_resource_multiplier) |
57 | 57 | * (isset($planet_density[$resource_id]) ? $planet_density[$resource_id] : 1); |
@@ -60,21 +60,21 @@ discard block |
||
60 | 60 | |
61 | 61 | array_walk_recursive($caps['production_full'], 'eco_get_planet_caps_modify_production', array('user' => $user, 'planet' => $planet_row)); |
62 | 62 | |
63 | - foreach($caps['production_full'] as $resource_id => $resource_data) { |
|
63 | + foreach ($caps['production_full'] as $resource_id => $resource_data) { |
|
64 | 64 | $caps['total_production_full'][$resource_id] = array_sum($resource_data); |
65 | 65 | } |
66 | 66 | |
67 | 67 | $caps['production'] = $caps['production_full']; |
68 | 68 | |
69 | - if($caps['production'][RES_ENERGY][STRUC_MINE_FUSION]) { |
|
69 | + if ($caps['production'][RES_ENERGY][STRUC_MINE_FUSION]) { |
|
70 | 70 | $deuterium_balance = array_sum($caps['production'][RES_DEUTERIUM]); |
71 | 71 | $energy_balance = array_sum($caps['production'][RES_ENERGY]); |
72 | - if($deuterium_balance < 0 || $energy_balance < 0) { |
|
72 | + if ($deuterium_balance < 0 || $energy_balance < 0) { |
|
73 | 73 | $caps['production'][RES_DEUTERIUM][STRUC_MINE_FUSION] = $caps['production'][RES_ENERGY][STRUC_MINE_FUSION] = 0; |
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | - foreach($caps['production'][RES_ENERGY] as $energy) { |
|
77 | + foreach ($caps['production'][RES_ENERGY] as $energy) { |
|
78 | 78 | $caps[RES_ENERGY][$energy >= 0 ? BUILD_CREATE : BUILD_DESTROY] += $energy; |
79 | 79 | } |
80 | 80 | |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | ? $caps[RES_ENERGY][BUILD_CREATE] / $caps[RES_ENERGY][BUILD_DESTROY] |
85 | 85 | : 1; |
86 | 86 | |
87 | - foreach($caps['production'] as $resource_id => &$resource_data) { |
|
88 | - if($caps['efficiency'] != 1) { |
|
89 | - foreach($resource_data as $unit_id => &$resource_production) { |
|
90 | - if(!($unit_id == STRUC_MINE_FUSION && $resource_id == RES_DEUTERIUM) && $unit_id != 0 && !($resource_id == RES_ENERGY && $resource_production >= 0)) { |
|
87 | + foreach ($caps['production'] as $resource_id => &$resource_data) { |
|
88 | + if ($caps['efficiency'] != 1) { |
|
89 | + foreach ($resource_data as $unit_id => &$resource_production) { |
|
90 | + if (!($unit_id == STRUC_MINE_FUSION && $resource_id == RES_DEUTERIUM) && $unit_id != 0 && !($resource_id == RES_ENERGY && $resource_production >= 0)) { |
|
91 | 91 | $resource_production = $resource_production * $caps['efficiency']; |
92 | 92 | } |
93 | 93 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $caps['total'][$resource_id] = $caps['total'][$resource_id] >= 0 ? floor($caps['total'][$resource_id]) : ceil($caps['total'][$resource_id]); |
97 | 97 | } |
98 | 98 | |
99 | - foreach($caps['storage'] as $resource_id => &$resource_data) { |
|
99 | + foreach ($caps['storage'] as $resource_id => &$resource_data) { |
|
100 | 100 | $caps['total_storage'][$resource_id] = array_sum($resource_data); |
101 | 101 | } |
102 | 102 |
@@ -2,16 +2,16 @@ |
||
2 | 2 | // Captcha code for registration - really didn't work alot :( |
3 | 3 | |
4 | 4 | session_start(); |
5 | -$en=100; |
|
6 | -$boy=25; |
|
7 | -$sayi = mt_rand(0,9999999); |
|
5 | +$en = 100; |
|
6 | +$boy = 25; |
|
7 | +$sayi = mt_rand(0, 9999999); |
|
8 | 8 | $_SESSION['captcha'] = $sayi; |
9 | -$tuval = imagecreatetruecolor($en,$boy); |
|
10 | -$b = imagecolorallocate($tuval,175,238,238); |
|
11 | -$s = imagecolorallocate($tuval,0,0,0); |
|
12 | -imagefill($tuval,0,0,$s); |
|
13 | -imageline($tuval,20,50,$en,$boy,$b); |
|
14 | -imagestring($tuval,3,27,7,$sayi,$b); |
|
9 | +$tuval = imagecreatetruecolor($en, $boy); |
|
10 | +$b = imagecolorallocate($tuval, 175, 238, 238); |
|
11 | +$s = imagecolorallocate($tuval, 0, 0, 0); |
|
12 | +imagefill($tuval, 0, 0, $s); |
|
13 | +imageline($tuval, 20, 50, $en, $boy, $b); |
|
14 | +imagestring($tuval, 3, 27, 7, $sayi, $b); |
|
15 | 15 | Header("content-type:image/gif"); |
16 | 16 | imagegif($tuval); |
17 | 17 | imagedestroy($tuval); |
@@ -7,8 +7,8 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | 12 | |
13 | 13 | require('common.' . substr(strrchr(__FILE__, '.'), 1)); |
14 | 14 |
@@ -115,8 +115,7 @@ |
||
115 | 115 | )); |
116 | 116 | |
117 | 117 | display($template, $lang['tech'][STRUC_MOON_GATE]); |
118 | - } |
|
119 | - else |
|
118 | + } else |
|
120 | 119 | { |
121 | 120 | message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10); |
122 | 121 | } |
@@ -18,30 +18,30 @@ discard block |
||
18 | 18 | |
19 | 19 | lng_include('fleet'); |
20 | 20 | |
21 | -if($TargetPlanet = sys_get_param_id('jmpto')) |
|
21 | +if ($TargetPlanet = sys_get_param_id('jmpto')) |
|
22 | 22 | { |
23 | 23 | sn_db_transaction_start(); |
24 | 24 | DBStaticUser::db_user_by_id($user['id'], true, 'id'); |
25 | 25 | $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true); |
26 | - if(!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
26 | + if (!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
27 | 27 | { |
28 | 28 | $TargetGate = DBStaticPlanet::db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`'); |
29 | - if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
29 | + if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
30 | 30 | { |
31 | - $NextDestTime = uni_get_time_to_jump ( $TargetGate ); |
|
32 | - if(!$NextDestTime) |
|
31 | + $NextDestTime = uni_get_time_to_jump($TargetGate); |
|
32 | + if (!$NextDestTime) |
|
33 | 33 | { |
34 | 34 | $ship_list = sys_get_param('ships'); |
35 | 35 | $jumpMade = false; |
36 | - foreach($ship_list as $ship_id => $ship_count) |
|
36 | + foreach ($ship_list as $ship_id => $ship_count) |
|
37 | 37 | { |
38 | - if(!in_array($ship_id, classSupernova::$gc->groupFleet)) |
|
38 | + if (!in_array($ship_id, classSupernova::$gc->groupFleet)) |
|
39 | 39 | { |
40 | 40 | continue; |
41 | 41 | } |
42 | 42 | |
43 | 43 | $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id))); |
44 | - if($ship_count) |
|
44 | + if ($ship_count) |
|
45 | 45 | { |
46 | 46 | $jumpMade = true; |
47 | 47 | DBStaticUnit::dbUpdateOrInsertUnit($ship_id, -$ship_count, $user, $planetrow['id']); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - if($jumpMade) |
|
52 | + if ($jumpMade) |
|
53 | 53 | { |
54 | 54 | DBStaticPlanet::db_planet_update_set_by_id( |
55 | 55 | $TargetGate['id'], |
@@ -71,31 +71,31 @@ discard block |
||
71 | 71 | ); |
72 | 72 | |
73 | 73 | $planetrow['last_jump_time'] = SN_TIME_NOW; |
74 | - $RetMessage = classLocale::$lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow)); |
|
74 | + $RetMessage = classLocale::$lang['gate_jump_done'] . " - " . pretty_time(uni_get_time_to_jump($planetrow)); |
|
75 | 75 | } else { |
76 | 76 | $RetMessage = classLocale::$lang['gate_wait_data']; |
77 | 77 | } |
78 | 78 | } else { |
79 | - $RetMessage = classLocale::$lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime); |
|
79 | + $RetMessage = classLocale::$lang['gate_wait_dest'] . " - " . pretty_time($NextDestTime); |
|
80 | 80 | } |
81 | 81 | } else { |
82 | 82 | $RetMessage = classLocale::$lang['gate_no_dest_g']; |
83 | 83 | } |
84 | 84 | } else { |
85 | - $RetMessage = classLocale::$lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime); |
|
85 | + $RetMessage = classLocale::$lang['gate_wait_star'] . " - " . pretty_time($NextJumpTime); |
|
86 | 86 | } |
87 | 87 | sn_db_transaction_commit(); |
88 | 88 | message($RetMessage, classLocale::$lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10); |
89 | 89 | } else { |
90 | 90 | $template = gettemplate('jumpgate', true); |
91 | - if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
91 | + if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
92 | 92 | { |
93 | 93 | $Combo = ''; |
94 | 94 | $MoonList = DBStaticPlanet::db_planet_list_moon_other($user['id'], $planetrow['id']); |
95 | 95 | // while($CurMoon = db_fetch($MoonList)) |
96 | - foreach($MoonList as $CurMoon) |
|
96 | + foreach ($MoonList as $CurMoon) |
|
97 | 97 | { |
98 | - if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
98 | + if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
99 | 99 | { |
100 | 100 | $NextJumpTime = uni_get_time_to_jump($CurMoon); |
101 | 101 | $template->assign_block_vars('moon', array( |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | - foreach(classSupernova::$gc->groupFleet as $Ship) |
|
112 | + foreach (classSupernova::$gc->groupFleet as $Ship) |
|
113 | 113 | { |
114 | - if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
114 | + if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
115 | 115 | { |
116 | 116 | continue; |
117 | 117 | } |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $sym_defender = $unpacked['D']; |
23 | 23 | $sym_attacker = $unpacked['A']; |
24 | -} |
|
25 | -else |
|
24 | +} else |
|
26 | 25 | { |
27 | 26 | $sym_defender = array(0 => $sym_defender); |
28 | 27 | $sym_attacker = array(1 => $sym_attacker); |
@@ -56,8 +55,7 @@ discard block |
||
56 | 55 | $template = gettemplate('ube_combat_report', true); |
57 | 56 | $template->assign_recursive($template_result); |
58 | 57 | display($template, '', false, '', false, false, true); |
59 | -} |
|
60 | -else |
|
58 | +} else |
|
61 | 59 | { |
62 | 60 | $template = gettemplate('simulator', true); |
63 | 61 | $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
4 | 4 | |
5 | -if(sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
5 | +if (sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
6 | 6 | { |
7 | 7 | define('BE_DEBUG', true); |
8 | 8 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $sym_defender = $_POST['defender'] ? $_POST['defender'] : array(); |
15 | 15 | $sym_attacker = $_POST['attacker'] ? $_POST['attacker'] : array(); |
16 | 16 | |
17 | -if($replay) |
|
17 | +if ($replay) |
|
18 | 18 | { |
19 | 19 | $unpacked = sn_ube_simulator_decode_replay($replay); |
20 | 20 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $sym_attacker = array(1 => $sym_attacker); |
28 | 28 | } |
29 | 29 | |
30 | -if($_POST['submit'] || $execute) |
|
30 | +if ($_POST['submit'] || $execute) |
|
31 | 31 | { |
32 | 32 | $replay = sn_ube_simulator_encode_replay($sym_defender, 'D'); |
33 | 33 | $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A'); |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | $template = gettemplate('simulator', true); |
41 | 41 | $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL); |
42 | 42 | |
43 | - foreach($techs_and_officers as $tech_id) |
|
43 | + foreach ($techs_and_officers as $tech_id) |
|
44 | 44 | { |
45 | - if(!$sym_attacker[1][$tech_id]) |
|
45 | + if (!$sym_attacker[1][$tech_id]) |
|
46 | 46 | { |
47 | 47 | $sym_attacker[1][$tech_id] = mrc_get_level($user, false, $tech_id); |
48 | 48 | } |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | UNIT_GOVERNORS => array(MRC_FORTIFIER), |
57 | 57 | UNIT_DEFENCE => sn_get_groups('defense_active'), |
58 | 58 | ); |
59 | - foreach($show_groups as $unit_group_id => $unit_group) |
|
59 | + foreach ($show_groups as $unit_group_id => $unit_group) |
|
60 | 60 | { |
61 | 61 | $template->assign_block_vars('simulator', array( |
62 | 62 | 'GROUP' => $unit_group_id, |
63 | 63 | 'NAME' => $lang['tech'][$unit_group_id], |
64 | 64 | )); |
65 | 65 | |
66 | - foreach($unit_group as $unit_id) |
|
66 | + foreach ($unit_group as $unit_id) |
|
67 | 67 | { |
68 | 68 | $tab++; |
69 | 69 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | include('includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
17 | 17 | // die(); |
18 | -if($template_result[F_USER_IS_AUTHORIZED]) { |
|
18 | +if ($template_result[F_USER_IS_AUTHORIZED]) { |
|
19 | 19 | sys_redirect('index' . DOT_PHP_EX); |
20 | 20 | } |
21 | 21 | lng_include('login'); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $newstock = $stock; |
27 | 27 | $intError = MARKET_DEAL; |
28 | 28 | |
29 | -switch($mode) |
|
29 | +switch ($mode) |
|
30 | 30 | { |
31 | 31 | case MARKET_RESOURCES: // Resource trader |
32 | 32 | require('includes/includes/market_trader.inc'); |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $message_id = sys_get_param_int('message'); |
85 | -if($message_id != MARKET_NOTHING) |
|
85 | +if ($message_id != MARKET_NOTHING) |
|
86 | 86 | { |
87 | 87 | $template->assign_block_vars('result', array('MESSAGE' => $lang['eco_mrk_errors'][$message_id])); |
88 | 88 | } |
89 | 89 | |
90 | -if($message) |
|
90 | +if ($message) |
|
91 | 91 | { |
92 | 92 | $template->assign_block_vars('result', array('MESSAGE' => $message)); |
93 | 93 | } |