Test Failed
Push — trunk ( 0d5d14...30e273 )
by SuperNova.WS
11:46
created
includes/template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     renderFooter();
323 323
   }
324 324
 
325
-  $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false;;
325
+  $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false; ;
326 326
 
327 327
   sn_db_disconnect();
328 328
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
     'QUE_ID'   => QUE_RESEARCH,
706 706
     'QUE_HTML' => 'topnav',
707 707
 
708
-    'RESEARCH_ONGOING' => (boolean)$user['que'],
708
+    'RESEARCH_ONGOING' => (boolean) $user['que'],
709 709
 
710 710
     'TIME_TEXT'       => sprintf($str_date_format, $time_now_parsed['year'], $lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'],
711 711
       $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds']
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
   if (empty($files)) {
976 976
     // Make sure that all empty files will translate to empty array
977 977
     $files = [];
978
-  } elseif(is_string($files)) {
978
+  } elseif (is_string($files)) {
979 979
     // If we have single filename - making array from it
980 980
     $files = [basename($files) => $files];
981 981
   } elseif (!is_array($files)) {
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
     'LANG'     => $language ? $language : '',
1009 1009
     'referral' => $id_ref ? '&id_ref=' . $id_ref : '',
1010 1010
 
1011
-    'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '',// "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
1011
+    'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '', // "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
1012 1012
     'FILENAME'       => basename($_SERVER['PHP_SELF']),
1013 1013
   ));
1014 1014
 
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
     'MESSAGE' => $message,
1126 1126
   ];
1127 1127
 
1128
-  if($template instanceof template) {
1128
+  if ($template instanceof template) {
1129 1129
     $template->assign_block_vars('result', $block);
1130 1130
   } else {
1131 1131
     $template_result['.']['result'][] = $block;
Please login to merge, or discard this patch.
includes/update.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
       }
238 238
     }
239 239
 
240
-    $updater->upd_alter_table('users', ["DROP COLUMN `dpath`",], $updater->isFieldExists('users', 'dpath'));
240
+    $updater->upd_alter_table('users', ["DROP COLUMN `dpath`", ], $updater->isFieldExists('users', 'dpath'));
241 241
 
242 242
     // 2017-06-12 13:47:36 42c1
243 243
     $updater->new_version = 42;
@@ -250,14 +250,14 @@  discard block
 block discarded – undo
250 250
 
251 251
     // 2017-10-11 09:51:49 43a4.3
252 252
     $updater->upd_alter_table('messages',
253
-      ["ADD COLUMN `message_json` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `message_text`",],
253
+      ["ADD COLUMN `message_json` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `message_text`", ],
254 254
       !$updater->isFieldExists('messages', 'message_json')
255 255
     );
256 256
 
257 257
 
258 258
     // 2017-10-17 09:49:24 43a6.0
259 259
     // Removing old index i_user_id
260
-    $updater->upd_alter_table('counter', ['DROP KEY `i_user_id`',], $updater->isIndexExists('counter', 'i_user_id'));
260
+    $updater->upd_alter_table('counter', ['DROP KEY `i_user_id`', ], $updater->isIndexExists('counter', 'i_user_id'));
261 261
     // Adding new index I_counter_user_id
262 262
     $updater->upd_alter_table('counter',
263 263
       [
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
       );
312 312
     }
313 313
 
314
-    $updater->updPatchApply(1, function () use ($updater) {
314
+    $updater->updPatchApply(1, function() use ($updater) {
315 315
       $q = $updater->upd_do_query("SELECT `messageid`, `user` FROM `{{chat}}`", true);
316 316
       while ($row = db_fetch($q)) {
317 317
         if (strpos($row['user'], 'a:') !== 0) {
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
     });
334 334
 
335 335
     // 2018-03-07 09:23:41 43a13.23 + 2018-03-07 12:00:47 43a13.24
336
-    $updater->updPatchApply(2, function () use ($updater) {
336
+    $updater->updPatchApply(2, function() use ($updater) {
337 337
       $updater->upd_alter_table('festival_gifts', [
338 338
         "ADD COLUMN `disclosure` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `amount`",
339 339
         "ADD COLUMN `message` VARCHAR(4096) CHARSET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' AFTER `disclosure`",
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
     });
342 342
 
343 343
     // 2018-03-12 13:23:10 43a13.33
344
-    $updater->updPatchApply(3, function () use ($updater) {
344
+    $updater->updPatchApply(3, function() use ($updater) {
345 345
       $updater->upd_alter_table('player_options',
346 346
         [
347 347
           "MODIFY COLUMN `value` VARCHAR(16000) CHARSET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''",
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
     });
352 352
 
353 353
     // 2018-03-24 21:31:51 43a16.16 - OiS
354
-    $updater->updPatchApply(4, function () use ($updater) {
354
+    $updater->updPatchApply(4, function() use ($updater) {
355 355
       if (!$updater->isTableExists('festival_ois_player')) {
356 356
         $updater->upd_create_table(
357 357
           'festival_ois_player',
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
     });
371 371
 
372 372
     // 2018-03-25 08:11:39 43a16.21
373
-    $updater->updPatchApply(5, function () use ($updater) {
373
+    $updater->updPatchApply(5, function() use ($updater) {
374 374
       $updater->upd_alter_table(
375 375
         'que',
376 376
         "ADD COLUMN `que_unit_one_time_raw` DECIMAL(20,5) NOT NULL DEFAULT 0",
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     $updater->upd_log_version_update();
387 387
 
388 388
     // 2018-12-21 14:00:41 44a5 Module "ad_promo_code" support
389
-    $updater->updPatchApply(6, function () use ($updater) {
389
+    $updater->updPatchApply(6, function() use ($updater) {
390 390
       if (!$updater->isTableExists('ad_promo_codes')) {
391 391
         $updater->upd_create_table(
392 392
           'ad_promo_codes',
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
     });
428 428
 
429 429
     // 2018-12-22 11:42:20 44a12
430
-    $updater->updPatchApply(7, function () use ($updater) {
430
+    $updater->updPatchApply(7, function() use ($updater) {
431 431
       // Creating table for HTTP query strings
432 432
       $updater->upd_create_table(
433 433
         'security_query_strings',
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
         // Adding unique index for all significant fields
513 513
         $updater->upd_alter_table('security_player_entry', [
514 514
           "ADD UNIQUE KEY `I_player_entry_unique` (`device_id`, `browser_id`, `user_ip`, `user_proxy`)",
515
-        ], ! $updater->isIndexExists('security_player_entry', 'I_player_entry_unique'));
515
+        ], !$updater->isIndexExists('security_player_entry', 'I_player_entry_unique'));
516 516
         // Filling `security_player_entry` from temp table
517 517
         $updater->upd_do_query(
518 518
           "INSERT IGNORE INTO `{{security_player_entry}}` (`device_id`, `browser_id`, `user_ip`, `user_proxy`, `first_visit`)
Please login to merge, or discard this patch.
includes/includes/flt_page1.inc 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,18 +7,18 @@  discard block
 block discarded – undo
7 7
 use Fleet\DbFleetStatic;
8 8
 use Planet\DBStaticPlanet;
9 9
 
10
-if(SN_IN_FLEET !== true) {
10
+if (SN_IN_FLEET !== true) {
11 11
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
12 12
 }
13 13
 
14 14
 $template = gettemplate('fleet1', true);
15 15
 
16 16
 $ships = sys_get_param('ships', array());
17
-if(!is_array($ships)) {
17
+if (!is_array($ships)) {
18 18
   $ships = array();
19 19
 }
20 20
 
21
-foreach(array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) {
21
+foreach (array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) {
22 22
   $template->assign_block_vars('possible_planet_type_id', array(
23 23
     'ID' => $possible_planet_type_id,
24 24
     'NAME' => $lang['sys_planet_type_sh'][$possible_planet_type_id],
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
   'START_NAME'         => $planetrow['name'],
32 32
 );
33 33
 
34
-if(!empty($TargetPlanet)) {
34
+if (!empty($TargetPlanet)) {
35 35
   $template_route += array(
36 36
     'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']],
37 37
     'END_COORDS'       => uni_render_coordinates($TargetPlanet),
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 $template->assign_block_vars('fleets', $template_route);
43 43
 
44 44
 $sn_groups_fleet = sn_get_groups('fleet');
45
-foreach($ships as $ship_id => $ship_count) {
46
-  if(in_array($ship_id, $sn_groups_fleet) && $ship_count) {
45
+foreach ($ships as $ship_id => $ship_count) {
46
+  if (in_array($ship_id, $sn_groups_fleet) && $ship_count) {
47 47
     $ship_info = get_unit_param($ship_id);
48
-    if($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) {
48
+    if ($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) {
49 49
       $page .= $lang['fl_noenought'];
50 50
     } else {
51 51
       $fleet['fleetarray'][$ship_id]  = $ship_count;
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
   }
65 65
 }
66 66
 
67
-if(empty($fleet['fleetarray'])) {
67
+if (empty($fleet['fleetarray'])) {
68 68
   messageBox($lang['fl_err_no_ships'], $lang['fl_error'], 'fleet' . DOT_PHP_EX, 5);
69 69
 }
70 70
 
71 71
 // Building list of shortcuts
72 72
 $query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `galaxy` <> 0 AND `system` <> 0 AND `planet` <> 0 ORDER BY `priority` DESC, `galaxy`, `system`, `planet`, `planet_type`;");
73
-while($shortcut = db_fetch($query)) {
73
+while ($shortcut = db_fetch($query)) {
74 74
   $template->assign_block_vars('shortcut', array(
75 75
     'NAME'       => $shortcut['title'],
76 76
     'GALAXY'     => $shortcut['galaxy'],
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 }
85 85
 
86 86
 // Building list of own planets & moons
87
-$colonies = DBStaticPlanet::db_planet_list_sorted ( $user );
88
-if(count($colonies) > 1) {
87
+$colonies = DBStaticPlanet::db_planet_list_sorted($user);
88
+if (count($colonies) > 1) {
89 89
   // while($row = db_fetch($colonies))
90
-  foreach($colonies as $row) {
90
+  foreach ($colonies as $row) {
91 91
     $template->assign_block_vars('colonies', array(
92 92
       'NAME'       => $row['name'],
93 93
       'GALAXY'     => $row['galaxy'],
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 //ACS Start
103 103
 //Need to look for acs attacks.
104 104
 $aks_madnessred = DbFleetStatic::dbAcsGetAll();
105
-while($row = db_fetch($aks_madnessred)) {
105
+while ($row = db_fetch($aks_madnessred)) {
106 106
   $members = explode(',', $row['eingeladen']);
107
-  foreach($members as $a => $b) {
107
+  foreach ($members as $a => $b) {
108 108
     if ($b == $user['id']) {
109 109
       $template->assign_block_vars('acss', array(
110 110
         'ID'         => $row['id'],
Please login to merge, or discard this patch.
includes/includes/flt_page3.inc 2 patches
Spacing   +41 added lines, -42 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use Planet\DBStaticPlanet;
9 9
 use Unit\DBStaticUnit;
10 10
 
11
-if(SN_IN_FLEET !== true) {
11
+if (SN_IN_FLEET !== true) {
12 12
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
13 13
 }
14 14
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     $errorlist .= $lang['fl_limit_galaxy'];
28 28
   if (!$system || $system > $config->game_maxSystem || $system < 1)
29 29
     $errorlist .= $lang['fl_limit_system'];
30
-  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE ))
30
+  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE))
31 31
     $errorlist .= $lang['fl_limit_planet'];
32 32
   if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type)
33 33
     $errorlist .= $lang['fl_ownpl_err'];
@@ -54,35 +54,35 @@  discard block
 block discarded – undo
54 54
   $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true);
55 55
 
56 56
   if ($target_mission == MT_EXPLORE) {
57
-    if ($MaxExpeditions == 0 ) {
57
+    if ($MaxExpeditions == 0) {
58 58
       $errorlist .= $lang['fl_expe_notech'];
59
-    } elseif ($FlyingExpeditions >= $MaxExpeditions ) {
59
+    } elseif ($FlyingExpeditions >= $MaxExpeditions) {
60 60
       $errorlist .= $lang['fl_expe_max'];
61 61
     }
62 62
   } else {
63
-    if ($TargetPlanet['id_owner']){
63
+    if ($TargetPlanet['id_owner']) {
64 64
       if ($target_mission == MT_COLONIZE)
65 65
         $errorlist .= $lang['fl_colonized'];
66 66
 
67
-      if ($TargetPlanet['id_owner'] == $planetrow['id_owner']){
67
+      if ($TargetPlanet['id_owner'] == $planetrow['id_owner']) {
68 68
         if ($target_mission == MT_ATTACK)
69 69
           $errorlist .= $lang['fl_no_self_attack'];
70 70
 
71 71
         if ($target_mission == MT_SPY)
72 72
           $errorlist .= $lang['fl_no_self_spy'];
73
-      }else{
73
+      } else {
74 74
         if ($target_mission == MT_RELOCATE)
75 75
           $errorlist .= $lang['fl_only_stay_at_home'];
76 76
       }
77
-    }else{
78
-      if ($target_mission < MT_COLONIZE){
77
+    } else {
78
+      if ($target_mission < MT_COLONIZE) {
79 79
         $errorlist .= $lang['fl_unknow_target'];
80
-      }else{
80
+      } else {
81 81
         if ($target_mission == MT_DESTROY)
82 82
           $errorlist .= $lang['fl_nomoon'];
83 83
 
84
-        if ($target_mission == MT_RECYCLE){
85
-          if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0)
84
+        if ($target_mission == MT_RECYCLE) {
85
+          if ($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0)
86 86
             $errorlist .= $lang['fl_nodebris'];
87 87
         }
88 88
       }
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
   }
91 91
 
92 92
 
93
-  if(is_object($captainModule = moduleCaptain()) && $captain_id = sys_get_param_id('captain_id')) {
93
+  if (is_object($captainModule = moduleCaptain()) && $captain_id = sys_get_param_id('captain_id')) {
94 94
     $captain = $captainModule->unit_captain_get($planetrow['id']);
95 95
 //      mrc_get_level($user, $planetrow, UNIT_CAPTAIN, true);
96
-    if(!$captain) {
96
+    if (!$captain) {
97 97
       $errorlist .= $lang['module_unit_captain_error_no_captain'];
98
-    } elseif($captain['unit_location_type'] == LOC_PLANET) {
99
-      if($target_mission == MT_RELOCATE && ($arriving_captain = mrc_get_level($user, $TargetPlanet, UNIT_CAPTAIN, true))) {
98
+    } elseif ($captain['unit_location_type'] == LOC_PLANET) {
99
+      if ($target_mission == MT_RELOCATE && ($arriving_captain = mrc_get_level($user, $TargetPlanet, UNIT_CAPTAIN, true))) {
100 100
         $errorlist .= $lang['module_unit_captain_error_captain_already_bound'];
101 101
       }
102 102
     } else {
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 
107 107
   if ($errorlist) {
108 108
     sn_db_transaction_rollback();
109
-    messageBox ("<span class='error'><ul>{$errorlist}</ul></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, false);
109
+    messageBox("<span class='error'><ul>{$errorlist}</ul></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, false);
110 110
   }
111 111
 
112 112
   // On verifie s'il y a assez de vaisseaux sur la planete !
113 113
   foreach ($fleetarray as $Ship => $Count) {
114 114
     if ($Count > mrc_get_level($user, $planetrow, $Ship)) {
115
-      messageBox ("<span class='error'><b>{$lang['fl_fleet_err']}</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
115
+      messageBox("<span class='error'><b>{$lang['fl_fleet_err']}</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
116 116
     }
117 117
   }
118 118
 
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
   $fleet_group = max(0, intval($_POST['fleet_group']));
121 121
   //But is it acs??
122 122
   //Well all acs fleets must have a fleet code.
123
-  if($fleet_group) {
123
+  if ($fleet_group) {
124 124
     //Also it must be mission type 2
125 125
     $target_mission = MT_AKS;
126 126
 
127 127
     //The co-ords must be the same as where the acs fleet is going.
128 128
     $target = "g{$galaxy}s{$system}p{$planet}t{$planet_type}";
129
-    if($_POST['acs_target_mr'] == $target) {
129
+    if ($_POST['acs_target_mr'] == $target) {
130 130
       //ACS attack must exist (if acs fleet has arrived this will also return false (2 checks in 1!!!)
131 131
       $aks = DbFleetStatic::dbAcsGetById($fleet_group);
132 132
       if (!$aks) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     }
143 143
   }
144 144
   //Check that a failed acs attack isn't being sent, if it is, make it an attack fleet.
145
-  if(!$fleet_group && $target_mission == MT_AKS) {
145
+  if (!$fleet_group && $target_mission == MT_AKS) {
146 146
     $target_mission = MT_ATTACK;
147 147
   }
148 148
 
@@ -152,22 +152,21 @@  discard block
 block discarded – undo
152 152
   $options = [P_FLEET_ATTACK_SPEED_PERCENT_TENTH => $speed_percent, P_FLEET_ATTACK_FLEET_GROUP => $fleet_group, P_FLEET_ATTACK_RESOURCES_SUM => $StorageNeeded];
153 153
   $cant_attack = flt_can_attack($planetrow, $TargetPlanet, $fleetarray, $target_mission, $options);
154 154
 
155
-  if($cant_attack !== ATTACK_ALLOWED) {
155
+  if ($cant_attack !== ATTACK_ALLOWED) {
156 156
     messageBox("<span class='error'><b>{$lang['fl_attack_error'][$cant_attack]}</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 99);
157 157
   }
158 158
 
159 159
   $speed_possible = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
160 160
   if (!in_array($speed_percent, $speed_possible)) {
161
-    messageBox ("<span class='error'><b>". $lang['fl_cheat_speed'] ."</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
161
+    messageBox("<span class='error'><b>" . $lang['fl_cheat_speed'] . "</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
162 162
   }
163 163
 
164 164
   $fleet['start_time'] = $duration + SN_TIME_NOW;
165 165
 
166
-  $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) :
167
-    ($target_mission == MT_HOLD ? 12 : 0);
168
-  if($max_duration) {
166
+  $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : ($target_mission == MT_HOLD ? 12 : 0);
167
+  if ($max_duration) {
169 168
     $StayDuration = sys_get_param_id('missiontime');
170
-    if($StayDuration > $max_duration || $StayDuration < 1) {
169
+    if ($StayDuration > $max_duration || $StayDuration < 1) {
171 170
       $debug->warning('Supplying wrong mission time', 'Hack attempt', 302, array('base_dump' => true));
172 171
       die();
173 172
     }
@@ -177,11 +176,11 @@  discard block
 block discarded – undo
177 176
     $StayDuration = 0;
178 177
     $StayTime     = 0;
179 178
   }
180
-  $fleet['end_time']   = $StayDuration + (2 * $duration) + SN_TIME_NOW;
179
+  $fleet['end_time'] = $StayDuration + (2 * $duration) + SN_TIME_NOW;
181 180
 
182
-  if($aks && $target_mission == MT_AKS) {
183
-    if ($fleet['start_time']>$aks['ankunft']) {
184
-      messageBox ($lang['fl_aks_too_slow'] . 'Fleet arrival: ' . date(FMT_DATE_TIME,$fleet['start_time']) . " AKS arrival: " .date(FMT_DATE_TIME,$aks['ankunft']), $lang['fl_error']);
181
+  if ($aks && $target_mission == MT_AKS) {
182
+    if ($fleet['start_time'] > $aks['ankunft']) {
183
+      messageBox($lang['fl_aks_too_slow'] . 'Fleet arrival: ' . date(FMT_DATE_TIME, $fleet['start_time']) . " AKS arrival: " . date(FMT_DATE_TIME, $aks['ankunft']), $lang['fl_error']);
185 184
     }
186 185
     $fleet['start_time'] = $aks['ankunft'];
187 186
     $fleet['end_time'] = $aks['ankunft'] + $duration;
@@ -191,21 +190,21 @@  discard block
 block discarded – undo
191 190
   $FleetShipCount      = 0;
192 191
   $db_changeset = array();
193 192
   foreach ($fleetarray as $Ship => $Count) {
194
-    $FleetStorage    += get_unit_param($Ship, P_CAPACITY) * $Count;
193
+    $FleetStorage += get_unit_param($Ship, P_CAPACITY) * $Count;
195 194
     $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($Ship, -$Count, $user, $planetrow['id']);
196 195
   }
197 196
   $fleet_array = sys_unit_arr2str($fleetarray);
198
-  $FleetShipCount  += array_sum($fleetarray);
199
-  $FleetStorage        -= $consumption;
197
+  $FleetShipCount += array_sum($fleetarray);
198
+  $FleetStorage -= $consumption;
200 199
 
201
-  if ( $StorageNeeded > $FleetStorage) {
202
-    messageBox ("<span class='error'><b>". $lang['fl_nostoragespa'] . HelperString::numberFloorAndFormat($StorageNeeded - $FleetStorage) ."</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
200
+  if ($StorageNeeded > $FleetStorage) {
201
+    messageBox("<span class='error'><b>" . $lang['fl_nostoragespa'] . HelperString::numberFloorAndFormat($StorageNeeded - $FleetStorage) . "</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
203 202
   }
204 203
   if ($planetrow['deuterium'] < $TransDeuterium + $consumption) {
205
-    messageBox ("<font color=\"red\"><b>". $lang['fl_no_deuterium'] . HelperString::numberFloorAndFormat($TransDeuterium + $consumption - $planetrow['deuterium']) ."</b></font>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
204
+    messageBox("<font color=\"red\"><b>" . $lang['fl_no_deuterium'] . HelperString::numberFloorAndFormat($TransDeuterium + $consumption - $planetrow['deuterium']) . "</b></font>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
206 205
   }
207 206
   if (($planetrow['metal'] < $TransMetal) || ($planetrow['crystal'] < $TransCrystal)) {
208
-    messageBox ("<font color=\"red\"><b>". $lang['fl_no_resources'] ."</b></font>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
207
+    messageBox("<font color=\"red\"><b>" . $lang['fl_no_resources'] . "</b></font>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
209 208
   }
210 209
 
211 210
   $fleet_set = array(
@@ -247,7 +246,7 @@  discard block
 block discarded – undo
247 246
 //    ));
248 247
 //  }
249 248
 
250
-  if(is_array($captain)) {
249
+  if (is_array($captain)) {
251 250
     DBStaticUnit::db_unit_set_by_id($captain['unit_id'], "`unit_location_type` = " . LOC_FLEET . ", `unit_location_id` = {$fleet_id}");
252 251
   }
253 252
 
@@ -260,7 +259,7 @@  discard block
 block discarded – undo
260 259
     'START_LEFT'         => floor($fleet['end_time'] + 1 - SN_TIME_NOW),
261 260
   );
262 261
 
263
-  if(!empty($TargetPlanet)) {
262
+  if (!empty($TargetPlanet)) {
264 263
     $template_route += array(
265 264
       'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']],
266 265
       'END_COORDS'       => uni_render_coordinates($TargetPlanet),
@@ -273,8 +272,8 @@  discard block
 block discarded – undo
273 272
   $template->assign_block_vars('fleets', $template_route);
274 273
 
275 274
   $sn_groups_fleet = sn_get_groups('fleet');
276
-  foreach($fleetarray as $ship_id => $ship_count) {
277
-    if(in_array($ship_id, $sn_groups_fleet) && $ship_count) {
275
+  foreach ($fleetarray as $ship_id => $ship_count) {
276
+    if (in_array($ship_id, $sn_groups_fleet) && $ship_count) {
278 277
 //      $ship_base_data = get_ship_data($ship_id, $user);
279 278
       $template->assign_block_vars('fleets.ships', array(
280 279
         'ID'          => $ship_id,
Please login to merge, or discard this patch.
Braces   +41 added lines, -30 removed lines patch added patch discarded remove patch
@@ -23,18 +23,24 @@  discard block
 block discarded – undo
23 23
 
24 24
   // Test de coherance de la destination (voir si elle se trouve dans les limites de l'univers connu
25 25
   $errorlist = '';
26
-  if (!$galaxy || $galaxy > $config->game_maxGalaxy || $galaxy < 1)
27
-    $errorlist .= $lang['fl_limit_galaxy'];
28
-  if (!$system || $system > $config->game_maxSystem || $system < 1)
29
-    $errorlist .= $lang['fl_limit_system'];
30
-  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE ))
31
-    $errorlist .= $lang['fl_limit_planet'];
32
-  if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type)
33
-    $errorlist .= $lang['fl_ownpl_err'];
34
-  if (!$planet_type)
35
-    $errorlist .= $lang['fl_no_planettype'];
36
-  if ($planet_type != PT_PLANET && $planet_type != PT_DEBRIS && $planet_type != PT_MOON)
37
-    $errorlist .= $lang['fl_fleet_err_pl'];
26
+  if (!$galaxy || $galaxy > $config->game_maxGalaxy || $galaxy < 1) {
27
+      $errorlist .= $lang['fl_limit_galaxy'];
28
+  }
29
+  if (!$system || $system > $config->game_maxSystem || $system < 1) {
30
+      $errorlist .= $lang['fl_limit_system'];
31
+  }
32
+  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE )) {
33
+      $errorlist .= $lang['fl_limit_planet'];
34
+  }
35
+  if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type) {
36
+      $errorlist .= $lang['fl_ownpl_err'];
37
+  }
38
+  if (!$planet_type) {
39
+      $errorlist .= $lang['fl_no_planettype'];
40
+  }
41
+  if ($planet_type != PT_PLANET && $planet_type != PT_DEBRIS && $planet_type != PT_MOON) {
42
+      $errorlist .= $lang['fl_fleet_err_pl'];
43
+  }
38 44
   if (empty($missiontype[$target_mission])) {
39 45
     $errorlist .= $lang['fl_bad_mission'];
40 46
   }
@@ -61,29 +67,35 @@  discard block
 block discarded – undo
61 67
     }
62 68
   } else {
63 69
     if ($TargetPlanet['id_owner']){
64
-      if ($target_mission == MT_COLONIZE)
65
-        $errorlist .= $lang['fl_colonized'];
70
+      if ($target_mission == MT_COLONIZE) {
71
+              $errorlist .= $lang['fl_colonized'];
72
+      }
66 73
 
67 74
       if ($TargetPlanet['id_owner'] == $planetrow['id_owner']){
68
-        if ($target_mission == MT_ATTACK)
69
-          $errorlist .= $lang['fl_no_self_attack'];
70
-
71
-        if ($target_mission == MT_SPY)
72
-          $errorlist .= $lang['fl_no_self_spy'];
73
-      }else{
74
-        if ($target_mission == MT_RELOCATE)
75
-          $errorlist .= $lang['fl_only_stay_at_home'];
75
+        if ($target_mission == MT_ATTACK) {
76
+                  $errorlist .= $lang['fl_no_self_attack'];
77
+        }
78
+
79
+        if ($target_mission == MT_SPY) {
80
+                  $errorlist .= $lang['fl_no_self_spy'];
81
+        }
82
+      } else{
83
+        if ($target_mission == MT_RELOCATE) {
84
+                  $errorlist .= $lang['fl_only_stay_at_home'];
85
+        }
76 86
       }
77
-    }else{
87
+    } else{
78 88
       if ($target_mission < MT_COLONIZE){
79 89
         $errorlist .= $lang['fl_unknow_target'];
80
-      }else{
81
-        if ($target_mission == MT_DESTROY)
82
-          $errorlist .= $lang['fl_nomoon'];
90
+      } else{
91
+        if ($target_mission == MT_DESTROY) {
92
+                  $errorlist .= $lang['fl_nomoon'];
93
+        }
83 94
 
84 95
         if ($target_mission == MT_RECYCLE){
85
-          if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0)
86
-            $errorlist .= $lang['fl_nodebris'];
96
+          if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0) {
97
+                      $errorlist .= $lang['fl_nodebris'];
98
+          }
87 99
         }
88 100
       }
89 101
     }
@@ -131,8 +143,7 @@  discard block
 block discarded – undo
131 143
       $aks = DbFleetStatic::dbAcsGetById($fleet_group);
132 144
       if (!$aks) {
133 145
         $fleet_group = 0;
134
-      }
135
-      else
146
+      } else
136 147
       {
137 148
         $galaxy = $aks['galaxy'];
138 149
         $system = $aks['system'];
Please login to merge, or discard this patch.
includes/includes/flt_functions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
       return $result = ATTACK_ACS_TOO_LATE;
365 365
     }
366 366
 
367
-    if(DbFleetStatic::acsIsAcsFull($acs['id'])) {
367
+    if (DbFleetStatic::acsIsAcsFull($acs['id'])) {
368 368
       return $result = ATTACK_ACS_MAX_FLEETS;
369 369
     }
370 370
   }
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 
549 549
 
550 550
   !is_array($resources) ? $resources = [] : false;
551
-  if(empty($options[P_FLEET_ATTACK_RES_LIST])) {
551
+  if (empty($options[P_FLEET_ATTACK_RES_LIST])) {
552 552
     $options[P_FLEET_ATTACK_RES_LIST] = $resources;
553 553
   }
554 554
   $can_attack = flt_can_attack($from, $to, $fleet, $mission, $options);
Please login to merge, or discard this patch.
includes/includes/flt_page4.inc 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,18 +3,18 @@  discard block
 block discarded – undo
3 3
 use Fleet\DbFleetStatic;
4 4
 use Planet\DBStaticPlanet;
5 5
 
6
-if(SN_IN_FLEET !== true) {
6
+if (SN_IN_FLEET !== true) {
7 7
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
8 8
 }
9 9
 
10 10
 $fleetid = sys_get_param_id('fleetid');
11 11
 
12
-if(!is_numeric($fleetid) || empty($fleetid)) {
12
+if (!is_numeric($fleetid) || empty($fleetid)) {
13 13
   sys_redirect("fleet.php");
14 14
 }
15 15
 
16 16
 $fleet = DbFleetStatic::db_fleet_get($fleetid);
17
-if(!$fleet) {
17
+if (!$fleet) {
18 18
   messageBox($lang['fl_fleet_not_exists'], $lang['fl_error']);
19 19
 }
20 20
 
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
   messageBox($lang['fl_isback'], $lang['fl_error']);
23 23
 }
24 24
 
25
-if($fleet['fleet_owner'] != $user['id']) {
26
-  $debug->warning($lang['fl_aks_hack_wrong_fleet'],'Wrong Fleet Owner',301);
25
+if ($fleet['fleet_owner'] != $user['id']) {
26
+  $debug->warning($lang['fl_aks_hack_wrong_fleet'], 'Wrong Fleet Owner', 301);
27 27
   messageBox($lang['fl_aks_hack_wrong_fleet'], $lang['fl_error']);
28 28
 }
29 29
 
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
   'MISSION_NAME' => $lang['type_mission'][MT_AKS],
58 58
 ));
59 59
 
60
-if($aks['eingeladen'] && is_array($members = SN::db_get_record_list(LOC_USER, "`id` in ({$aks['eingeladen']})")) && !empty($members)) {
61
-  foreach($members as $row) {
60
+if ($aks['eingeladen'] && is_array($members = SN::db_get_record_list(LOC_USER, "`id` in ({$aks['eingeladen']})")) && !empty($members)) {
61
+  foreach ($members as $row) {
62 62
     $template->assign_block_vars('invited', array(
63 63
       'NAME' => $row['username'],
64 64
     ));
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 $i++;
69 69
 $fleet_row = DbFleetStatic::db_fleet_get($fleetid);
70 70
 
71
-if(is_array($fleet_row) && !empty($fleet_row)) {
71
+if (is_array($fleet_row) && !empty($fleet_row)) {
72 72
 $planet_start = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_start_planet_id']);
73 73
 $fleet_row['fleet_start_name'] = !empty($planet_start['name']) ? $planet_start['name'] : '';
74 74
 $planet_end = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_end_planet_id']);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
 $fleet_data = tpl_parse_fleet_db($fleet_row, $i, $user);
78 78
 $template->assign_block_vars('fleets', $fleet_data['fleet']);
79
-foreach($fleet_data['ships'] as $ship_data) {
79
+foreach ($fleet_data['ships'] as $ship_data) {
80 80
   $template->assign_block_vars('fleets.ships', $ship_data);
81 81
 }
82 82
 }
Please login to merge, or discard this patch.
includes/constants/constants_units.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -361,10 +361,10 @@
 block discarded – undo
361 361
 
362 362
 
363 363
 define('GROUP_PART',         800000); // Зарезервировано для запчастей: 800.001 - 899.999
364
- define('GROUP_PART_HULL',    801000); // Корпуса - 1000 штук
365
- define('GROUP_PART_ARMOR',   802000); // Броня - 1000 штук
366
- define('GROUP_PART_SHIELD',  803000); // Щиты - 1000 штук
367
- define('GROUP_PART_WEAPON',  810000); // Оружие - 10000 штук
364
+  define('GROUP_PART_HULL',    801000); // Корпуса - 1000 штук
365
+  define('GROUP_PART_ARMOR',   802000); // Броня - 1000 штук
366
+  define('GROUP_PART_SHIELD',  803000); // Щиты - 1000 штук
367
+  define('GROUP_PART_WEAPON',  810000); // Оружие - 10000 штук
368 368
 
369 369
 
370 370
 define('UNIT_GROUP', 'groups'); // 900.000 // Зарезервировано для груп юнитов: 900.001 - 999.999
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 // === Artifacts
162 162
 define('UNIT_ARTIFACTS_STR', 'artifacts');
163 163
 define('UNIT_ARTIFACTS', 1000);
164
-define('ART_LHC', 1001);      // Additional moon chance
165
-define('ART_RCD_SMALL', 1002);   // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
166
-define('ART_RCD_MEDIUM', 1003);  // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
167
-define('ART_RCD_LARGE', 1004);   // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
164
+define('ART_LHC', 1001); // Additional moon chance
165
+define('ART_RCD_SMALL', 1002); // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
166
+define('ART_RCD_MEDIUM', 1003); // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
167
+define('ART_RCD_LARGE', 1004); // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
168 168
 define('ART_HEURISTIC_CHIP', 1005); // Speed up research
169 169
 define('ART_NANO_BUILDER', 1006); // Speed up building
170 170
 define('ART_NANO_CONSTRUCTOR', 1007); // RESERVED Speed up hangar constructions
@@ -238,25 +238,25 @@  discard block
 block discarded – undo
238 238
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE1', 2201); // Блиц-сервер, участник 0-го раунда, 1-е место
239 239
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE2', 2202); // Блиц-сервер, участник 0-го раунда, 2-е место
240 240
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE3', 2203); // Блиц-сервер, участник 0-го раунда, 3-е место
241
-define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204);  // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
242
-define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_BEST', 2205);  // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2017 года
243
-define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_QUEEN', 2206);  // Медаль Королевы Весны за максимум полученной ММ/максимум полученных подарков от Мужчины во время ивента 8 марта 2017 года
241
+define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
242
+define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_BEST', 2205); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2017 года
243
+define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_QUEEN', 2206); // Медаль Королевы Весны за максимум полученной ММ/максимум полученных подарков от Мужчины во время ивента 8 марта 2017 года
244 244
 define('UNIT_AWARD_MEDAL_8_MARCH_BEST_CAVALIER_AMOUNT', 2207); // Медаль Лучшему Кавалеру за максимум потраченной ММ Женщине от Мужчины во время ивента 8 марта 2017 года
245 245
 define('UNIT_AWARD_MEDAL_8_MARCH_BEST_CAVALIER_COUNT', 2208); // Медаль Лучшему Кавалеру за максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2017 года
246 246
 define('UNIT_AWARD_MEDAL_8_MARCH_SPRING_QUEEN_AMOUNT', 2209); // Медаль Королевы Весны за максимум полученной ММ от Мужчины во время ивента 8 марта 2017 года
247 247
 define('UNIT_AWARD_MEDAL_8_MARCH_SPRING_QUEEN_COUNT', 2210); // Медаль Королевы Весны за максимум полученных подарков от Мужчины во время ивента 8 марта 2017 года
248 248
 
249 249
 define('UNIT_AWARD_MEMORY', 2300); // Памятные знаки за существование и участие - например "4 года в игре". "Был онлайн в новогоднюю ночь 2013". итд
250
-define('UNIT_AWARD_MEMORY_IMMORTAL', 2301);  // Бессмертный
251
-define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
250
+define('UNIT_AWARD_MEMORY_IMMORTAL', 2301); // Бессмертный
251
+define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
252 252
 define('UNIT_AWARD_MEMORY_BLITZ_R0', 2303); // Блиц-сервер, участник 0-го раунда
253 253
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SIMPLE', 2304); // День Рождения СН
254 254
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_BRONZE', 2305); // День Рождения СН
255 255
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SILVER', 2306); // День Рождения СН
256 256
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_GOLD', 2307); // День Рождения СН
257 257
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_PLATINUM', 2308); // День Рождения СН
258
-define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
259
-define('UNIT_AWARD_MEMORY_2017_WOMEN_DAY', 2310);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2017 года
258
+define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
259
+define('UNIT_AWARD_MEMORY_2017_WOMEN_DAY', 2310); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2017 года
260 260
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_SIMPLE', 2311); // День Рождения СН - 2017
261 261
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_BRONZE', 2312); // День Рождения СН - 2017
262 262
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_SILVER', 2313); // День Рождения СН - 2017
@@ -360,19 +360,19 @@  discard block
 block discarded – undo
360 360
 const GROUP_UNIT_OBJECTS_IN_SPACE = 790002;
361 361
 
362 362
 
363
-define('GROUP_PART',         800000); // Зарезервировано для запчастей: 800.001 - 899.999
364
- define('GROUP_PART_HULL',    801000); // Корпуса - 1000 штук
365
- define('GROUP_PART_ARMOR',   802000); // Броня - 1000 штук
366
- define('GROUP_PART_SHIELD',  803000); // Щиты - 1000 штук
367
- define('GROUP_PART_WEAPON',  810000); // Оружие - 10000 штук
363
+define('GROUP_PART', 800000); // Зарезервировано для запчастей: 800.001 - 899.999
364
+ define('GROUP_PART_HULL', 801000); // Корпуса - 1000 штук
365
+ define('GROUP_PART_ARMOR', 802000); // Броня - 1000 штук
366
+ define('GROUP_PART_SHIELD', 803000); // Щиты - 1000 штук
367
+ define('GROUP_PART_WEAPON', 810000); // Оружие - 10000 штук
368 368
 
369 369
 
370 370
 define('UNIT_GROUP', 'groups'); // 900.000 // Зарезервировано для груп юнитов: 900.001 - 999.999
371
-define('GROUP_UNIT_USER', 1000000);// Зарезервировано для пользовательских юнитов: 1.000.001 - 1.999.999
372
-define('GROUP_ID_RESERVED', 2000000);// Зарезервировано для прочих нужд: 2.000.000 - 1.999.999.999
371
+define('GROUP_UNIT_USER', 1000000); // Зарезервировано для пользовательских юнитов: 1.000.001 - 1.999.999
372
+define('GROUP_ID_RESERVED', 2000000); // Зарезервировано для прочих нужд: 2.000.000 - 1.999.999.999
373 373
 const UNIT_CAN_NOT_BE_BUILD = 2000001; // Юнит не может быть построен - для спецюнитов
374
-define('GROUP_PARAMS', 1000000000);// Зарезервировано для параметров: 1.000.000.001 - 1.999.999.999
375
-define('GROUP_DEVELOPERS', 2000000000);// Пространство для разработчиков: 2.000.000.001 - 2.147.483.647
374
+define('GROUP_PARAMS', 1000000000); // Зарезервировано для параметров: 1.000.000.001 - 1.999.999.999
375
+define('GROUP_DEVELOPERS', 2000000000); // Пространство для разработчиков: 2.000.000.001 - 2.147.483.647
376 376
 
377 377
 define('UNIT_PLAYER_COLONIES_CURRENT', 'COLONIES_CURRENT');
378 378
 define('UNIT_PLAYER_COLONIES_MAX', 'COLONIES_MAX');
Please login to merge, or discard this patch.
admin/ajax_maintenance.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1));
6 6
 
7
-if($user['authlevel'] < 3)
7
+if ($user['authlevel'] < 3)
8 8
 {
9 9
   messageBox($lang['sys_noalloaw'], $lang['sys_noaccess']);
10 10
   die();
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 // [#] info_best_battles 1b0
21 21
 $best_reports = array();
22
-if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
22
+if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
23 23
   $query = doquery(MODULE_INFO_BEST_BATTLES_QUERY);
24
-  while($row = db_fetch($query)) {
24
+  while ($row = db_fetch($query)) {
25 25
     $best_reports[] = $row['ube_report_id'];
26 26
   }
27 27
 }
@@ -188,16 +188,16 @@  discard block
 block discarded – undo
188 188
 
189 189
 function sn_maintenance_pack_user_list($user_list) {
190 190
   $user_list = explode(',', $user_list);
191
-  foreach($user_list as $key => $user_id) {
192
-    if(!is_numeric($user_id)) {
191
+  foreach ($user_list as $key => $user_id) {
192
+    if (!is_numeric($user_id)) {
193 193
       unset($user_list[$key]);
194 194
     }
195 195
   }
196 196
 
197 197
   $result = array();
198
-  if(!empty($user_list)) {
198
+  if (!empty($user_list)) {
199 199
     $query = doquery("SELECT `id` FROM `{{users}}` WHERE `id` in (" . implode(',', $user_list) . ")");
200
-    while($row = db_fetch($query)) {
200
+    while ($row = db_fetch($query)) {
201 201
       $result[] = $row['id'];
202 202
     }
203 203
   }
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
 $old_server_status == GAME_DISABLE_NONE ? SN::$config->pass()->game_disable = GAME_DISABLE_MAINTENANCE : false;
213 213
 sn_db_transaction_commit();
214 214
 
215
-foreach($ques as $que_transaction) {
215
+foreach ($ques as $que_transaction) {
216 216
   sn_db_transaction_start();
217 217
 
218 218
   !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false;
219
-  foreach($que_transaction as $que) {
219
+  foreach ($que_transaction as $que) {
220 220
     set_time_limit(120);
221 221
     $QryResult = doquery($que);
222 222
     //$msg .= '<hr>' . $que . '<hr>';
Please login to merge, or discard this patch.
admin/admin_analyze_matter.php 1 patch
Spacing   +8 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 $constants = get_defined_constants(true);
17 17
 $rpgConstants = array();
18
-foreach($constants['user'] as $constantName => $constantValue) {
19
-  if(substr($constantName, 0, 4) == 'RPG_') {
18
+foreach ($constants['user'] as $constantName => $constantValue) {
19
+  if (substr($constantName, 0, 4) == 'RPG_') {
20 20
     $rpgConstants[$constantValue] = $constantName;
21 21
   }
22 22
 }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
   GROUP BY log_dark_matter_reason, IF(sign((log_dark_matter_amount)) > 0, 1, -1) ORDER BY sum(log_dark_matter_amount) DESC;"
35 35
 );
36 36
 
37
-while($row = SN::$db->db_fetch($result)) {
37
+while ($row = SN::$db->db_fetch($result)) {
38 38
   $row['CONSTANT'] = $rpgConstants[$row['REASON']];
39 39
 
40 40
   $row['DM_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['DM_AMOUNT']);
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
   GROUP BY reason, if(sign((amount)) > 0, 1, -1) ORDER BY sum(amount) DESC;"
58 58
 );
59 59
 
60
-while($row = SN::$db->db_fetch($result)) {
61
-  if(empty($spent[$row['BALANCE']])) {
60
+while ($row = SN::$db->db_fetch($result)) {
61
+  if (empty($spent[$row['BALANCE']])) {
62 62
     $spent[$row['BALANCE']] = array();
63 63
   }
64 64
 
@@ -68,16 +68,15 @@  discard block
 block discarded – undo
68 68
   $spent[$row['BALANCE']] = array_merge_recursive_numeric($spent[$row['BALANCE']], $row);
69 69
 }
70 70
 
71
-foreach($spent as &$row) {
71
+foreach ($spent as &$row) {
72 72
   @$row['TOTAL_COUNT'] = $row['MM_COUNT'] + $row['DM_COUNT'];
73 73
   @$row['TOTAL_AMOUNT'] = $row['MM_AMOUNT'] + $row['DM_AMOUNT'];
74 74
   @$row['TOTAL_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_AMOUNT']);
75 75
   @$row['TOTAL_COUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_COUNT']);
76 76
 }
77 77
 
78
-usort($spent, function ($a, $b) {
79
-  return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 :
80
-    ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0);
78
+usort($spent, function($a, $b) {
79
+  return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 : ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0);
81 80
 });
82 81
 
83 82
 
Please login to merge, or discard this patch.