@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | 'START_NAME' => $planetrow['name'], |
28 | 28 | ); |
29 | 29 | |
30 | - if(!empty($TargetPlanet)) { |
|
30 | + if (!empty($TargetPlanet)) { |
|
31 | 31 | $template_route += array( |
32 | 32 | 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']], |
33 | 33 | 'END_COORDS' => uni_render_coordinates($TargetPlanet), |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | $template->assign_block_vars('fleets', $template_route); |
39 | 39 | |
40 | 40 | $sn_groups_fleet = sn_get_groups('fleet'); |
41 | - foreach($fleetarray as $ship_id => $ship_count) { |
|
42 | - if(in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
41 | + foreach ($fleetarray as $ship_id => $ship_count) { |
|
42 | + if (in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
43 | 43 | // $ship_base_data = get_ship_data($ship_id, $user); |
44 | 44 | $template->assign_block_vars('fleets.ships', array( |
45 | 45 | 'ID' => $ship_id, |
@@ -57,11 +57,10 @@ discard block |
||
57 | 57 | $fleet_capacity += get_unit_param($Ship, P_CAPACITY) * $Count; |
58 | 58 | } |
59 | 59 | |
60 | - $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : |
|
61 | - (isset($missiontype[MT_HOLD]) ? 12 : 0); |
|
62 | - if($max_duration) { |
|
60 | + $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : (isset($missiontype[MT_HOLD]) ? 12 : 0); |
|
61 | + if ($max_duration) { |
|
63 | 62 | $config_game_speed_expedition = ($target_mission == MT_EXPLORE && $config->game_speed_expedition ? $config->game_speed_expedition : 1); |
64 | - for($i = 1; $i <= $max_duration; $i++) { |
|
63 | + for ($i = 1; $i <= $max_duration; $i++) { |
|
65 | 64 | $template->assign_block_vars('duration', array( |
66 | 65 | 'ID' => $i, |
67 | 66 | 'TIME' => pretty_time(ceil($i * 3600 / $config_game_speed_expedition)), |
@@ -80,7 +79,7 @@ discard block |
||
80 | 79 | // $TableTitle = uni_render_planet_full($planetrow) . ' => ' . uni_render_planet_full($temp); |
81 | 80 | |
82 | 81 | $sn_group_resources = sn_get_groups('resources'); |
83 | - for($i = 0; $i<3; $i++) { |
|
82 | + for ($i = 0; $i < 3; $i++) { |
|
84 | 83 | $amount = $planetrow[$sn_group_resources[$i]] - ($i == 2 ? $consumption : 0); |
85 | 84 | $template->assign_block_vars('resources', array( |
86 | 85 | 'ID' => $i, |
@@ -90,7 +89,7 @@ discard block |
||
90 | 89 | )); |
91 | 90 | } |
92 | 91 | |
93 | - if(is_object($captainModule = moduleCaptain()) && ($captain = $captainModule->unit_captain_get($planetrow['id'])) && $captain['unit_location_type'] == LOC_PLANET) { |
|
92 | + if (is_object($captainModule = moduleCaptain()) && ($captain = $captainModule->unit_captain_get($planetrow['id'])) && $captain['unit_location_type'] == LOC_PLANET) { |
|
94 | 93 | $template->assign_vars(array( |
95 | 94 | 'CAPTAIN_ID' => $captain['unit_id'], |
96 | 95 | 'CAPTAIN_LEVEL' => $captain['captain_level'], |
@@ -112,9 +111,9 @@ discard block |
||
112 | 111 | |
113 | 112 | |
114 | 113 | 'speedallsmin' => sys_get_param_float('speedallsmin'), |
115 | - 'speed' => sys_get_param_int('speed') , |
|
114 | + 'speed' => sys_get_param_int('speed'), |
|
116 | 115 | |
117 | - 'fleet_group' => sys_get_param_id('fleet_group') , |
|
116 | + 'fleet_group' => sys_get_param_id('fleet_group'), |
|
118 | 117 | 'acs_target_mr' => sys_get_param_str('acs_target_mr'), |
119 | 118 | |
120 | 119 | 'MAX_DURATION' => $max_duration, |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $user_row['username'] . ' ' . ( |
96 | 96 | $HomeWorld |
97 | 97 | ? ' ' . $lang['sys_capital'] |
98 | - : ($planet_name_unsafe ? $planet_name_unsafe : $lang['sys_colo_defaultname'] ) |
|
98 | + : ($planet_name_unsafe ? $planet_name_unsafe : $lang['sys_colo_defaultname']) |
|
99 | 99 | ); |
100 | 100 | |
101 | 101 | $planet['name'] = db_escape(strip_tags(trim($planet_name_unsafe))); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | function sys_user_vacation($user) { |
10 | 10 | global $config; |
11 | 11 | |
12 | - if(sys_get_param_str('vacation') == 'leave') { |
|
12 | + if (sys_get_param_str('vacation') == 'leave') { |
|
13 | 13 | if ($user['vacation'] < SN_TIME_NOW) { |
14 | 14 | $user['vacation'] = 0; |
15 | 15 | $user['vacation_next'] = SN_TIME_NOW + $config->player_vacation_timeout; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | - if($user['vacation']) { |
|
20 | + if ($user['vacation']) { |
|
21 | 21 | // sn_sys_logout(false, true); |
22 | 22 | // core_auth::logout(false, true); |
23 | 23 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | \DBAL\DbQuery::build()->setTable('users')->setValues($field_set)->doInsert(); |
142 | 142 | $user_new = db_user_by_id(db_insert_id()); |
143 | 143 | |
144 | - if(!($options['galaxy'] && $options['system'] && $options['planet'])) { |
|
144 | + if (!($options['galaxy'] && $options['system'] && $options['planet'])) { |
|
145 | 145 | $options['galaxy'] = $config->LastSettedGalaxyPos; |
146 | 146 | $options['system'] = $config->LastSettedSystemPos; |
147 | 147 | $segment_size = floor($config->game_maxPlanet / 3); |
@@ -149,19 +149,19 @@ discard block |
||
149 | 149 | $segment++; |
150 | 150 | $options['planet'] = mt_rand(1 + $segment * $segment_size, ($segment + 1) * $segment_size); |
151 | 151 | |
152 | - while(true) { |
|
153 | - if($options['planet'] > $config->game_maxPlanet) { |
|
152 | + while (true) { |
|
153 | + if ($options['planet'] > $config->game_maxPlanet) { |
|
154 | 154 | $options['planet'] = mt_rand(0, $segment_size - 1) + 1; |
155 | 155 | $options['system']++; |
156 | 156 | } |
157 | - if($options['system'] > $config->game_maxSystem) { |
|
157 | + if ($options['system'] > $config->game_maxSystem) { |
|
158 | 158 | $options['system'] = 1; |
159 | 159 | $options['galaxy']++; |
160 | 160 | } |
161 | 161 | $options['galaxy'] > $config->game_maxGalaxy ? $options['galaxy'] = 1 : false; |
162 | 162 | |
163 | 163 | $galaxy_row = DBStaticPlanet::db_planet_by_gspt($options['galaxy'], $options['system'], $options['planet'], PT_PLANET, true, 'id'); |
164 | - if(!$galaxy_row['id']) { |
|
164 | + if (!$galaxy_row['id']) { |
|
165 | 165 | $config->db_saveItem(array( |
166 | 166 | 'LastSettedGalaxyPos' => $options['galaxy'], |
167 | 167 | 'LastSettedSystemPos' => $options['system'], |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $username_safe = db_escape($username_unsafe); |
185 | 185 | doquery("REPLACE INTO {{player_name_history}} SET `player_id` = {$user_new['id']}, `player_name` = '{$username_safe}'"); |
186 | 186 | |
187 | - if(!empty($options['partner_id']) && ($referral_row = db_user_by_id($options['partner_id'], true))) { |
|
187 | + if (!empty($options['partner_id']) && ($referral_row = db_user_by_id($options['partner_id'], true))) { |
|
188 | 188 | doquery("INSERT INTO {{referrals}} SET `id` = {$user_new['id']}, `id_partner` = {$options['partner_id']}"); |
189 | 189 | } |
190 | 190 |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | include_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
4 | 4 | |
5 | -if(SN::$gc->modules->countModulesInGroup('payment') && !defined('SN_GOOGLE')) { |
|
5 | +if (SN::$gc->modules->countModulesInGroup('payment') && !defined('SN_GOOGLE')) { |
|
6 | 6 | sys_redirect('metamatter.php'); |
7 | 7 | } |
8 | 8 |