Completed
Push — work-fleets ( 47cb39...a1ac53 )
by SuperNova.WS
05:19
created
language/en/login.mo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
   'log_lost_send_mail' => 'Send confirmation code',
117 117
   'log_lost_description2' => 'If you have a confirmation code, please enter it below and click "Reset password". An e-mail will be sent an email with a new password<br /><br />
118 118
     If you already asking for confirmation code but can not find email from us in your main folder - check your SPAM folder. Some mail servers can mark our letters as "SPAM"<br /><br />
119
-    If you absolutly sure that did not receive email from us - just write a email to Administration address <span class="ok">' . classSupernova::$config->server_email . '</span>',
119
+    If you absolutly sure that did not receive email from us - just write a email to Administration address <span class="ok">' . classSupernova::$config->server_email.'</span>',
120 120
   'log_lost_reset_pass' => 'Reset password',
121 121
   'log_lost_sent_code' => 'Email sent to this email with further instructions on resetting your password',
122 122
   'log_lost_sent_pass' => 'Just sent to your email message with the new password',
Please login to merge, or discard this patch.
time_probe.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 global $skip_fleet_update;
6 6
 $skip_fleet_update = true;
7 7
 
8
-require_once('common.' . substr(strrchr(__FILE__, '.'), 1));
8
+require_once('common.'.substr(strrchr(__FILE__, '.'), 1));
9 9
 
10 10
 /*
11 11
 $time_local  = $time_server + $time_diff
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
 $time_server = $time_local  - $time_diff
14 14
 */
15 15
 
16
-if($font_size = sys_get_param_str('font_size')) {
17
-  if(strpos($font_size, '%') !== false) {
16
+if ($font_size = sys_get_param_str('font_size')) {
17
+  if (strpos($font_size, '%') !== false) {
18 18
     // Размер шрифта в процентах
19
-    $font_size = min(max(floatval($font_size), FONT_SIZE_PERCENT_MIN), FONT_SIZE_PERCENT_MAX) . '%';
20
-  } elseif(strpos($font_size, 'px') !== false) {
19
+    $font_size = min(max(floatval($font_size), FONT_SIZE_PERCENT_MIN), FONT_SIZE_PERCENT_MAX).'%';
20
+  } elseif (strpos($font_size, 'px') !== false) {
21 21
     // Размер шрифта в пикселях
22
-    $font_size = min(max(floatval($font_size), FONT_SIZE_PIXELS_MIN), FONT_SIZE_PIXELS_MAX) . 'px';
22
+    $font_size = min(max(floatval($font_size), FONT_SIZE_PIXELS_MIN), FONT_SIZE_PIXELS_MAX).'px';
23 23
   } else {
24 24
     // Не мышонка, не лягушка...
25 25
     $font_size = FONT_SIZE_PERCENT_DEFAULT_STRING;
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
   classSupernova::$user_options[PLAYER_OPTION_BASE_FONT_SIZE] = $font_size;
30 30
 } else {
31 31
   $user_time_diff = playerTimeDiff::user_time_diff_get();
32
-  if($user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) {
32
+  if ($user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) {
33 33
     $time_diff = intval($user_time_diff[PLAYER_OPTION_TIME_DIFF]);
34 34
   } else {
35 35
     $user_time_diff = playerTimeDiff::user_time_diff_probe();
Please login to merge, or discard this patch.
includes/pages/options.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
   $language_new = sys_get_param_str('langer', $user['lang']);
14 14
 
15
-  if($language_new != $user['lang']) {
15
+  if ($language_new != $user['lang']) {
16 16
     classLocale::$lang->lng_switch($language_new);
17 17
   }
18 18
 
@@ -21,41 +21,41 @@  discard block
 block discarded – undo
21 21
 
22 22
   $FMT_DATE = preg_replace(array('/d/', '/m/', '/Y/'), array('DD', 'MM', 'YYYY'), FMT_DATE);
23 23
 
24
-  if(sys_get_param_str('mode') == 'change') {
25
-    if($user['authlevel'] > 0) {
24
+  if (sys_get_param_str('mode') == 'change') {
25
+    if ($user['authlevel'] > 0) {
26 26
       $planet_protection = sys_get_param_int('adm_pl_prot') ? $user['authlevel'] : 0;
27 27
       db_planet_set_by_owner($user['id'], "`id_level` = '{$planet_protection}'");
28 28
       db_user_set_by_id($user['id'], "`admin_protection` = '{$planet_protection}'");
29 29
       $user['admin_protection'] = $planet_protection;
30 30
     }
31 31
 
32
-    if(sys_get_param_int('vacation') && !classSupernova::$config->user_vacation_disable) {
32
+    if (sys_get_param_int('vacation') && !classSupernova::$config->user_vacation_disable) {
33 33
       sn_db_transaction_start();
34
-      if($user['authlevel'] < 3) {
35
-        if($user['vacation_next'] > SN_TIME_NOW) {
34
+      if ($user['authlevel'] < 3) {
35
+        if ($user['vacation_next'] > SN_TIME_NOW) {
36 36
           message(classLocale::$lang['opt_vacation_err_timeout'], classLocale::$lang['Error'], 'index.php?page=options', 5);
37 37
           die();
38 38
         }
39 39
 
40
-        if(FleetList::fleet_count_flying($user['id'])) {
40
+        if (FleetList::fleet_count_flying($user['id'])) {
41 41
           message(classLocale::$lang['opt_vacation_err_your_fleet'], classLocale::$lang['Error'], 'index.php?page=options', 5);
42 42
           die();
43 43
         }
44 44
 
45 45
         $que = que_get($user['id'], false);
46
-        if(!empty($que)) {
46
+        if (!empty($que)) {
47 47
           message(classLocale::$lang['opt_vacation_err_que'], classLocale::$lang['Error'], 'index.php?page=options', 5);
48 48
           die();
49 49
         }
50 50
 
51 51
         $query = classSupernova::db_get_record_list(LOC_PLANET, "`id_owner` = {$user['id']}");
52
-        foreach($query as $planet) {
52
+        foreach ($query as $planet) {
53 53
           // $planet = sys_o_get_updated($user, $planet, SN_TIME_NOW);
54 54
           // $planet = $planet['planet'];
55 55
 
56 56
           $classConfig = classSupernova::$config;
57 57
           db_planet_set_by_id($planet['id'],
58
-            "last_update = " . SN_TIME_NOW . ", energy_used = '0', energy_max = '0',
58
+            "last_update = ".SN_TIME_NOW.", energy_used = '0', energy_max = '0',
59 59
             metal_perhour = '{$classConfig->metal_basic_income}', crystal_perhour = '{$classConfig->crystal_basic_income}', deuterium_perhour = '{$classConfig->deuterium_basic_income}',
60 60
             metal_mine_porcent = '0', crystal_mine_porcent = '0', deuterium_sintetizer_porcent = '0', solar_plant_porcent = '0',
61 61
             fusion_plant_porcent = '0', solar_satelit_porcent = '0', ship_sattelite_sloth_porcent = 0"
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
       sn_db_transaction_commit();
69 69
     }
70 70
 
71
-    foreach($user_option_list as $option_group_id => $option_group) {
72
-      foreach($option_group as $option_name => $option_value) {
73
-        if($user[$option_name] !== null) {
71
+    foreach ($user_option_list as $option_group_id => $option_group) {
72
+      foreach ($option_group as $option_name => $option_value) {
73
+        if ($user[$option_name] !== null) {
74 74
           $user[$option_name] = sys_get_param_str($option_name);
75 75
         } else {
76 76
           $user[$option_name] = $option_value;
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 
82 82
 
83 83
     $player_options = sys_get_param('options');
84
-    if(!empty($player_options)) {
85
-      array_walk($player_options, function (&$value) {
84
+    if (!empty($player_options)) {
85
+      array_walk($player_options, function(&$value) {
86 86
         // TODO - Когда будет больше параметров - сделать больше проверок
87 87
         $value = intval($value);
88 88
       });
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 
94 94
     $username = substr(sys_get_param_str_unsafe('username'), 0, 32);
95 95
     $username_safe = db_escape($username);
96
-    if($username && $user['username'] != $username && classSupernova::$config->game_user_changename != SERVER_PLAYER_NAME_CHANGE_NONE && sys_get_param_int('username_confirm') && !strpbrk($username, LOGIN_REGISTER_CHARACTERS_PROHIBITED)) {
96
+    if ($username && $user['username'] != $username && classSupernova::$config->game_user_changename != SERVER_PLAYER_NAME_CHANGE_NONE && sys_get_param_int('username_confirm') && !strpbrk($username, LOGIN_REGISTER_CHARACTERS_PROHIBITED)) {
97 97
       // проверка на корректность
98 98
       sn_db_transaction_start();
99 99
       $name_check = db_player_name_history_get_name_by_name($username_safe);
100
-      if(!$name_check || $name_check['player_id'] == $user['id']) {
100
+      if (!$name_check || $name_check['player_id'] == $user['id']) {
101 101
         $user = db_user_by_id($user['id'], true);
102
-        switch(classSupernova::$config->game_user_changename) {
102
+        switch (classSupernova::$config->game_user_changename) {
103 103
           case SERVER_PLAYER_NAME_CHANGE_PAY:
104
-            if(mrc_get_level($user, $planetrow, RES_DARK_MATTER) < classSupernova::$config->game_user_changename_cost) {
104
+            if (mrc_get_level($user, $planetrow, RES_DARK_MATTER) < classSupernova::$config->game_user_changename_cost) {
105 105
               $template_result['.']['result'][] = array(
106 106
                 'STATUS'  => ERR_ERROR,
107 107
                 'MESSAGE' => classLocale::$lang['opt_msg_name_change_err_no_dm'],
@@ -131,18 +131,18 @@  discard block
 block discarded – undo
131 131
       sn_db_transaction_commit();
132 132
     }
133 133
 
134
-    if($new_password = sys_get_param('newpass1')) {
134
+    if ($new_password = sys_get_param('newpass1')) {
135 135
       try {
136
-        if($new_password != sys_get_param('newpass2')) {
136
+        if ($new_password != sys_get_param('newpass2')) {
137 137
           throw new Exception(classLocale::$lang['opt_err_pass_unmatched'], ERR_WARNING);
138 138
         }
139 139
 
140
-        if(!classSupernova::$auth->password_change(sys_get_param('db_password'), $new_password)) {
140
+        if (!classSupernova::$auth->password_change(sys_get_param('db_password'), $new_password)) {
141 141
           throw new Exception(classLocale::$lang['opt_err_pass_wrong'], ERR_WARNING);
142 142
         }
143 143
 
144 144
         throw new Exception(classLocale::$lang['opt_msg_pass_changed'], ERR_NONE);
145
-      } catch(Exception $e) {
145
+      } catch (Exception $e) {
146 146
         $template_result['.']['result'][] = array(
147 147
           'STATUS'  => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR,
148 148
           'MESSAGE' => $e->getMessage()
@@ -164,12 +164,12 @@  discard block
 block discarded – undo
164 164
     $user['gender'] = $user['gender'] == GENDER_UNKNOWN ? $gender : $user['gender'];
165 165
 
166 166
     try {
167
-      if($user['birthday']) {
167
+      if ($user['birthday']) {
168 168
         throw new exception();
169 169
       }
170 170
 
171 171
       $user_birthday = sys_get_param_str_unsafe('user_birthday');
172
-      if(!$user_birthday || $user_birthday == $FMT_DATE) {
172
+      if (!$user_birthday || $user_birthday == $FMT_DATE) {
173 173
         throw new exception();
174 174
       }
175 175
 
@@ -179,16 +179,16 @@  discard block
 block discarded – undo
179 179
       $pos['Y'] = strpos(FMT_DATE, 'Y');
180 180
       asort($pos);
181 181
       $i = 0;
182
-      foreach($pos as &$position) {
182
+      foreach ($pos as &$position) {
183 183
         $position = ++$i;
184 184
       }
185 185
 
186
-      $regexp = "/" . preg_replace(array('/\\\\/', '/\//', '/\./', '/\-/', '/d/', '/m/', '/Y/'), array('\\\\\\', '\/', '\.', '\-', '(\d?\d)', '(\d?\d)', '(\d{4})'), FMT_DATE) . "/";
187
-      if(!preg_match($regexp, $user_birthday, $match)) {
186
+      $regexp = "/".preg_replace(array('/\\\\/', '/\//', '/\./', '/\-/', '/d/', '/m/', '/Y/'), array('\\\\\\', '\/', '\.', '\-', '(\d?\d)', '(\d?\d)', '(\d{4})'), FMT_DATE)."/";
187
+      if (!preg_match($regexp, $user_birthday, $match)) {
188 188
         throw new exception();
189 189
       }
190 190
 
191
-      if(!checkdate($match[$pos['m']], $match[$pos['d']], $match[$pos['Y']])) {
191
+      if (!checkdate($match[$pos['m']], $match[$pos['d']], $match[$pos['Y']])) {
192 192
         throw new exception();
193 193
       }
194 194
 
@@ -196,13 +196,13 @@  discard block
 block discarded – undo
196 196
       // EOF black magic! Now we have valid SQL date in $user['user_birthday'] - independent of date format
197 197
 
198 198
       $year = date('Y', SN_TIME_NOW);
199
-      if(mktime(0, 0, 0, $match[$pos['m']], $match[$pos['d']], $year) > SN_TIME_NOW) {
199
+      if (mktime(0, 0, 0, $match[$pos['m']], $match[$pos['d']], $year) > SN_TIME_NOW) {
200 200
         $year--;
201 201
       }
202 202
       $user['user_birthday_celebrated'] = db_escape("{$year}-{$match[$pos['m']]}-{$match[$pos['d']]}");
203 203
 
204 204
       $user_birthday = ", `user_birthday` = '{$user['user_birthday']}', `user_birthday_celebrated` = '{$user['user_birthday_celebrated']}'";
205
-    } catch(exception $e) {
205
+    } catch (exception $e) {
206 206
       $user_birthday = '';
207 207
     }
208 208
 
@@ -212,14 +212,14 @@  discard block
 block discarded – undo
212 212
     $template_result['.']['result'][] = $avatar_upload_result;
213 213
 
214 214
     $user_time_diff = playerTimeDiff::user_time_diff_get();
215
-    if(sys_get_param_int('PLAYER_OPTION_TIME_DIFF_FORCED')) {
215
+    if (sys_get_param_int('PLAYER_OPTION_TIME_DIFF_FORCED')) {
216 216
       playerTimeDiff::user_time_diff_set(array(
217 217
         PLAYER_OPTION_TIME_DIFF              => sys_get_param_int('PLAYER_OPTION_TIME_DIFF'),
218 218
         PLAYER_OPTION_TIME_DIFF_UTC_OFFSET   => 0,
219 219
         PLAYER_OPTION_TIME_DIFF_FORCED       => 1,
220 220
         PLAYER_OPTION_TIME_DIFF_MEASURE_TIME => SN_TIME_SQL,
221 221
       ));
222
-    } elseif(sys_get_param_int('opt_time_diff_clear') || $user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) {
222
+    } elseif (sys_get_param_int('opt_time_diff_clear') || $user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) {
223 223
       playerTimeDiff::user_time_diff_set(array(
224 224
         PLAYER_OPTION_TIME_DIFF              => '',
225 225
         PLAYER_OPTION_TIME_DIFF_UTC_OFFSET   => 0,
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
       'STATUS'  => ERR_NONE,
240 240
       'MESSAGE' => classLocale::$lang['opt_msg_saved']
241 241
     );
242
-  } elseif(sys_get_param_str('result') == 'ok') {
242
+  } elseif (sys_get_param_str('result') == 'ok') {
243 243
     $template_result['.']['result'][] = array(
244 244
       'STATUS'  => ERR_NONE,
245 245
       'MESSAGE' => classLocale::$lang['opt_msg_saved']
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
 
263 263
   $template = gettemplate('options', $template);
264 264
 
265
-  $dir = dir(SN_ROOT_PHYSICAL . 'skins');
266
-  while(($entry = $dir->read()) !== false) {
267
-    if(is_dir("skins/{$entry}") && $entry[0] != '.') {
265
+  $dir = dir(SN_ROOT_PHYSICAL.'skins');
266
+  while (($entry = $dir->read()) !== false) {
267
+    if (is_dir("skins/{$entry}") && $entry[0] != '.') {
268 268
       $template_result['.']['skin_list'][] = array(
269 269
         'VALUE'    => $entry,
270 270
         'NAME'     => $entry,
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
   }
275 275
   $dir->close();
276 276
 
277
-  foreach(classLocale::$lang['opt_planet_sort_options'] as $key => &$value) {
277
+  foreach (classLocale::$lang['opt_planet_sort_options'] as $key => &$value) {
278 278
     $template_result['.']['planet_sort_options'][] = array(
279 279
       'VALUE'    => $key,
280 280
       'NAME'     => $value,
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     );
283 283
   }
284 284
 
285
-  foreach(classLocale::$lang['sys_gender_list'] as $key => $value) {
285
+  foreach (classLocale::$lang['sys_gender_list'] as $key => $value) {
286 286
     $template_result['.']['gender_list'][] = array(
287 287
       'VALUE'    => $key,
288 288
       'NAME'     => $value,
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
   }
292 292
 
293 293
   $lang_list = lng_get_list();
294
-  foreach($lang_list as $lang_id => $lang_data) {
294
+  foreach ($lang_list as $lang_id => $lang_data) {
295 295
     $template_result['.']['languages'][] = array(
296 296
       'VALUE'    => $lang_id,
297 297
       'NAME'     => $lang_data['LANG_NAME_NATIVE'],
@@ -300,8 +300,8 @@  discard block
 block discarded – undo
300 300
   }
301 301
 
302 302
 
303
-  if(isset(classLocale::$lang['menu_customize_show_hide_button_state'])) {
304
-    foreach(classLocale::$lang['menu_customize_show_hide_button_state'] as $key => $value) {
303
+  if (isset(classLocale::$lang['menu_customize_show_hide_button_state'])) {
304
+    foreach (classLocale::$lang['menu_customize_show_hide_button_state'] as $key => $value) {
305 305
       $template->assign_block_vars('menu_customize_show_hide_button_state', array(
306 306
         'ID'   => $key,
307 307
         'NAME' => $value,
@@ -408,10 +408,10 @@  discard block
 block discarded – undo
408 408
     'PAGE_HEADER' => classLocale::$lang['opt_header'],
409 409
   ));
410 410
 
411
-  foreach($user_option_list as $option_group_id => $option_group) {
412
-    if($option_group_id == OPT_MESSAGE) {
413
-      foreach($sn_message_class_list as $message_class_id => $message_class_data) {
414
-        if($message_class_data['switchable'] || ($message_class_data['email'] && classSupernova::$config->game_email_pm)) {
411
+  foreach ($user_option_list as $option_group_id => $option_group) {
412
+    if ($option_group_id == OPT_MESSAGE) {
413
+      foreach ($sn_message_class_list as $message_class_id => $message_class_data) {
414
+        if ($message_class_data['switchable'] || ($message_class_data['email'] && classSupernova::$config->game_email_pm)) {
415 415
           $option_name = $message_class_data['name'];
416 416
 
417 417
           $template->assign_block_vars("options_{$option_group_id}", array(
@@ -423,8 +423,8 @@  discard block
 block discarded – undo
423 423
         }
424 424
       }
425 425
     } else {
426
-      foreach($option_group as $option_name => $option_value) {
427
-        if(array_key_exists($option_name, $user_option_types)) {
426
+      foreach ($option_group as $option_name => $option_value) {
427
+        if (array_key_exists($option_name, $user_option_types)) {
428 428
           $option_type = $user_option_types[$option_name];
429 429
         } else {
430 430
           $option_type = 'switch';
Please login to merge, or discard this patch.
includes/pages/imperium.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
   $sn_group_factories = sn_get_groups('factories');
23 23
   $planet_density = sn_get_groups('planet_density');
24 24
 
25
-  if(sys_get_param('save_production')) {
25
+  if (sys_get_param('save_production')) {
26 26
     $production = sys_get_param('percent');
27
-    if(is_array($production) && !empty($production)) {
27
+    if (is_array($production) && !empty($production)) {
28 28
       // sn_db_transaction_start();
29 29
       $query = array();
30 30
       $planet_row_list = db_planet_list_sorted($user, false, '*');
31 31
       // while($planet = db_fetch($planet_row_list))
32
-      foreach($planet_row_list as $planet) {
33
-        foreach($sn_group_factories as $factory_unit_id) {
32
+      foreach ($planet_row_list as $planet) {
33
+        foreach ($sn_group_factories as $factory_unit_id) {
34 34
           $unit_db_name_porcent = pname_factory_production_field_name($factory_unit_id);
35
-          if(
35
+          if (
36 36
             get_unit_param($factory_unit_id, P_MINING_IS_MANAGED)
37 37
             && isset($production[$factory_unit_id][$planet['id']])
38 38
             && ($actual_porcent = intval($production[$factory_unit_id][$planet['id']] / 10)) >= 0
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
           }
44 44
         }
45 45
       }
46
-      foreach($query as $planet_id => $query_data) {
46
+      foreach ($query as $planet_id => $query_data) {
47 47
         db_planet_set_by_id($planet_id, implode(',', $query_data));
48 48
       }
49 49
       // sn_db_transaction_commit();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
   $planet_row_list = db_planet_list_sorted($user);
54 54
   // while ($planet = db_fetch($planet_row_list))
55
-  foreach($planet_row_list as $planet) {
55
+  foreach ($planet_row_list as $planet) {
56 56
     sn_db_transaction_start();
57 57
     $global_data = sys_o_get_updated($user, $planet['id'], SN_TIME_NOW, false, true);
58 58
     $planets[$planet['id']] = $global_data['planet'];
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
   $template = gettemplate('imperium', $template);
65 65
   $template->assign_var('amount', count($planets) + 2);
66 66
 
67
-  for($i = 100; $i >= 0; $i -= 10) {
67
+  for ($i = 100; $i >= 0; $i -= 10) {
68 68
     $template->assign_block_vars('percent', array('PERCENT' => $i));
69 69
   }
70 70
 
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
   $total['temp_min'] = 1000;
75 75
   $total['temp_max'] = -999;
76 76
 
77
-  foreach($planets as $planet_index => &$planet) {
77
+  foreach ($planets as $planet_index => &$planet) {
78 78
     $list_planet_que = $ques[$planet_index];
79 79
     $planet_template = tpl_parse_planet($planet);
80 80
 
81 81
     $planet_fleet_id = 0;
82
-    $fleet_list = $planet_template['fleet_list'];//flt_get_fleets_to_planet($planet);
83
-    if($fleet_list['own']['count']) {
82
+    $fleet_list = $planet_template['fleet_list']; //flt_get_fleets_to_planet($planet);
83
+    if ($fleet_list['own']['count']) {
84 84
       $planet_fleet_id = "p{$fleet_id}";
85 85
       $fleets[] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id);
86 86
       $fleet_id++;
@@ -141,17 +141,17 @@  discard block
 block discarded – undo
141 141
     UNIT_DEFENCE            => 'defense',
142 142
   );
143 143
 
144
-  foreach($show_groups as $unit_group_id => $mode) {
144
+  foreach ($show_groups as $unit_group_id => $mode) {
145 145
     $template->assign_block_vars('prods', array(
146 146
       'NAME' => classLocale::$lang['tech'][$unit_group_id],
147 147
     ));
148 148
     $unit_group = get_unit_param('techtree', $unit_group_id);
149
-    foreach($unit_group as $unit_id) {
149
+    foreach ($unit_group as $unit_id) {
150 150
       $unit_count = $unit_count_abs = 0;
151 151
       $block_vars = array();
152 152
       $unit_is_factory = in_array($unit_id, $sn_group_factories) && get_unit_param($unit_id, P_MINING_IS_MANAGED);
153 153
       // $unit_db_name = pname_resource_name($unit_id);
154
-      foreach($planets as $planet) {
154
+      foreach ($planets as $planet) {
155 155
         $unit_level_plain = mrc_get_level($user, $planet, $unit_id, false, true);
156 156
 
157 157
         $level_plus['FACTORY'] = $unit_is_factory;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $level_plus['LEVEL_PLUS_GREEN'] = 0;
160 160
 
161 161
         $level_plus['PERCENT'] = $unit_is_factory ? ($unit_level_plain ? $planet[pname_factory_production_field_name($unit_id)] * 10 : -1) : -1;
162
-        switch($mode) {
162
+        switch ($mode) {
163 163
           /*
164 164
           case 'structures':
165 165
             $level_plus_build = $ques[$planet['id']]['in_que'][que_get_unit_que($unit_id)][$user['id']][$planet['id']][$unit_id];
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
           case 'structures':
180 180
           case 'defense':
181 181
             $level_plus_build = $ques[$planet['id']]['in_que'][que_get_unit_que($unit_id)][$user['id']][$planet['id']][$unit_id];
182
-            if($level_plus_build) {
182
+            if ($level_plus_build) {
183 183
               $level_plus['LEVEL_PLUS_GREEN'] = $level_plus_build < 0 ? $level_plus_build : "+{$level_plus_build}";
184 184
               // $level_plus['LEVEL_PLUS_GREEN'] = "+{$level_plus_build}";
185 185
               $total['units'][$unit_id]['LEVEL_PLUS_GREEN'] += $level_plus['LEVEL_PLUS_GREEN'];
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
         $unit_count_abs += $unit_level_plain + abs($level_plus['LEVEL_PLUS_YELLOW']) + abs($level_plus['LEVEL_PLUS_GREEN']);
200 200
       }
201 201
 
202
-      if($unit_count_abs) {
202
+      if ($unit_count_abs) {
203 203
         $template->assign_block_vars('prods', array(
204 204
           'ID'    => $unit_id,
205
-          'FIELD' => 'unit_' . $unit_id, // pname_resource_name($unit_id), // TODO Делать это прямо в темплейте
205
+          'FIELD' => 'unit_'.$unit_id, // pname_resource_name($unit_id), // TODO Делать это прямо в темплейте
206 206
           'NAME'  => classLocale::$lang['tech'][$unit_id],
207 207
           'MODE'  => $mode,
208 208
         ));
209 209
 
210
-        foreach($block_vars as $block_var) {
210
+        foreach ($block_vars as $block_var) {
211 211
           $template->assign_block_vars('prods.planet', $block_var);
212 212
         }
213 213
         $unit_green = $total['units'][$unit_id]['LEVEL_PLUS_GREEN'];
Please login to merge, or discard this patch.
includes/constants.php 1 patch
Spacing   +238 added lines, -238 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Game type constants starts with GAME_
40 40
 define('GAME_SUPERNOVA', 0);
41
-define('GAME_OGAME'    , 1);
42
-define('GAME_BLITZ'    , 2);
41
+define('GAME_OGAME', 1);
42
+define('GAME_BLITZ', 2);
43 43
 
44 44
 // Date & time range constants
45 45
 define('DATE_FOREVER', 2000000000);
@@ -52,27 +52,27 @@  discard block
 block discarded – undo
52 52
 define('PERIOD_YEAR', PERIOD_DAY * 365);
53 53
 define('PERIOD_FOREVER', PERIOD_YEAR * 100);
54 54
 
55
-define('PERIOD_MINUTE_2' , PERIOD_MINUTE * 2);
56
-define('PERIOD_MINUTE_3' , PERIOD_MINUTE * 3);
57
-define('PERIOD_MINUTE_5' , PERIOD_MINUTE * 5);
55
+define('PERIOD_MINUTE_2', PERIOD_MINUTE * 2);
56
+define('PERIOD_MINUTE_3', PERIOD_MINUTE * 3);
57
+define('PERIOD_MINUTE_5', PERIOD_MINUTE * 5);
58 58
 define('PERIOD_MINUTE_10', PERIOD_MINUTE * 10);
59
-define('PERIOD_DAY_3'    , PERIOD_DAY * 3);
60
-define('PERIOD_WEEK_2'   , PERIOD_WEEK * 2);
61
-define('PERIOD_MONTH_2'  , PERIOD_MONTH * 2);
62
-define('PERIOD_MONTH_3'  , PERIOD_MONTH * 3);
59
+define('PERIOD_DAY_3', PERIOD_DAY * 3);
60
+define('PERIOD_WEEK_2', PERIOD_WEEK * 2);
61
+define('PERIOD_MONTH_2', PERIOD_MONTH * 2);
62
+define('PERIOD_MONTH_3', PERIOD_MONTH * 3);
63 63
 
64 64
 define('FONT_SIZE_PERCENT_MIN', 56.25);
65 65
 define('FONT_SIZE_PERCENT_DEFAULT', 68.75);
66 66
 define('FONT_SIZE_PERCENT_MAX', 131.25);
67 67
 define('FONT_SIZE_PERCENT_STEP', 12.5);
68
-define('FONT_SIZE_PERCENT_DEFAULT_STRING', FONT_SIZE_PERCENT_DEFAULT . '%');
68
+define('FONT_SIZE_PERCENT_DEFAULT_STRING', FONT_SIZE_PERCENT_DEFAULT.'%');
69 69
 
70 70
 define('FONT_SIZE_PIXELS_BROWSER_BASE', 16);
71 71
 define('FONT_SIZE_PIXELS_MIN', 9);
72 72
 define('FONT_SIZE_PIXELS_DEFAULT', 11);
73 73
 define('FONT_SIZE_PIXELS_MAX', 21);
74 74
 define('FONT_SIZE_PIXELS_STEP', 1);
75
-define('FONT_SIZE_PIXELS_DEFAULT_STRING', FONT_SIZE_PIXELS_DEFAULT . 'px');
75
+define('FONT_SIZE_PIXELS_DEFAULT_STRING', FONT_SIZE_PIXELS_DEFAULT.'px');
76 76
 
77 77
 define('DEFAULT_PICTURE_EXTENSION_DOTTED', '.jpg');
78 78
 
@@ -115,100 +115,100 @@  discard block
 block discarded – undo
115 115
 define('SN_SYS_SEC_CHARS_ALLOWED', 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghkmnpqrstuvwxyz0123456789');
116 116
 
117 117
 // Mot qui sont interdit a la saisie !
118
-$ListCensure = array ( '/</', '/>/', '/script/i', '/doquery/i', '/http/i', '/javascript/i');
118
+$ListCensure = array('/</', '/>/', '/script/i', '/doquery/i', '/http/i', '/javascript/i');
119 119
 
120 120
 // Confirmation record types
121
-define('CONFIRM_REGISTRATION'  , 1);
121
+define('CONFIRM_REGISTRATION', 1);
122 122
 define('CONFIRM_PASSWORD_RESET', 2);
123
-define('CONFIRM_DELETE'        , 3);
123
+define('CONFIRM_DELETE', 3);
124 124
 
125 125
 define('AFFILIATE_MM_TO_REFERRAL_DM', 2);
126 126
 
127 127
 // Ally diplomacy statuses
128
-define('ALLY_DIPLOMACY_SELF'         , 'self');
129
-define('ALLY_DIPLOMACY_NEUTRAL'      , 'neutral');
130
-define('ALLY_DIPLOMACY_WAR'          , 'war');
131
-define('ALLY_DIPLOMACY_PEACE'        , 'peace');
128
+define('ALLY_DIPLOMACY_SELF', 'self');
129
+define('ALLY_DIPLOMACY_NEUTRAL', 'neutral');
130
+define('ALLY_DIPLOMACY_WAR', 'war');
131
+define('ALLY_DIPLOMACY_PEACE', 'peace');
132 132
 define('ALLY_DIPLOMACY_CONFEDERATION', 'confederation');
133
-define('ALLY_DIPLOMACY_FEDERATION'   , 'federation');
134
-define('ALLY_DIPLOMACY_UNION'        , 'union');
135
-define('ALLY_DIPLOMACY_MASTER'       , 'master');
136
-define('ALLY_DIPLOMACY_SLAVE'        , 'slave');
133
+define('ALLY_DIPLOMACY_FEDERATION', 'federation');
134
+define('ALLY_DIPLOMACY_UNION', 'union');
135
+define('ALLY_DIPLOMACY_MASTER', 'master');
136
+define('ALLY_DIPLOMACY_SLAVE', 'slave');
137 137
 
138 138
 define('ALLY_PROPOSE_SEND', 0);
139 139
 
140 140
 // Quest types
141
-define('QUEST_TYPE_BUILD'   , 1);
141
+define('QUEST_TYPE_BUILD', 1);
142 142
 define('QUEST_TYPE_RESEARCH', 2);
143
-define('QUEST_TYPE_COMBAT'  , 3);
143
+define('QUEST_TYPE_COMBAT', 3);
144 144
 
145
-define('QUEST_STATUS_NOT_STARTED' , 0);
146
-define('QUEST_STATUS_STARTED'     , 1);
147
-define('QUEST_STATUS_COMPLETE'    , 2);
145
+define('QUEST_STATUS_NOT_STARTED', 0);
146
+define('QUEST_STATUS_STARTED', 1);
147
+define('QUEST_STATUS_COMPLETE', 2);
148 148
 
149 149
 // *** Combat-related constants
150 150
 // *** Mission Type constants starts with MT_
151
-define('MT_NONE'     ,  0);
152
-define('MT_ATTACK'   ,  1);
153
-define('MT_ACS'      ,  2);
154
-define('MT_TRANSPORT',  3);
155
-define('MT_RELOCATE' ,  4);
156
-define('MT_HOLD'     ,  5);
157
-define('MT_SPY'      ,  6);
158
-define('MT_COLONIZE' ,  7);
159
-define('MT_RECYCLE'  ,  8);
160
-define('MT_DESTROY'  ,  9);
161
-define('MT_MISSILE'  , 10);
162
-define('MT_EXPLORE'  , 15);
151
+define('MT_NONE', 0);
152
+define('MT_ATTACK', 1);
153
+define('MT_ACS', 2);
154
+define('MT_TRANSPORT', 3);
155
+define('MT_RELOCATE', 4);
156
+define('MT_HOLD', 5);
157
+define('MT_SPY', 6);
158
+define('MT_COLONIZE', 7);
159
+define('MT_RECYCLE', 8);
160
+define('MT_DESTROY', 9);
161
+define('MT_MISSILE', 10);
162
+define('MT_EXPLORE', 15);
163 163
 
164 164
 // *** Planet Target constants starts with PT_
165 165
 define('PT_NONE', 0);
166 166
 define('PT_ALL', 0);
167 167
 define('PT_PLANET', 1);
168 168
 define('PT_DEBRIS', 2);
169
-define('PT_MOON'  , 3);
169
+define('PT_MOON', 3);
170 170
 
171 171
 // *** Unit locations - shows db table where unit belong
172 172
 // Also cache indexes
173
-define('LOC_NONE',    -1);
173
+define('LOC_NONE', -1);
174 174
 define('LOC_UNIVERSE', 0);
175
-define('LOC_PLANET',   1);
176
-define('LOC_DEBRIS',   2); // Translates to `planets` table planet_type = 1, `debris_*` fields
177
-define('LOC_MOON',     3); // Translates to `planets` table planet_type = 3
178
-define('LOC_USER',     4);
179
-define('LOC_FLEET',    5);
180
-define('LOC_ALLY',     6);
181
-define('LOC_UNIT_NUMERIC',     7);
182
-define('LOC_UNIT_LIST',     8);
175
+define('LOC_PLANET', 1);
176
+define('LOC_DEBRIS', 2); // Translates to `planets` table planet_type = 1, `debris_*` fields
177
+define('LOC_MOON', 3); // Translates to `planets` table planet_type = 3
178
+define('LOC_USER', 4);
179
+define('LOC_FLEET', 5);
180
+define('LOC_ALLY', 6);
181
+define('LOC_UNIT_NUMERIC', 7);
182
+define('LOC_UNIT_LIST', 8);
183 183
 
184 184
 // ТОЛЬКО ВНУТРЕНЕЕ!!!
185
-define('LOC_UNIT',    'LOC_UNIT');
186
-define('LOC_QUE',     'LOC_QUE');
187
-define('LOC_LOCATION','LOC_LOCATION');
188
-define('LOC_LOCKS','LOC_LOCKS');
185
+define('LOC_UNIT', 'LOC_UNIT');
186
+define('LOC_QUE', 'LOC_QUE');
187
+define('LOC_LOCATION', 'LOC_LOCATION');
188
+define('LOC_LOCKS', 'LOC_LOCKS');
189 189
 
190 190
 // *** Caching masks
191
-define('CACHE_NOTHING'    ,  0);
192
-define('CACHE_FLEET'      ,  1);
193
-define('CACHE_PLANET'     ,  2);
194
-define('CACHE_USER'       ,  4);
195
-define('CACHE_SOURCE'     ,  8);
191
+define('CACHE_NOTHING', 0);
192
+define('CACHE_FLEET', 1);
193
+define('CACHE_PLANET', 2);
194
+define('CACHE_USER', 4);
195
+define('CACHE_SOURCE', 8);
196 196
 define('CACHE_DESTINATION', 16);
197
-define('CACHE_EVENT'      , 32);
197
+define('CACHE_EVENT', 32);
198 198
 
199
-define('CACHE_USER_SRC'  , CACHE_USER | CACHE_SOURCE);
200
-define('CACHE_USER_DST'  , CACHE_USER | CACHE_DESTINATION);
199
+define('CACHE_USER_SRC', CACHE_USER | CACHE_SOURCE);
200
+define('CACHE_USER_DST', CACHE_USER | CACHE_DESTINATION);
201 201
 define('CACHE_PLANET_SRC', CACHE_PLANET | CACHE_SOURCE);
202 202
 define('CACHE_PLANET_DST', CACHE_PLANET | CACHE_DESTINATION);
203
-define('CACHE_COMBAT'    , CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION);
203
+define('CACHE_COMBAT', CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION);
204 204
 
205
-define('CACHE_ALL'       , CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION | CACHE_EVENT);
205
+define('CACHE_ALL', CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION | CACHE_EVENT);
206 206
 
207
-define('CACHE_NONE'      , CACHE_NOTHING); // Alias for me
207
+define('CACHE_NONE', CACHE_NOTHING); // Alias for me
208 208
 
209 209
 // *** Event types
210 210
 define('EVENT_FLEET_ARRIVE', 1);
211
-define('EVENT_FLEET_STAY'  , 2);
211
+define('EVENT_FLEET_STAY', 2);
212 212
 define('EVENT_FLEET_RETURN', 3);
213 213
 
214 214
 // *** Constants for changing DM
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
 
262 262
 
263 263
 // Operation error status HARDCODE!
264
-define('ERR_NONE'               , 0); // No error
265
-define('ERR_WARNING'            , 1); // There is warning - something altering normal operation process
266
-define('ERR_ERROR'              , 2); // There is error - something permits operation from process
267
-define('ERR_HACK'               , 4); // Operation is qualified as hack attempt
264
+define('ERR_NONE', 0); // No error
265
+define('ERR_WARNING', 1); // There is warning - something altering normal operation process
266
+define('ERR_ERROR', 2); // There is error - something permits operation from process
267
+define('ERR_HACK', 4); // Operation is qualified as hack attempt
268 268
 // New GLOBAL operation results
269 269
 //define('RESULT_DEFAULT' , 0); // Default result - all went OK or result really doesn't matter
270 270
 //define('RESULT_WARNING' , 1);
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 define('SN_PAYMENT_REQUEST_OK', 0);
285 285
 define('SN_PAYMENT_REQUEST_ERROR_UNIT_AMOUNT', 1);
286 286
 define('SN_PAYMENT_REQUEST_ERROR_PAYLINK_UNSUPPORTED', 2);
287
-define('SN_PAYMENT_REQUEST_IP_WRONG', 3);  // Неправильный IP входящей системы - обычно хак
287
+define('SN_PAYMENT_REQUEST_IP_WRONG', 3); // Неправильный IP входящей системы - обычно хак
288 288
 define('SN_PAYMENT_REQUEST_COMMAND_UNSUPPORTED', 4); // Неподдерживаемая команда - обычно хак
289 289
 define('SN_PAYMENT_REQUEST_SIGNATURE_INVALID', 5); // Неправильная подпись или не сошлась контрольная сумма - обычно хак
290 290
 define('SN_MODULE_DISABLED', 6); // Модуль отключен // УНИВЕРСАЛЬНЫЙ ОТВЕТ!
@@ -557,16 +557,16 @@  discard block
 block discarded – undo
557 557
 //define('F_DEVICE_ID',     'F_DEVICE_ID');
558 558
 //define('F_DEVICE_CYPHER', 'F_DEVICE_CYPHER');
559 559
 
560
-define('F_PROVIDER_ID',   'F_PROVIDER_ID');
560
+define('F_PROVIDER_ID', 'F_PROVIDER_ID');
561 561
 // define('F_PROVIDER_LIST', 'F_PROVIDER_LIST');
562 562
 
563 563
 define('F_IMPERSONATE_STATUS', 'F_IMPERSONATE_STATUS');
564 564
 define('F_IMPERSONATE_OPERATOR', 'F_IMPERSONATE_OPERATOR');
565 565
 
566
-define('F_LOGIN_STATUS',  'F_LOGIN_STATUS');
566
+define('F_LOGIN_STATUS', 'F_LOGIN_STATUS');
567 567
 define('F_LOGIN_MESSAGE', 'F_LOGIN_MESSAGE');
568 568
 
569
-define('F_PLAYER_REGISTER_STATUS',  'F_PLAYER_REGISTER_STATUS');
569
+define('F_PLAYER_REGISTER_STATUS', 'F_PLAYER_REGISTER_STATUS');
570 570
 define('F_PLAYER_REGISTER_MESSAGE', 'F_PLAYER_REGISTER_MESSAGE');
571 571
 
572 572
 define('F_USER_ID', 'F_USER_ID');
@@ -610,66 +610,66 @@  discard block
 block discarded – undo
610 610
 
611 611
 
612 612
 // Option groups
613
-define('OPT_ALL',      0);
614
-define('OPT_MESSAGE',  1);
613
+define('OPT_ALL', 0);
614
+define('OPT_MESSAGE', 1);
615 615
 define('OPT_UNIVERSE', 2);
616 616
 define('OPT_INTERFACE', 3);
617 617
 
618 618
 // Message classes
619
-define('MSG_TYPE_OUTBOX'   ,  -1);
620
-define('MSG_TYPE_SPY'      ,   0);
621
-define('MSG_TYPE_PLAYER'   ,   1);
622
-define('MSG_TYPE_ALLIANCE' ,   2);
623
-define('MSG_TYPE_COMBAT'   ,   3);
624
-define('MSG_TYPE_RECYCLE'  ,   4);
625
-define('MSG_TYPE_TRANSPORT',   5);
626
-define('MSG_TYPE_ADMIN'    ,   6);
627
-define('MSG_TYPE_EXPLORE'  ,  15);
628
-define('MSG_TYPE_QUE'      ,  99);
629
-define('MSG_TYPE_NEW'      , 100);
619
+define('MSG_TYPE_OUTBOX', -1);
620
+define('MSG_TYPE_SPY', 0);
621
+define('MSG_TYPE_PLAYER', 1);
622
+define('MSG_TYPE_ALLIANCE', 2);
623
+define('MSG_TYPE_COMBAT', 3);
624
+define('MSG_TYPE_RECYCLE', 4);
625
+define('MSG_TYPE_TRANSPORT', 5);
626
+define('MSG_TYPE_ADMIN', 6);
627
+define('MSG_TYPE_EXPLORE', 15);
628
+define('MSG_TYPE_QUE', 99);
629
+define('MSG_TYPE_NEW', 100);
630 630
 
631 631
 // Attack verification statuses
632
-define('FLIGHT_ALLOWED'           ,  0);
633
-define('FLIGHT_VECTOR_NO_TARGET'         ,  1);
634
-define('FLIGHT_PLAYER_OWN'               ,  2);
635
-define('FLIGHT_MISSION_IMPOSSIBLE'     ,  3);
636
-define('FLIGHT_MISSION_HOLD_NO_ALLY_DEPOSIT'   ,  4);
637
-define('FLIGHT_MISSION_RECYCLE_NO_DEBRIS'         ,  5);
638
-define('FLIGHT_PLAYER_VACATION'          ,  6);
639
-define('FLIGHT_PLAYER_SAME_IP'           ,  7);
640
-define('FLIGHT_PLAYER_BUFFING'           ,  8);
641
-define('FLIGHT_PLAYER_ADMIN'             ,  9);
642
-define('FLIGHT_PLAYER_NOOB'              , 10);
643
-define('FLIGHT_PLAYER_VACATION_OWN'      , 11);
644
-define('FLIGHT_MISSION_MISSILE_NO_SILO'           , 12);
645
-define('FLIGHT_MISSION_MISSILE_NO_MISSILES'        , 13);
646
-define('FLIGHT_SHIPS_NO_SHIPS'          , 14);
647
-define('FLIGHT_FLEET_NO_SLOTS'          , 15);
648
-define('FLIGHT_SHIPS_NOT_ENOUGH_OR_RESOURCES'          , 16);
649
-define('FLIGHT_SHIPS_NO_RECYCLERS'      , 17);
650
-define('FLIGHT_MISSION_SPY_NO_SPIES'          , 18);
651
-define('FLIGHT_SHIPS_NO_COLONIZER'      , 19);
652
-define('FLIGHT_MISSION_MISSILE_TOO_FAR'   , 20);
653
-define('FLIGHT_MISSION_MISSILE_WRONG_STRUCTURE'   , 21);
654
-define('FLIGHT_RESOURCES_FUEL_NOT_ENOUGH'           , 22);
655
-define('FLIGHT_RESOURCES_NOT_ENOUGH'      , 23);
656
-define('FLIGHT_MISSION_ACS_NOT_EXISTS'            , 24);
657
-define('FLIGHT_MISSION_ACS_MISSTARGET'    , 25);
658
-define('FLIGHT_FLEET_SPEED_WRONG'       , 26);
659
-define('FLIGHT_MISSION_ACS_TOO_LATE'      , 27);
660
-define('FLIGHT_MISSION_ATTACK_BASHING'           , 28);
661
-define('FLIGHT_MISSION_ATTACK_BASHING_WAR_DELAY' , 29);
662
-define('FLIGHT_MISSION_ACS_WRONG_TARGET'  , 30);
663
-define('FLIGHT_VECTOR_SAME_SOURCE'              , 31);
632
+define('FLIGHT_ALLOWED', 0);
633
+define('FLIGHT_VECTOR_NO_TARGET', 1);
634
+define('FLIGHT_PLAYER_OWN', 2);
635
+define('FLIGHT_MISSION_IMPOSSIBLE', 3);
636
+define('FLIGHT_MISSION_HOLD_NO_ALLY_DEPOSIT', 4);
637
+define('FLIGHT_MISSION_RECYCLE_NO_DEBRIS', 5);
638
+define('FLIGHT_PLAYER_VACATION', 6);
639
+define('FLIGHT_PLAYER_SAME_IP', 7);
640
+define('FLIGHT_PLAYER_BUFFING', 8);
641
+define('FLIGHT_PLAYER_ADMIN', 9);
642
+define('FLIGHT_PLAYER_NOOB', 10);
643
+define('FLIGHT_PLAYER_VACATION_OWN', 11);
644
+define('FLIGHT_MISSION_MISSILE_NO_SILO', 12);
645
+define('FLIGHT_MISSION_MISSILE_NO_MISSILES', 13);
646
+define('FLIGHT_SHIPS_NO_SHIPS', 14);
647
+define('FLIGHT_FLEET_NO_SLOTS', 15);
648
+define('FLIGHT_SHIPS_NOT_ENOUGH_OR_RESOURCES', 16);
649
+define('FLIGHT_SHIPS_NO_RECYCLERS', 17);
650
+define('FLIGHT_MISSION_SPY_NO_SPIES', 18);
651
+define('FLIGHT_SHIPS_NO_COLONIZER', 19);
652
+define('FLIGHT_MISSION_MISSILE_TOO_FAR', 20);
653
+define('FLIGHT_MISSION_MISSILE_WRONG_STRUCTURE', 21);
654
+define('FLIGHT_RESOURCES_FUEL_NOT_ENOUGH', 22);
655
+define('FLIGHT_RESOURCES_NOT_ENOUGH', 23);
656
+define('FLIGHT_MISSION_ACS_NOT_EXISTS', 24);
657
+define('FLIGHT_MISSION_ACS_MISSTARGET', 25);
658
+define('FLIGHT_FLEET_SPEED_WRONG', 26);
659
+define('FLIGHT_MISSION_ACS_TOO_LATE', 27);
660
+define('FLIGHT_MISSION_ATTACK_BASHING', 28);
661
+define('FLIGHT_MISSION_ATTACK_BASHING_WAR_DELAY', 29);
662
+define('FLIGHT_MISSION_ACS_WRONG_TARGET', 30);
663
+define('FLIGHT_VECTOR_SAME_SOURCE', 31);
664 664
 define('FLIGHT_RESOURCES_FORBIDDEN', 32);
665
-define('FLIGHT_RESOURCES_EMPTY'   , 33);
666
-define('FLIGHT_SHIPS_NOT_ONLY_SPIES'       , 34);
667
-define('FLIGHT_FLEET_TOO_FAR'           , 35);
668
-define('FLIGHT_FLEET_OVERLOAD'        , 36);
669
-define('FLIGHT_MISSION_UNKNOWN'    , 37);
670
-define('FLIGHT_SHIPS_UNIT_WRONG'        , 38);
671
-define('FLIGHT_SHIPS_UNMOVABLE'        , 39);
672
-define('FLIGHT_SHIPS_NEGATIVE'  , 40);
665
+define('FLIGHT_RESOURCES_EMPTY', 33);
666
+define('FLIGHT_SHIPS_NOT_ONLY_SPIES', 34);
667
+define('FLIGHT_FLEET_TOO_FAR', 35);
668
+define('FLIGHT_FLEET_OVERLOAD', 36);
669
+define('FLIGHT_MISSION_UNKNOWN', 37);
670
+define('FLIGHT_SHIPS_UNIT_WRONG', 38);
671
+define('FLIGHT_SHIPS_UNMOVABLE', 39);
672
+define('FLIGHT_SHIPS_NEGATIVE', 40);
673 673
 define('FLIGHT_RESOURCES_NEGATIVE', 41);
674 674
 define('FLIGHT_MISSION_MORATORIUM', 42);
675 675
 define('FLIGHT_PLAYER_CHILD_PROTECTION', 43);
@@ -697,12 +697,12 @@  discard block
 block discarded – undo
697 697
 
698 698
 
699 699
 // *** Races - Homeworlds
700
-define('RACE_NONE'    , 0);
701
-define('RACE_EARTH'   , 1);
702
-define('RACE_MOON'    , 2);
703
-define('RACE_MERCURY' , 3);
704
-define('RACE_VENUS'   , 4);
705
-define('RACE_MARS'    , 5);
700
+define('RACE_NONE', 0);
701
+define('RACE_EARTH', 1);
702
+define('RACE_MOON', 2);
703
+define('RACE_MERCURY', 3);
704
+define('RACE_VENUS', 4);
705
+define('RACE_MARS', 5);
706 706
 define('RACE_ASTEROID', 6);
707 707
 // define('MARKET_INFO'         , 7);
708 708
 
@@ -710,114 +710,114 @@  discard block
 block discarded – undo
710 710
 
711 711
 // *** Market variables
712 712
 // === Market blocks
713
-define('MARKET_ENTRY'        , 0);
714
-define('MARKET_RESOURCES'    , 1);
715
-define('MARKET_SCRAPPER'     , 2);
716
-define('MARKET_STOCKMAN'     , 3);
717
-define('MARKET_EXCHANGE'     , 4);
718
-define('MARKET_BANKER'       , 5);
719
-define('MARKET_PAWNSHOP'     , 6);
720
-define('MARKET_INFO'         , 7);
713
+define('MARKET_ENTRY', 0);
714
+define('MARKET_RESOURCES', 1);
715
+define('MARKET_SCRAPPER', 2);
716
+define('MARKET_STOCKMAN', 3);
717
+define('MARKET_EXCHANGE', 4);
718
+define('MARKET_BANKER', 5);
719
+define('MARKET_PAWNSHOP', 6);
720
+define('MARKET_INFO', 7);
721 721
 
722 722
 // === Market error statuses
723
-define('MARKET_NOTHING'              ,  0);
724
-define('MARKET_DEAL'                 ,  1);
725
-define('MARKET_DEAL_TRADE'           ,  2);
726
-define('MARKET_NO_DM'                ,  3);
727
-define('MARKET_NO_RESOURCES'         ,  4);
728
-define('MARKET_ZERO_DEAL'            ,  5);
729
-define('MARKET_NO_SHIPS'             ,  6);
730
-define('MARKET_NOT_A_SHIP'           ,  7);
731
-define('MARKET_NO_STOCK'             ,  8);
732
-define('MARKET_ZERO_RES_STOCK'       ,  9);
733
-define('MARKET_NEGATIVE_SHIPS'       , 10);
734
-
735
-define('MARKET_INFO_PLAYER'          , 12);
736
-define('MARKET_INFO_WRONG'           , 11);
723
+define('MARKET_NOTHING', 0);
724
+define('MARKET_DEAL', 1);
725
+define('MARKET_DEAL_TRADE', 2);
726
+define('MARKET_NO_DM', 3);
727
+define('MARKET_NO_RESOURCES', 4);
728
+define('MARKET_ZERO_DEAL', 5);
729
+define('MARKET_NO_SHIPS', 6);
730
+define('MARKET_NOT_A_SHIP', 7);
731
+define('MARKET_NO_STOCK', 8);
732
+define('MARKET_ZERO_RES_STOCK', 9);
733
+define('MARKET_NEGATIVE_SHIPS', 10);
734
+
735
+define('MARKET_INFO_PLAYER', 12);
736
+define('MARKET_INFO_WRONG', 11);
737 737
 define('MARKET_INFO_PLAYER_NOT_FOUND', 13);
738
-define('MARKET_INFO_PLAYER_WRONG'    , 14);
739
-define('MARKET_INFO_PLAYER_SAME'     , 15);
738
+define('MARKET_INFO_PLAYER_WRONG', 14);
739
+define('MARKET_INFO_PLAYER_SAME', 15);
740 740
 
741 741
 
742 742
 
743 743
 
744 744
 // *** Mercenary/talent bonus types
745
-define('BONUS_NONE'    ,            0);  // No bonus
746
-define('BONUS_PERCENT' ,            1);  // Percent on base value
747
-define('BONUS_ADD'     ,            2);  // Add
748
-define('BONUS_ABILITY' ,            3);  // Some ability
749
-define('BONUS_MULTIPLY',            4);  // Multiply by value
750
-define('BONUS_PERCENT_CUMULATIVE' , 5);  // Cumulative percent on base value
751
-define('BONUS_PERCENT_DEGRADED' ,   6);  // Bonus amount degraded with increase as pow(bonus, level) (?)
752
-define('BONUS_SPEED',               7);  // Speed bonus
745
+define('BONUS_NONE', 0); // No bonus
746
+define('BONUS_PERCENT', 1); // Percent on base value
747
+define('BONUS_ADD', 2); // Add
748
+define('BONUS_ABILITY', 3); // Some ability
749
+define('BONUS_MULTIPLY', 4); // Multiply by value
750
+define('BONUS_PERCENT_CUMULATIVE', 5); // Cumulative percent on base value
751
+define('BONUS_PERCENT_DEGRADED', 6); // Bonus amount degraded with increase as pow(bonus, level) (?)
752
+define('BONUS_SPEED', 7); // Speed bonus
753 753
 
754 754
 // *** Action constant (build should be replaced with ACTION)
755
-define('BUILD_CREATE' ,  1);
755
+define('BUILD_CREATE', 1);
756 756
 define('BUILD_DESTROY', -1);
757 757
 define('BUILD_AUTOCONVERT', 2);
758 758
 
759
-define('ACTION_SELL'       , -1);
760
-define('ACTION_NOTHING'    ,  0);
761
-define('ACTION_BUY'        ,  1);
762
-define('ACTION_USE'        ,  2);
763
-define('ACTION_DELETE'     ,  3);
759
+define('ACTION_SELL', -1);
760
+define('ACTION_NOTHING', 0);
761
+define('ACTION_BUY', 1);
762
+define('ACTION_USE', 2);
763
+define('ACTION_DELETE', 3);
764 764
 
765 765
 // *** Check unit availability codes
766
-define('BUILD_ALLOWED'         , 0); // HARDCODED! DO NOT CHANGE!
766
+define('BUILD_ALLOWED', 0); // HARDCODED! DO NOT CHANGE!
767 767
 define('BUILD_REQUIRE_NOT_MEET', 1);
768
-define('BUILD_AMOUNT_WRONG'    , 2);
769
-define('BUILD_QUE_WRONG'       , 3);
770
-define('BUILD_QUE_UNIT_WRONG'  , 4);
771
-define('BUILD_INDESTRUCTABLE'  , 5);
772
-define('BUILD_NO_RESOURCES'    , 6);
773
-define('BUILD_NO_UNITS'        , 7);
774
-define('BUILD_UNIT_BUSY'       , 8);
775
-define('BUILD_QUE_FULL'        , 9);
776
-define('BUILD_SILO_FULL'       ,10);
777
-define('BUILD_MAX_REACHED'     ,11);
778
-define('BUILD_SECTORS_NONE'    ,12);
768
+define('BUILD_AMOUNT_WRONG', 2);
769
+define('BUILD_QUE_WRONG', 3);
770
+define('BUILD_QUE_UNIT_WRONG', 4);
771
+define('BUILD_INDESTRUCTABLE', 5);
772
+define('BUILD_NO_RESOURCES', 6);
773
+define('BUILD_NO_UNITS', 7);
774
+define('BUILD_UNIT_BUSY', 8);
775
+define('BUILD_QUE_FULL', 9);
776
+define('BUILD_SILO_FULL', 10);
777
+define('BUILD_MAX_REACHED', 11);
778
+define('BUILD_SECTORS_NONE', 12);
779 779
 define('BUILD_AUTOCONVERT_AVAILABLE', 13);
780 780
 
781 781
 
782 782
 // *** Que types
783 783
 define('QUE_STRUCTURES', 1);
784
-define('QUE_HANGAR'    , 4);
785
-define('QUE_RESEARCH'  , 7);
786
-define('QUE_MERCENARY' , 600); // UNIT_MERCENARIES
784
+define('QUE_HANGAR', 4);
785
+define('QUE_RESEARCH', 7);
786
+define('QUE_MERCENARY', 600); // UNIT_MERCENARIES
787 787
 // *** Subque types
788
-define('SUBQUE_PLANET'  , 1);
789
-define('SUBQUE_MOON'    , 3);
790
-define('SUBQUE_FLEET'   , 4);
791
-define('SUBQUE_DEFENSE' , 6);
788
+define('SUBQUE_PLANET', 1);
789
+define('SUBQUE_MOON', 3);
790
+define('SUBQUE_FLEET', 4);
791
+define('SUBQUE_DEFENSE', 6);
792 792
 define('SUBQUE_RESEARCH', 7);
793 793
 
794 794
 // *** Que items
795
-define('QI_UNIT_ID'   , 0);
796
-define('QI_AMOUNT'    , 1);
797
-define('QI_TIME'      , 2);
798
-define('QI_MODE'      , 3);
799
-define('QI_QUE_ID'    , 4);
800
-define('QI_QUE_TYPE'  , 4);
801
-define('QI_PLANET_ID' , 5);
795
+define('QI_UNIT_ID', 0);
796
+define('QI_AMOUNT', 1);
797
+define('QI_TIME', 2);
798
+define('QI_MODE', 3);
799
+define('QI_QUE_ID', 4);
800
+define('QI_QUE_TYPE', 4);
801
+define('QI_PLANET_ID', 5);
802 802
 
803 803
 
804 804
 // *** Units
805 805
 
806 806
 // *** Sort options
807
-define('SORT_ASCENDING' , 0);
807
+define('SORT_ASCENDING', 0);
808 808
 define('SORT_DESCENDING', 1);
809 809
 
810
-define('SORT_ID'             , 0);
811
-define('SORT_LOCATION'       , 1);
812
-define('SORT_NAME'           , 2);
813
-define('SORT_SIZE'           , 3);
814
-define('SORT_EMAIL'          , 4);
815
-define('SORT_IP'             , 5);
810
+define('SORT_ID', 0);
811
+define('SORT_LOCATION', 1);
812
+define('SORT_NAME', 2);
813
+define('SORT_SIZE', 3);
814
+define('SORT_EMAIL', 4);
815
+define('SORT_IP', 5);
816 816
 define('SORT_TIME_REGISTERED', 6);
817 817
 define('SORT_TIME_LAST_VISIT', 7);
818
-define('SORT_TIME_BAN_UNTIL' , 8);
819
-define('SORT_REFERRAL_COUNT' , 9);
820
-define('SORT_REFERRAL_DM'    , 10);
818
+define('SORT_TIME_BAN_UNTIL', 8);
819
+define('SORT_REFERRAL_COUNT', 9);
820
+define('SORT_REFERRAL_DM', 10);
821 821
 
822 822
 
823 823
 define('HULL_SIZE_TINY', 1);
@@ -960,10 +960,10 @@  discard block
 block discarded – undo
960 960
 
961 961
 // === Artifacts
962 962
 define('UNIT_ARTIFACTS', 1000);
963
-define('ART_LHC', 1001);      // Additional moon chance
964
-define('ART_RCD_SMALL', 1002);   // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
965
-define('ART_RCD_MEDIUM', 1003);  // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
966
-define('ART_RCD_LARGE', 1004);   // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
963
+define('ART_LHC', 1001); // Additional moon chance
964
+define('ART_RCD_SMALL', 1002); // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
965
+define('ART_RCD_MEDIUM', 1003); // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
966
+define('ART_RCD_LARGE', 1004); // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
967 967
 define('ART_HEURISTIC_CHIP', 1005); // Speed up research
968 968
 define('ART_NANO_BUILDER', 1006); // Speed up building
969 969
 define('ART_NANO_CONSTRUCTOR', 1007); // RESERVED Speed up hangar constructions
@@ -1034,18 +1034,18 @@  discard block
 block discarded – undo
1034 1034
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE1', 2201); // Блиц-сервер, участник 0-го раунда, 1-е место
1035 1035
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE2', 2202); // Блиц-сервер, участник 0-го раунда, 2-е место
1036 1036
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE3', 2203); // Блиц-сервер, участник 0-го раунда, 3-е место
1037
-define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204);  // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1037
+define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1038 1038
 
1039 1039
 define('UNIT_AWARD_MEMORY', 2300); // Памятные знаки за существование и участие - например "4 года в игре". "Был онлайн в новогоднюю ночь 2013". итд
1040
-define('UNIT_AWARD_MEMORY_IMMORTAL', 2301);  // Бессмертный
1041
-define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1040
+define('UNIT_AWARD_MEMORY_IMMORTAL', 2301); // Бессмертный
1041
+define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1042 1042
 define('UNIT_AWARD_MEMORY_BLITZ_R0', 2303); // Блиц-сервер, участник 0-го раунда
1043 1043
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SIMPLE', 2304); // День Рождения СН
1044 1044
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_BRONZE', 2305); // День Рождения СН
1045 1045
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SILVER', 2306); // День Рождения СН
1046 1046
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_GOLD', 2307); // День Рождения СН
1047 1047
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_PLATINUM', 2308); // День Рождения СН
1048
-define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1048
+define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1049 1049
 
1050 1050
 define('UNIT_AWARD_PENNANT', 2400); // Переходящий вымпел - индикация статуса на сервере: "Топ-1", "Топ", "Сабтоп", "Самый большой флот" итд
1051 1051
 define('UNIT_AWARD_BADGE', 2600); // Бейджики/значки за ачивки - например, "Построил 1000 кораблей"
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 
1143 1143
 define('UNIT_NEXT', 4000); // !!! Next unit start on 4000 !!!
1144 1144
 
1145
-define('GROUP_PART',         800000);
1145
+define('GROUP_PART', 800000);
1146 1146
 // Зарезервировано для запчастей: 800.001 - 899.999
1147 1147
 // define('GROUP_PART_HULL',    801000); // Корпуса - 1000 штук
1148 1148
 // define('GROUP_PART_ARMOR',   802000); // Броня - 1000 штук
@@ -1399,32 +1399,32 @@  discard block
 block discarded – undo
1399 1399
 
1400 1400
 
1401 1401
 // define('NICK_ID',               -1);
1402
-define('NICK_HTML',              0);
1403
-
1404
-define('NICK_FIRST',             1);
1405
-define('NICK_RACE',           1000);
1406
-define('NICK_GENDER',         2000);
1407
-define('NICK_AWARD',          3000);
1408
-define('NICK_VACATION',       3500);
1409
-define('NICK_BIRTHSDAY',      4000);
1410
-define('NICK_PREMIUM',        5000);
1411
-define('NICK_AUTH_LEVEL',     6000);
1412
-
1413
-define('NICK_HIGHLIGHT',      6300);
1414
-define('NICK_CLASS',          6450);
1415
-
1416
-define('NICK_NICK_CLASS',     6600);
1417
-define('NICK_NICK',           7000);
1402
+define('NICK_HTML', 0);
1403
+
1404
+define('NICK_FIRST', 1);
1405
+define('NICK_RACE', 1000);
1406
+define('NICK_GENDER', 2000);
1407
+define('NICK_AWARD', 3000);
1408
+define('NICK_VACATION', 3500);
1409
+define('NICK_BIRTHSDAY', 4000);
1410
+define('NICK_PREMIUM', 5000);
1411
+define('NICK_AUTH_LEVEL', 6000);
1412
+
1413
+define('NICK_HIGHLIGHT', 6300);
1414
+define('NICK_CLASS', 6450);
1415
+
1416
+define('NICK_NICK_CLASS', 6600);
1417
+define('NICK_NICK', 7000);
1418 1418
 define('NICK_NICK_CLASS_END', 7300);
1419 1419
 
1420
-define('NICK_ALLY_CLASS',     7600);
1421
-define('NICK_ALLY',           8000);
1420
+define('NICK_ALLY_CLASS', 7600);
1421
+define('NICK_ALLY', 8000);
1422 1422
 define('NICK_ALLY_CLASS_END', 8300);
1423 1423
 
1424
-define('NICK_CLASS_END',      8450);
1425
-define('NICK_HIGHLIGHT_END',  8600);
1424
+define('NICK_CLASS_END', 8450);
1425
+define('NICK_HIGHLIGHT_END', 8600);
1426 1426
 
1427
-define('NICK_LAST',           9999);
1427
+define('NICK_LAST', 9999);
1428 1428
 
1429 1429
 // Настройки игрока
1430 1430
 define('PLAYER_OPTION_MENU_SORT', 1);
@@ -1517,8 +1517,8 @@  discard block
 block discarded – undo
1517 1517
 define('LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10', 1);
1518 1518
 
1519 1519
 define('BLITZ_REGISTER_DISABLED', 0);
1520
-define('BLITZ_REGISTER_OPEN'    , 1);
1521
-define('BLITZ_REGISTER_CLOSED'  , 2);
1520
+define('BLITZ_REGISTER_OPEN', 1);
1521
+define('BLITZ_REGISTER_CLOSED', 2);
1522 1522
 define('BLITZ_REGISTER_SHOW_LOGIN', 3);
1523 1523
 define('BLITZ_REGISTER_DISCLOSURE_NAMES', 4);
1524 1524
 
Please login to merge, or discard this patch.
includes/functions/eco_planet_update.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,19 +65,19 @@  discard block
 block discarded – undo
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
           classSupernova::$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);
78 78
         }
79 79
         $planet[$resource_name] += $increment;
80
-        $planet[$resource_name . '_perhour'] = $caps_real['total'][$resource_id];
80
+        $planet[$resource_name.'_perhour'] = $caps_real['total'][$resource_id];
81 81
       }
82 82
     break;
83 83
 
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
   // TODO пересчитывать размер планеты только при постройке чего-нибудь и при покупке сектора
95 95
   $planet['field_current'] = 0;
96 96
   $sn_group_build_allow = sn_get_groups('build_allow');
97
-  if(is_array($sn_group_build_allow[$planet['planet_type']])) {
98
-    foreach($sn_group_build_allow[$planet['planet_type']] as $building_id) {
97
+  if (is_array($sn_group_build_allow[$planet['planet_type']])) {
98
+    foreach ($sn_group_build_allow[$planet['planet_type']] as $building_id) {
99 99
       $planet['field_current'] += mrc_get_level($user, $planet, $building_id, !$simulation, true);
100 100
     }
101 101
   }
102 102
 
103
-  if($simulation) {
103
+  if ($simulation) {
104 104
     return array('user' => $user, 'planet' => $planet, 'que' => $que);
105 105
   }
106 106
 
Please login to merge, or discard this patch.
includes/functions/ali_alliances.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@  discard block
 block discarded – undo
3 3
 function ali_rank_list_save($ranks) {
4 4
   global $user;
5 5
 
6
-  if(!empty($ranks)) {
7
-    foreach($ranks as $rank => $rights) {
6
+  if (!empty($ranks)) {
7
+    foreach ($ranks as $rank => $rights) {
8 8
       $rights = implode(',', $rights);
9
-      $ranklist .= $rights . ';';
9
+      $ranklist .= $rights.';';
10 10
     }
11 11
   }
12 12
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
   $temp_array = array();
23 23
   $query = db_ally_diplomacy_get_relations($ally_from, $ally_to);
24 24
 
25
-  while($record = db_fetch($query)) {
25
+  while ($record = db_fetch($query)) {
26 26
     $temp_array[$record['alliance_diplomacy_contr_ally_id']] = $record;
27 27
   }
28 28
 
Please login to merge, or discard this patch.
includes/functions/_news.php 1 patch
Spacing   +15 added lines, -16 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@  discard block
 block discarded – undo
11 11
   $announce_list = db_news_list_get_by_query($template, $query_where, $query_limit);
12 12
 
13 13
   $users = array();
14
-  while($announce = db_fetch($announce_list)) {
15
-    if($announce['user_id'] && !isset($users[$announce['user_id']])) {
14
+  while ($announce = db_fetch($announce_list)) {
15
+    if ($announce['user_id'] && !isset($users[$announce['user_id']])) {
16 16
       $users[$announce['user_id']] = db_user_by_id($announce['user_id']);
17 17
     }
18 18
 
19 19
     $survey_vote = array('survey_vote_id' => 1);
20 20
     $survey_complete = strtotime($announce['survey_until']) < SN_TIME_NOW;
21 21
 
22
-    if($announce['survey_id'] && !empty($user['id'])) {
22
+    if ($announce['survey_id'] && !empty($user['id'])) {
23 23
       $survey_vote = !$survey_complete ? db_survey_get_vote($announce, $user) : array();
24 24
     }
25 25
 
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
       'ANNOUNCE'        => cht_message_parse($announce['strAnnounce'], false, intval($announce['authlevel'])),
32 32
       'DETAIL_URL'      => $announce['detail_url'],
33 33
       'USER_NAME'       =>
34
-        isset($users[$announce['user_id']]) && $users[$announce['user_id']] ? player_nick_render_to_html($users[$announce['user_id']], array('color' => true)) :
35
-          js_safe_string($announce['user_name']),
34
+        isset($users[$announce['user_id']]) && $users[$announce['user_id']] ? player_nick_render_to_html($users[$announce['user_id']], array('color' => true)) : js_safe_string($announce['user_name']),
36 35
       'NEW'             => $announce['unix_time'] + classSupernova::$config->game_news_actual >= SN_TIME_NOW,
37 36
       'FUTURE'          => $announce['unix_time'] > SN_TIME_NOW,
38 37
       'SURVEY_ID'       => $announce['survey_id'],
@@ -42,25 +41,25 @@  discard block
 block discarded – undo
42 41
       'SURVEY_UNTIL'    => $announce['survey_until'],
43 42
     ));
44 43
 
45
-    foreach($announce_exploded as $announce_paragraph) {
44
+    foreach ($announce_exploded as $announce_paragraph) {
46 45
       $template->assign_block_vars('announces.paragraph', array(
47 46
         'TEXT' => $announce_paragraph,
48 47
       ));
49 48
     }
50 49
 
51
-    if($announce['survey_id']) {
50
+    if ($announce['survey_id']) {
52 51
       $survey_query = db_survey_get_answer_texts($announce);
53 52
       $survey_vote_result = array();
54 53
       $total_votes = 0;
55
-      while($row = db_fetch($survey_query)) {
54
+      while ($row = db_fetch($survey_query)) {
56 55
         $survey_vote_result[] = $row;
57 56
         $total_votes += $row['VOTES'];
58 57
       }
59 58
 
60
-      if(empty($survey_vote) && !$survey_complete) {
59
+      if (empty($survey_vote) && !$survey_complete) {
61 60
         // Can vote
62 61
         $survey_query = db_survey_answers_get_list_by_parent($announce);
63
-        while($row = db_fetch($survey_query)) {
62
+        while ($row = db_fetch($survey_query)) {
64 63
           $template->assign_block_vars('announces.survey_answers', array(
65 64
             'ID'   => $row['survey_answer_id'],
66 65
             'TEXT' => $row['survey_answer_text'],
@@ -68,7 +67,7 @@  discard block
 block discarded – undo
68 67
         }
69 68
       } else {
70 69
         // Show result
71
-        foreach($survey_vote_result as &$vote_result) {
70
+        foreach ($survey_vote_result as &$vote_result) {
72 71
           $vote_percent = $total_votes ? $vote_result['VOTES'] / $total_votes * 100 : 0;
73 72
           $vote_result['PERCENT'] = $vote_percent;
74 73
           $vote_result['PERCENT_TEXT'] = round($vote_percent, 1);
@@ -85,8 +84,8 @@  discard block
 block discarded – undo
85 84
 }
86 85
 
87 86
 function nws_mark_read(&$user) {
88
-  if(isset($user['id'])) {
89
-    db_user_set_by_id($user['id'], '`news_lastread` = ' . SN_TIME_NOW);
87
+  if (isset($user['id'])) {
88
+    db_user_set_by_id($user['id'], '`news_lastread` = '.SN_TIME_NOW);
90 89
     $user['news_lastread'] = SN_TIME_NOW;
91 90
   }
92 91
 
@@ -94,17 +93,17 @@  discard block
 block discarded – undo
94 93
 }
95 94
 
96 95
 function survey_vote(&$user) {
97
-  if(empty($user['id'])) {
96
+  if (empty($user['id'])) {
98 97
     return true;
99 98
   }
100 99
 
101 100
   sn_db_transaction_start();
102 101
   $survey_id = sys_get_param_id('survey_id');
103 102
   $is_voted = db_survey_vote_get($user, $survey_id);
104
-  if(empty($is_voted)) {
103
+  if (empty($is_voted)) {
105 104
     $survey_vote_id = sys_get_param_id('survey_vote');
106 105
     $is_answer_exists = db_survey_answer_get($survey_id, $survey_vote_id);
107
-    if(!empty($is_answer_exists)) {
106
+    if (!empty($is_answer_exists)) {
108 107
       $user_name_safe = db_escape($user['username']);
109 108
       db_survey_vote_insert($user, $survey_id, $survey_vote_id, $user_name_safe);
110 109
     }
Please login to merge, or discard this patch.
includes/functions/lng_language.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 // ----------------------------------------------------------------------------------------------------------------
4 4
 function lng_try_filepath($path, $file_path_relative)
5 5
 {
6
-  $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative;
6
+  $file_path = SN_ROOT_PHYSICAL.($path && file_exists(SN_ROOT_PHYSICAL.$path.$file_path_relative) ? $path : '').$file_path_relative;
7 7
   return file_exists($file_path) ? $file_path : false;
8 8
 }
9 9
 
Please login to merge, or discard this patch.