Completed
Push — work-fleets ( 9e987d...ec9dc8 )
by SuperNova.WS
06:04
created
includes/classes/Common/Types.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
       break;
31 31
 
32 32
       case TYPE_ARRAY:
33
-        $value = (array)$value;
33
+        $value = (array) $value;
34 34
       break;
35 35
 
36 36
       case TYPE_STRING:
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
       case TYPE_EMPTY:
39 39
         // No-type defaults to string
40 40
       default:
41
-        $value = (string)$value;
41
+        $value = (string) $value;
42 42
       break;
43 43
     }
44 44
 
Please login to merge, or discard this patch.
includes/classes/DBStaticFleetMissile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
    * @return array|bool|mysqli_result|null
24 24
    */
25 25
   public static function db_missile_list_by_arrival() {
26
-    $iraks = classSupernova::$db->doSelect("SELECT * FROM `{{iraks}}` WHERE `fleet_end_time` <= " . SN_TIME_NOW . " FOR UPDATE;");
26
+    $iraks = classSupernova::$db->doSelect("SELECT * FROM `{{iraks}}` WHERE `fleet_end_time` <= ".SN_TIME_NOW." FOR UPDATE;");
27 27
 
28 28
     return $iraks;
29 29
   }
Please login to merge, or discard this patch.
includes/functions/qst_quest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     $template->assign_vars($quest_templatized);
180 180
     if (!empty($quest_templatized['quest_rewards_list'])) {
181 181
       foreach ($quest_templatized['quest_rewards_list'] as $quest_reward) {
182
-        $template->assign_block_vars(($block_name ? $block_name . '.' : '') . 'quest_rewards_list', $quest_reward);
182
+        $template->assign_block_vars(($block_name ? $block_name.'.' : '').'quest_rewards_list', $quest_reward);
183 183
       }
184 184
     }
185 185
   }
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
 
249 249
         $comment_reward = array();
250 250
         foreach ($reward_list as $unit_id => $unit_amount) {
251
-          $comment_reward[] = $unit_amount . ' ' . classLocale::$lang['tech'][$unit_id];
251
+          $comment_reward[] = $unit_amount.' '.classLocale::$lang['tech'][$unit_id];
252 252
           $total_rewards[$user_id][$planet_id][$unit_id] += $unit_amount;
253 253
         }
254
-        $comment .= " {$classLocale['qst_msg_your_reward']} " . implode(',', $comment_reward);
254
+        $comment .= " {$classLocale['qst_msg_your_reward']} ".implode(',', $comment_reward);
255 255
 
256 256
         DBStaticMessages::msg_send_simple_message($user['id'], 0, SN_TIME_NOW, MSG_TYPE_ADMIN, classLocale::$lang['msg_from_admin'], classLocale::$lang['qst_msg_complete_subject'], $comment);
257 257
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         if (!empty($resourcesChange)) {
291 291
           $planet_id = $planet_id == 0 && isset($user_row['id_planet']) ? $user_row['id_planet'] : $planet_id;
292
-          if($planet_id) {
292
+          if ($planet_id) {
293 293
             // update planet
294 294
             DBStaticPlanet::db_planet_update_resources($resourcesChange, $planet_id);
295 295
           } else {
Please login to merge, or discard this patch.
includes/functions/eco_queue.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 function que_get_unit_que($unit_id) {
4 4
   $que_type = false;
5
-  foreach(sn_get_groups('ques') as $que_id => $que_data) {
6
-    if(in_array($unit_id, $que_data['unit_list'])) {
5
+  foreach (sn_get_groups('ques') as $que_id => $que_data) {
6
+    if (in_array($unit_id, $que_data['unit_list'])) {
7 7
       $que_type = $que_id;
8 8
       break;
9 9
     }
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 
15 15
 
16 16
 function que_get_max_que_length($user, $planet, $que_id, $que_data = null) {
17
-  if(empty($que_data)) {
17
+  if (empty($que_data)) {
18 18
     $que_data = sn_get_groups('ques');
19 19
     $que_data = $que_data[$que_id];
20 20
   }
21 21
 
22 22
 
23 23
   $que_length = 1;
24
-  switch($que_id) {
24
+  switch ($que_id) {
25 25
     case QUE_RESEARCH:
26 26
       $que_length = classSupernova::$config->server_que_length_research + mrc_get_level($user, null, UNIT_PREMIUM); // TODO - вынести в модуль
27 27
     break;
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 
36 36
 function eco_que_str2arr($que_str) {
37 37
   $que_arr = explode(';', $que_str);
38
-  foreach($que_arr as $que_index => &$que_item) {
39
-    if($que_item) {
38
+  foreach ($que_arr as $que_index => &$que_item) {
39
+    if ($que_item) {
40 40
       $que_item = explode(',', $que_item);
41 41
     } else {
42 42
       unset($que_arr[$que_index]);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 }
48 48
 
49 49
 function eco_que_arr2str($que_arr) {
50
-  foreach($que_arr as &$que_item) {
50
+  foreach ($que_arr as &$que_item) {
51 51
     $que_item = implode(',', $que_item);
52 52
   }
53 53
 
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
   $classLocale = classLocale::$lang;
60 60
 
61 61
   $is_autoconvert = false;
62
-  if($build_mode == BUILD_AUTOCONVERT || sys_get_param_int('auto_convert')) {
62
+  if ($build_mode == BUILD_AUTOCONVERT || sys_get_param_int('auto_convert')) {
63 63
     $build_mode = BUILD_CREATE;
64 64
     $is_autoconvert = true;
65 65
   }
66 66
 
67 67
   $unit_amount_qued = 0;
68 68
   try {
69
-    if(!$user['id']) {
69
+    if (!$user['id']) {
70 70
       throw new exception('{Нет идентификатора пользователя - сообщите Администрации}', ERR_ERROR); // TODO EXCEPTION
71 71
     }
72 72
 
@@ -77,16 +77,16 @@  discard block
 block discarded – undo
77 77
       foreach($unit_list as $unit_id => $unit_amount) if($unit_amount) break;
78 78
     }
79 79
     */
80
-    if(!$unit_id) {
80
+    if (!$unit_id) {
81 81
       throw new exception('{Нет идентификатора юнита - сообщите Администрации}', ERR_ERROR); // TODO EXCEPTION
82 82
     }
83 83
 
84 84
     $que_id = que_get_unit_que($unit_id);
85
-    if(!$que_id) {
85
+    if (!$que_id) {
86 86
       throw new exception('{Неправильный тип очереди - сообщите Администрации}', ERR_ERROR); // TODO EXCEPTION
87 87
     }
88 88
 
89
-    if($build_mode == BUILD_DESTROY && $que_id != QUE_STRUCTURES) {
89
+    if ($build_mode == BUILD_DESTROY && $que_id != QUE_STRUCTURES) {
90 90
       throw new exception('{Уничтожать можно только здания на планете}', ERR_ERROR); // TODO EXCEPTION
91 91
     }
92 92
 
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
     $que_data = $que_data[$que_id];
95 95
 
96 96
     // TODO Переделать под подочереди
97
-    if($que_id == QUE_STRUCTURES) {
97
+    if ($que_id == QUE_STRUCTURES) {
98 98
       $sn_groups_build_allow = sn_get_groups('build_allow');
99 99
       $que_data['unit_list'] = $sn_groups_build_allow[$planet['planet_type']];
100 100
 
101
-      if(!isset($que_data['unit_list'][$unit_id])) {
102
-        throw new exception('{Это здание нельзя строить на ' . ($planet['planet_type'] == PT_PLANET ? 'планете' : 'луне'), ERR_ERROR); // TODO EXCEPTION
101
+      if (!isset($que_data['unit_list'][$unit_id])) {
102
+        throw new exception('{Это здание нельзя строить на '.($planet['planet_type'] == PT_PLANET ? 'планете' : 'луне'), ERR_ERROR); // TODO EXCEPTION
103 103
       }
104 104
     }
105 105
     /*
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     // Это нужно, что бы заблокировать пользователя и работу с очередями
120 120
     $user = DBStaticUser::db_user_by_id($user['id']);
121 121
     // Это нужно, что бы заблокировать планету от списания ресурсов
122
-    if(isset($planet['id']) && $planet['id']) {
122
+    if (isset($planet['id']) && $planet['id']) {
123 123
       $planet = DBStaticPlanet::db_planet_by_id($planet['id'], true);
124 124
     } else {
125 125
       $planet['id'] = 0;
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
     $in_que = &$que['in_que'][$que_id][$user['id']][$planet_id];
132 132
     $que_max_length = que_get_max_que_length($user, $planet, $que_id, $que_data);
133 133
     // TODO Добавить вызовы функций проверок текущей и максимальной длин очередей
134
-    if(count($in_que) >= $que_max_length) {
134
+    if (count($in_que) >= $que_max_length) {
135 135
       throw new exception('{Все слоты очереди заняты}', ERR_ERROR); // TODO EXCEPTION
136 136
     }
137 137
 
138 138
     // TODO Отдельно посмотреть на уничтожение зданий - что бы можно было уничтожать их без планов
139
-    switch(eco_can_build_unit($user, $planet, $unit_id)) {
139
+    switch (eco_can_build_unit($user, $planet, $unit_id)) {
140 140
       case BUILD_ALLOWED:
141 141
       break;
142 142
       case BUILD_UNIT_BUSY:
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
       break; // TODO EXCEPTION eco_bld_msg_err_laboratory_upgrading
145 145
       // case BUILD_REQUIRE_NOT_MEET:
146 146
       default:
147
-        if($build_mode == BUILD_CREATE) {
147
+        if ($build_mode == BUILD_CREATE) {
148 148
           throw new exception('{Требования не удовлетворены}', ERR_ERROR);
149 149
         }
150 150
       break; // TODO EXCEPTION eco_bld_msg_err_requirements_not_meet
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
     $unit_amount_qued = $unit_amount;
155 155
     $units_qued = isset($in_que[$unit_id]) ? $in_que[$unit_id] : 0;
156 156
     $unit_level = mrc_get_level($user, $planet, $unit_id, true, true) + $units_qued;
157
-    if($unit_max = get_unit_param($unit_id, P_MAX_STACK)) {
158
-      if($unit_level >= $unit_max) {
157
+    if ($unit_max = get_unit_param($unit_id, P_MAX_STACK)) {
158
+      if ($unit_level >= $unit_max) {
159 159
         throw new exception('{Максимальное количество юнитов данного типа уже достигнуто или будет достигнуто по окончанию очереди}', ERR_ERROR); // TODO EXCEPTION
160 160
       }
161 161
       $unit_amount = max(0, min($unit_amount, $unit_max - $unit_level));
162 162
     }
163 163
 
164
-    if($unit_amount < 1) {
164
+    if ($unit_amount < 1) {
165 165
       throw new exception('{Неправильное количество юнитов - сообщите Администрации}', ERR_ERROR); // TODO EXCEPTION
166 166
     }
167 167
 
@@ -170,21 +170,21 @@  discard block
 block discarded – undo
170 170
     //  {
171 171
     //    die('Unit busy'); // TODO EXCEPTION
172 172
     //  }
173
-    if(get_unit_param($unit_id, P_STACKABLE)) {
173
+    if (get_unit_param($unit_id, P_STACKABLE)) {
174 174
       // TODO Поле 'max_Lot_size' для ограничения размера стэка в очереди - то ли в юниты, то ли в очередь
175
-      if(in_array($unit_id, $group_missile = sn_get_groups(GROUP_STR_MISSILES))) {
175
+      if (in_array($unit_id, $group_missile = sn_get_groups(GROUP_STR_MISSILES))) {
176 176
         // TODO Поле 'container' - указывает на родительску структуру, в которой хранится данный юнит и по вместительности которой нужно применять размер юнита
177 177
         $used_silo = 0;
178
-        foreach($group_missile as $missile_id) {
178
+        foreach ($group_missile as $missile_id) {
179 179
           $missile_qued = isset($in_que[$missile_id]) ? $in_que[$missile_id] : 0;
180 180
           $used_silo += (mrc_get_level($user, $planet, $missile_id, true, true) + $missile_qued) * get_unit_param($missile_id, P_UNIT_SIZE);
181 181
         }
182 182
         $free_silo = mrc_get_level($user, $planet, STRUC_SILO) * get_unit_param(STRUC_SILO, P_CAPACITY) - $used_silo;
183
-        if($free_silo <= 0) {
183
+        if ($free_silo <= 0) {
184 184
           throw new exception('{Ракетная шахта уже заполнена или будет заполнена по окончанию очереди}', ERR_ERROR); // TODO EXCEPTION
185 185
         }
186 186
         $unit_size = get_unit_param($unit_id, P_UNIT_SIZE);
187
-        if($free_silo < $unit_size) {
187
+        if ($free_silo < $unit_size) {
188 188
           throw new exception("{В ракетной шахте нет места для {$classLocale['tech'][$unit_id]}}", ERR_ERROR); // TODO EXCEPTION
189 189
         }
190 190
         $unit_amount = max(0, min($unit_amount, floor($free_silo / $unit_size)));
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
       $unit_level = $new_unit_level = 0;
193 193
     } else {
194 194
       $unit_amount = 1;
195
-      if($que_id == QUE_STRUCTURES) {
195
+      if ($que_id == QUE_STRUCTURES) {
196 196
         // if($build_mode == BUILD_CREATE && eco_planet_fields_max($planet) - $planet['field_current'] - $que['sectors'][$planet['id']] <= 0)
197 197
         $sectors_qued = is_array($in_que) ? array_sum($in_que) : 0;
198
-        if($build_mode == BUILD_CREATE && eco_planet_fields_max($planet) - $planet['field_current'] - $sectors_qued <= 0) {
198
+        if ($build_mode == BUILD_CREATE && eco_planet_fields_max($planet) - $planet['field_current'] - $sectors_qued <= 0) {
199 199
           throw new exception('{Не хватает секторов на планете}', ERR_ERROR); // TODO EXCEPTION
200 200
         }
201 201
         // И что это я такое написал? Зачем?
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
 
213 213
     $exchange = array();
214 214
     $market_get_autoconvert_cost = market_get_autoconvert_cost();
215
-    if($is_autoconvert && $build_data[BUILD_AUTOCONVERT]) {
215
+    if ($is_autoconvert && $build_data[BUILD_AUTOCONVERT]) {
216 216
       $dark_matter = mrc_get_level($user, null, RES_DARK_MATTER);
217
-      if(mrc_get_level($user, null, RES_DARK_MATTER) < $market_get_autoconvert_cost) {
218
-        throw new exception("{Нет хватает " . ($market_get_autoconvert_cost - $dark_matter) . "ТМ на постройки с автоконвертацией ресурсов}", ERR_ERROR); // TODO EXCEPTION
217
+      if (mrc_get_level($user, null, RES_DARK_MATTER) < $market_get_autoconvert_cost) {
218
+        throw new exception("{Нет хватает ".($market_get_autoconvert_cost - $dark_matter)."ТМ на постройки с автоконвертацией ресурсов}", ERR_ERROR); // TODO EXCEPTION
219 219
       }
220 220
 
221 221
       !get_unit_param($unit_id, P_STACKABLE) ? $unit_amount = 1 : false;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
       $resource_exchange_rates = array();
225 225
       $resource_diff = array();
226 226
       $all_positive = true;
227
-      foreach($resources_loot as $resource_id) {
227
+      foreach ($resources_loot as $resource_id) {
228 228
         $resource_db_name = pname_resource_name($resource_id);
229 229
         $resource_got[$resource_id] = floor(mrc_get_level($user, $planet, $resource_id));
230 230
         $resource_exchange_rates[$resource_id] = classSupernova::$config->__get("rpg_exchange_{$resource_db_name}");
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
         $all_positive = $all_positive && ($resource_diff[$resource_id] > 0);
233 233
       }
234 234
       // Нужна автоконвертация
235
-      if($all_positive) {
235
+      if ($all_positive) {
236 236
         $is_autoconvert = false;
237 237
       } else {
238
-        foreach($resource_diff as $resource_diff_id => &$resource_diff_amount) {
239
-          if($resource_diff_amount >= 0) {
238
+        foreach ($resource_diff as $resource_diff_id => &$resource_diff_amount) {
239
+          if ($resource_diff_amount >= 0) {
240 240
             continue;
241 241
           }
242
-          foreach($resource_diff as $resource_got_id => &$resource_got_amount) {
243
-            if($resource_got_amount <= 0) {
242
+          foreach ($resource_diff as $resource_got_id => &$resource_got_amount) {
243
+            if ($resource_got_amount <= 0) {
244 244
               continue;
245 245
             }
246 246
             $current_exchange = $resource_exchange_rates[$resource_got_id] / $resource_exchange_rates[$resource_diff_id];
@@ -256,14 +256,14 @@  discard block
 block discarded – undo
256 256
         }
257 257
 
258 258
         $is_autoconvert_ok = true;
259
-        foreach($resource_diff as $resource_diff_amount2) {
260
-          if($resource_diff_amount2 < 0) {
259
+        foreach ($resource_diff as $resource_diff_amount2) {
260
+          if ($resource_diff_amount2 < 0) {
261 261
             $is_autoconvert_ok = false;
262 262
             break;
263 263
           }
264 264
         }
265 265
 
266
-        if($is_autoconvert_ok) {
266
+        if ($is_autoconvert_ok) {
267 267
           $build_data['RESULT'][$build_mode] = BUILD_ALLOWED;
268 268
           $build_data['CAN'][$build_mode] = $unit_amount;
269 269
         } else {
@@ -272,19 +272,19 @@  discard block
 block discarded – undo
272 272
       }
273 273
     }
274 274
     $unit_amount = min($build_data['CAN'][$build_mode], $unit_amount);
275
-    if($unit_amount <= 0) {
275
+    if ($unit_amount <= 0) {
276 276
       throw new exception('{Не хватает ресурсов}', ERR_ERROR); // TODO EXCEPTION
277 277
     }
278 278
 
279
-    if($new_unit_level < 0) {
279
+    if ($new_unit_level < 0) {
280 280
       throw new exception('{Нельзя уничтожить больше юнитов, чем есть}', ERR_ERROR); // TODO EXCEPTION
281 281
     }
282 282
 
283
-    if($build_data['RESULT'][$build_mode] != BUILD_ALLOWED) {
283
+    if ($build_data['RESULT'][$build_mode] != BUILD_ALLOWED) {
284 284
       throw new exception('{Строительство блокировано}', ERR_ERROR); // TODO EXCEPTION
285 285
     }
286 286
 
287
-    if($is_autoconvert) {
287
+    if ($is_autoconvert) {
288 288
       ksort($exchange);
289 289
       ksort($resource_got);
290 290
       db_change_units($user, $planet, array(
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     }
300 300
 
301 301
     $unit_amount_qued = 0;
302
-    while($unit_amount > 0 && count($que['ques'][$que_id][$user['id']][$planet_id]) < $que_max_length) {
302
+    while ($unit_amount > 0 && count($que['ques'][$que_id][$user['id']][$planet_id]) < $que_max_length) {
303 303
       $place = min($unit_amount, MAX_FLEET_OR_DEFS_PER_ROW);
304 304
       que_add_unit($unit_id, $user, $planet, $build_data, $new_unit_level, $place, $build_mode);
305 305
       $unit_amount -= $place;
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 
310 310
     sn_db_transaction_commit();
311 311
 
312
-    if($redirect) {
313
-      sys_redirect("{$_SERVER['PHP_SELF']}?mode=" . sys_get_param_str('mode') . "&ally_id=" . sys_get_param_id('ally_id'));
312
+    if ($redirect) {
313
+      sys_redirect("{$_SERVER['PHP_SELF']}?mode=".sys_get_param_str('mode')."&ally_id=".sys_get_param_id('ally_id'));
314 314
       die();
315 315
     }
316 316
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
       'STATUS'  => ERR_NONE,
319 319
       'MESSAGE' => '{Строительство начато}',
320 320
     );
321
-  } catch(exception $e) {
321
+  } catch (exception $e) {
322 322
     sn_db_transaction_rollback();
323 323
     $operation_result = array(
324 324
       'STATUS'  => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR,
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
     );
327 327
   }
328 328
 
329
-  if(!empty($operation_result['MESSAGE'])) {
330
-    $operation_result['MESSAGE'] .= ' ' . ($unit_amount_qued ? $unit_amount_qued : $unit_amount) . 'x[' . classLocale::$lang['tech'][$unit_id] . ']';
329
+  if (!empty($operation_result['MESSAGE'])) {
330
+    $operation_result['MESSAGE'] .= ' '.($unit_amount_qued ? $unit_amount_qued : $unit_amount).'x['.classLocale::$lang['tech'][$unit_id].']';
331 331
   }
332 332
 
333 333
   return $operation_result;
@@ -337,11 +337,11 @@  discard block
 block discarded – undo
337 337
 function que_recalculate($old_que) {
338 338
   $new_que = array();
339 339
 
340
-  if(!is_array($old_que['items'])) {
340
+  if (!is_array($old_que['items'])) {
341 341
     return $new_que;
342 342
   }
343
-  foreach($old_que['items'] as $row) {
344
-    if(!isset($row) || !$row || $row['que_unit_amount'] <= 0) {
343
+  foreach ($old_que['items'] as $row) {
344
+    if (!isset($row) || !$row || $row['que_unit_amount'] <= 0) {
345 345
       continue;
346 346
     }
347 347
 
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
 
353 353
     $last_id = count($new_que['items']) - 1;
354 354
 
355
-    if($row['que_planet_id']) {
355
+    if ($row['que_planet_id']) {
356 356
       $new_que['planets'][$row['que_planet_id']][$row['que_type']][] = &$new_que['items'][$last_id];
357
-    } elseif($row['que_type'] == QUE_RESEARCH) {
357
+    } elseif ($row['que_type'] == QUE_RESEARCH) {
358 358
       $new_que['players'][$row['que_player_id']][$row['que_type']][] = &$new_que['items'][$last_id];
359 359
     }
360 360
     $new_que['ques'][$row['que_type']][$row['que_player_id']][intval($row['que_planet_id'])][] = &$new_que['items'][$last_id];
@@ -389,9 +389,9 @@  discard block
 block discarded – undo
389 389
   $que_type = que_get_unit_que($unit_id);
390 390
   $planet_id_origin = $planet['id'] ? $planet['id'] : 'NULL';
391 391
   $planet_id = $que_type == QUE_RESEARCH ? 'NULL' : $planet_id_origin;
392
-  if(is_numeric($planet_id)) {
392
+  if (is_numeric($planet_id)) {
393 393
     DBStaticPlanet::db_planet_update_set_by_id($planet_id, "`que_processed` = UNIX_TIMESTAMP(NOW())");
394
-  } elseif(is_numeric($user['id'])) {
394
+  } elseif (is_numeric($user['id'])) {
395 395
     DBStaticUser::db_user_set_by_id($user['id'], '`que_processed` = UNIX_TIMESTAMP(NOW())');
396 396
   }
397 397
 
@@ -421,17 +421,17 @@  discard block
 block discarded – undo
421 421
   $planet['id'] = $planet['id'] && $que_type !== QUE_RESEARCH ? $planet['id'] : 0;
422 422
   $global_que = que_get($user['id'], $planet['id'], $que_type, true);
423 423
 
424
-  if(!empty($global_que['ques'][$que_type][$user['id']][$planet['id']])) {
424
+  if (!empty($global_que['ques'][$que_type][$user['id']][$planet['id']])) {
425 425
     $que = array_reverse($global_que['ques'][$que_type][$user['id']][$planet['id']]);
426 426
 
427
-    foreach($que as $que_item) {
427
+    foreach ($que as $que_item) {
428 428
       DBStaticQue::db_que_delete_by_id($que_item['que_id']);
429 429
 
430
-      if($que_item['que_planet_id_origin']) {
430
+      if ($que_item['que_planet_id_origin']) {
431 431
         $planet['id'] = $que_item['que_planet_id_origin'];
432 432
       }
433 433
 
434
-      if(!isset($planets_locked[$planet['id']])) {
434
+      if (!isset($planets_locked[$planet['id']])) {
435 435
         $planets_locked[$planet['id']] = $planet['id'] ? DBStaticPlanet::db_planet_by_id($planet['id'], true) : $planet;
436 436
       }
437 437
 
@@ -443,14 +443,14 @@  discard block
 block discarded – undo
443 443
         RES_DEUTERIUM => $build_data[RES_DEUTERIUM] * $que_item['que_unit_amount'],
444 444
       ));
445 445
 
446
-      if(!$clear) {
446
+      if (!$clear) {
447 447
         break;
448 448
       }
449 449
     }
450 450
 
451
-    if(is_numeric($planet['id'])) {
451
+    if (is_numeric($planet['id'])) {
452 452
       DBStaticPlanet::db_planet_update_set_by_id($planet['id'], "`que_processed` = UNIX_TIMESTAMP(NOW())");
453
-    } elseif(is_numeric($user['id'])) {
453
+    } elseif (is_numeric($user['id'])) {
454 454
       DBStaticUser::db_user_set_by_id($user['id'], '`que_processed` = UNIX_TIMESTAMP(NOW())');
455 455
     }
456 456
 
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
     sn_db_transaction_rollback();
460 460
   }
461 461
 //die();
462
-  header("Location: {$_SERVER['PHP_SELF']}?mode={$que_type}" . "&ally_id=" . sys_get_param_id('ally_id'));
462
+  header("Location: {$_SERVER['PHP_SELF']}?mode={$que_type}"."&ally_id=".sys_get_param_id('ally_id'));
463 463
 }
464 464
 
465 465
 
@@ -498,21 +498,21 @@  discard block
 block discarded – undo
498 498
   // TODO: Переделать для $que_type === false
499 499
   $planet['id'] = $planet['id'] ? $planet['id'] : 0;
500 500
 
501
-  if(!is_array($que)) {
501
+  if (!is_array($que)) {
502 502
     $que = que_get($user['id'], $planet['id'], $que_type);
503 503
   }
504 504
 
505
-  if(is_array($que) && isset($que['items'])) {
505
+  if (is_array($que) && isset($que['items'])) {
506 506
     $que = $que['ques'][$que_type][$user['id']][$planet['id']];
507 507
   }
508 508
 
509
-  if($que) {
510
-    foreach($que as $que_element) {
509
+  if ($que) {
510
+    foreach ($que as $que_element) {
511 511
       $template->assign_block_vars('que', que_tpl_parse_element($que_element, $short_names));
512 512
     }
513 513
   }
514 514
 
515
-  if($que_type == QUE_RESEARCH) {
515
+  if ($que_type == QUE_RESEARCH) {
516 516
   }
517 517
 }
518 518
 
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
   $user = DBStaticUser::db_user_by_id($user['id'], true);
539 539
 
540 540
   $time_left[$user['id']][0] = max(0, $on_time - $user['que_processed']);
541
-  if($planet === null && !$time_left[$user['id']][0]) {
541
+  if ($planet === null && !$time_left[$user['id']][0]) {
542 542
     // TODO
543 543
     return $que;
544 544
   }
@@ -547,12 +547,12 @@  discard block
 block discarded – undo
547 547
   $que_type_id = $planet === null ? QUE_RESEARCH : false;
548 548
   $planet = intval(is_array($planet) ? $planet['id'] : $planet); // В $planet у нас теперь только её ID или шаблон null/0/false
549 549
   $que = que_get($user['id'], $planet, $que_type_id, true);
550
-  if(empty($que['items'])) {
550
+  if (empty($que['items'])) {
551 551
     return $que;
552 552
   }
553 553
 
554 554
   $planet_list = array();
555
-  if($planet !== null) {
555
+  if ($planet !== null) {
556 556
     // Если нужно изменять данные на планетах - блокируем планеты и получаем данные о них
557 557
     // TODO - от них не надо ничего, кроме ID и que_processed
558 558
     $planet_row = DBStaticPlanet::db_planet_list_by_user_or_planet($user['id'], $planet);
@@ -561,20 +561,20 @@  discard block
 block discarded – undo
561 561
   }
562 562
 
563 563
   // Теперь в $time_left лежит время обсчета всех очередей по каждой из планеты
564
-  if(array_sum($time_left[$user['id']]) == 0) {
564
+  if (array_sum($time_left[$user['id']]) == 0) {
565 565
     return $que;
566 566
   }
567 567
 
568 568
   $unit_changes = array();
569
-  foreach($que['items'] as &$que_item) {
569
+  foreach ($que['items'] as &$que_item) {
570 570
     $que_player_id = &$que_item['que_player_id'];
571 571
     $que_planet_id = intval($que_item['que_planet_id']);
572 572
 
573 573
     $que_time_left = &$que['time_left'][$que_player_id][$que_planet_id][$que_item['que_type']];
574
-    if(!isset($que_time_left)) {
574
+    if (!isset($que_time_left)) {
575 575
       $que_time_left = $time_left[$que_player_id][$que_planet_id];
576 576
     }
577
-    if($que_time_left <= 0 || $que_item['que_unit_amount'] <= 0) {
577
+    if ($que_time_left <= 0 || $que_item['que_unit_amount'] <= 0) {
578 578
       continue;
579 579
     }
580 580
     // Дальше мы идем, если только осталось время в очереди И юниты к постройке
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
     // Теперь работаем с остатком времени на юните. Оно не может быть равно или меньше нуля
588 588
 
589 589
     // Если времени в очереди осталось не меньше, чем время текущего юнита - значит мы достроили юнит
590
-    if($que_time_left >= $que_item['que_time_left']) {
590
+    if ($que_time_left >= $que_item['que_time_left']) {
591 591
       // Увеличиваем количество отстроенных юнитов
592 592
       $unit_processed++;
593 593
       // Вычитаем из времени очереди потраченное на постройку время
@@ -600,12 +600,12 @@  discard block
 block discarded – undo
600 600
     $que_item['que_unit_amount'] -= $unit_processed;
601 601
 
602 602
     // Если еще остались юниты - значит ВСЁ оставшееся время приходится на достройку следующего юнита
603
-    if($que_item['que_unit_amount'] > 0) {
603
+    if ($que_item['que_unit_amount'] > 0) {
604 604
       $que_item['que_time_left'] = $que_item['que_time_left'] - $que_time_left;
605 605
       $que_time_left = 0;
606 606
     }
607 607
 
608
-    if($que_item['que_unit_amount'] <= 0) {
608
+    if ($que_item['que_unit_amount'] <= 0) {
609 609
       DBStaticQue::db_que_delete_by_id($que_item['que_id']);
610 610
     } else {
611 611
       classSupernova::db_upd_record_list(
@@ -615,15 +615,15 @@  discard block
 block discarded – undo
615 615
       );
616 616
     }
617 617
 
618
-    if($unit_processed) {
618
+    if ($unit_processed) {
619 619
       $unit_processed_delta = $unit_processed * ($que_item['que_unit_mode'] == BUILD_CREATE ? 1 : -1);
620 620
       $unit_changes[$que_player_id][$que_planet_id][$que_item['que_unit_id']] += $unit_processed_delta;
621 621
     }
622 622
   }
623 623
 
624
-  foreach($time_left as $player_id => $planet_data) {
625
-    foreach($planet_data as $planet_id => $time_on_planet) {
626
-      if($planet_id) {
624
+  foreach ($time_left as $player_id => $planet_data) {
625
+    foreach ($planet_data as $planet_id => $time_on_planet) {
626
+      if ($planet_id) {
627 627
         // update planet
628 628
         classSupernova::db_upd_record_list(LOC_PLANET, "`que_processed` = {$on_time}", "id = {$planet_id}");
629 629
       } else {
@@ -631,8 +631,8 @@  discard block
 block discarded – undo
631 631
         classSupernova::db_upd_record_list(LOC_USER, "`que_processed` = {$on_time}", "id = {$player_id}");
632 632
       }
633 633
 
634
-      if(is_array($unit_changes[$player_id][$planet_id])) {
635
-        foreach($unit_changes[$player_id][$planet_id] as $unit_id => $unit_amount) {
634
+      if (is_array($unit_changes[$player_id][$planet_id])) {
635
+        foreach ($unit_changes[$player_id][$planet_id] as $unit_id => $unit_amount) {
636 636
           DBStaticUnit::dbUpdateOrInsertUnit($unit_id, $unit_amount, $user, $planet_id ? $planet_id : null);
637 637
         }
638 638
       }
@@ -642,38 +642,38 @@  discard block
 block discarded – undo
642 642
   $que = que_recalculate($que);
643 643
 
644 644
   // TODO: Re-enable quests for Alliances
645
-  if(!empty($unit_changes) && !$user['user_as_ally']) {
645
+  if (!empty($unit_changes) && !$user['user_as_ally']) {
646 646
     $quest_list = qst_get_quests($user['id']);
647 647
     $quest_triggers = qst_active_triggers($quest_list);
648 648
     $quest_rewards = array();
649 649
 
650 650
 
651 651
     $xp_incoming = array();
652
-    foreach($unit_changes as $user_id => $planet_changes) {
653
-      foreach($planet_changes as $planet_id => $changes) {
652
+    foreach ($unit_changes as $user_id => $planet_changes) {
653
+      foreach ($planet_changes as $planet_id => $changes) {
654 654
         $planet_this = $planet_id ? classSupernova::db_get_record_by_id(LOC_PLANET, $planet_id) : array();
655
-        foreach($changes as $unit_id => $unit_value) {
655
+        foreach ($changes as $unit_id => $unit_value) {
656 656
           $que_id = que_get_unit_que($unit_id);
657 657
           $unit_level_new = mrc_get_level($user, $planet_this, $unit_id, false, true) + $unit_value;
658
-          if($que_id == QUE_STRUCTURES || $que_id == QUE_RESEARCH) {
658
+          if ($que_id == QUE_STRUCTURES || $que_id == QUE_RESEARCH) {
659 659
             $build_data = eco_get_build_data($user, $planet_this, $unit_id, $unit_level_new - 1);
660 660
             $build_data = $build_data[BUILD_CREATE];
661
-            foreach(sn_get_groups('resources_loot') as $resource_id) {
661
+            foreach (sn_get_groups('resources_loot') as $resource_id) {
662 662
               $xp_incoming[$que_id] += $build_data[$resource_id]; // TODO - добавить конверсию рейтов обмена
663 663
             }
664 664
           }
665 665
 
666
-          if(is_array($quest_triggers)) {
666
+          if (is_array($quest_triggers)) {
667 667
             // TODO: Check mutiply condition quests
668 668
             $quest_trigger_list = array_keys($quest_triggers, $unit_id);
669
-            if(is_array($quest_trigger_list)) {
670
-              foreach($quest_trigger_list as $quest_id) {
669
+            if (is_array($quest_trigger_list)) {
670
+              foreach ($quest_trigger_list as $quest_id) {
671 671
                 $quest_unit_level = $unit_level_new;
672
-                if(get_unit_param($unit_id, P_UNIT_TYPE) == UNIT_SHIPS) {
672
+                if (get_unit_param($unit_id, P_UNIT_TYPE) == UNIT_SHIPS) {
673 673
                   $quest_unit_level = DBStaticUnit::db_unit_count_by_user_and_type_and_snid($user_id, 0, $unit_id);
674 674
                   $quest_unit_level = $quest_unit_level[$unit_id]['qty'];
675 675
                 }
676
-                if($quest_list[$quest_id]['quest_status_status'] != QUEST_STATUS_COMPLETE && $quest_list[$quest_id]['quest_unit_amount'] <= $quest_unit_level) {
676
+                if ($quest_list[$quest_id]['quest_status_status'] != QUEST_STATUS_COMPLETE && $quest_list[$quest_id]['quest_unit_amount'] <= $quest_unit_level) {
677 677
                   $quest_rewards[$quest_id][$user_id][$planet_id] = $quest_list[$quest_id]['quest_rewards_list'];
678 678
                   $quest_list[$quest_id]['quest_status_status'] = QUEST_STATUS_COMPLETE;
679 679
                 }
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
     // TODO: Изменить начисление награды за квесты на ту планету, на которой происходил ресеч
687 687
     qst_reward($user, $quest_rewards, $quest_list);
688 688
 
689
-    foreach($xp_incoming as $que_id => $xp) {
689
+    foreach ($xp_incoming as $que_id => $xp) {
690 690
       rpg_level_up($user, $que_id == QUE_RESEARCH ? RPG_TECH : RPG_STRUCTURE, $xp / 1000);
691 691
     }
692 692
   }
Please login to merge, or discard this patch.
includes/classes/DBStaticQue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     if ($que_type == QUE_RESEARCH || $planet_id === null) {
39 39
       $query[] = "`que_planet_id` IS NULL";
40 40
     } elseif ($planet_id) {
41
-      $query[] = "(`que_planet_id` = {$planet_id}" . ($que_type ? '' : ' OR que_planet_id IS NULL') . ")";
41
+      $query[] = "(`que_planet_id` = {$planet_id}".($que_type ? '' : ' OR que_planet_id IS NULL').")";
42 42
     }
43 43
     if ($que_type) {
44 44
       $query[] = "`que_type` = {$que_type}";
Please login to merge, or discard this patch.
admin/adm_message_list.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 define('INSTALL', false);
13 13
 define('IN_ADMIN', true);
14 14
 
15
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
16 16
 
17
-if($user['authlevel'] < 3) {
17
+if ($user['authlevel'] < 3) {
18 18
   AdminMessage(classLocale::$lang['adm_err_denied']);
19 19
 }
20 20
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
   ),
29 29
 );
30 30
 $template->assign_block_vars('int_type_selected', $allowed_types[-1]);
31
-foreach(DBStaticMessages::$snMessageClassList as $key => $value) {
32
-  if($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
31
+foreach (DBStaticMessages::$snMessageClassList as $key => $value) {
32
+  if ($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
33 33
     continue;
34 34
   }
35 35
 
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 $deletedMessages = '';
44
-if($idMessageDelete = sys_get_param_id('msg_del')) {
44
+if ($idMessageDelete = sys_get_param_id('msg_del')) {
45 45
   DBStaticMessages::db_message_delete_by_id($idMessageDelete);
46 46
   $deletedMessages = $idMessageDelete;
47
-} elseif(sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
47
+} elseif (sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
48 48
   $message_delete = implode(', ', $message_delete);
49 49
   DBStaticMessages::db_message_list_delete_set($message_delete);
50 50
   $deletedMessages = $message_delete;
51 51
 }
52 52
 
53
-if($deletedMessages) {
53
+if ($deletedMessages) {
54 54
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted'], $deletedMessages)));
55 55
 }
56 56
 
57 57
 
58
-if(sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
58
+if (sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
59 59
   $delete_date = "{$year}-{$month}-{$day}";
60 60
   DBStaticMessages::db_message_list_delete_by_date($delete_date, $int_type_selected);
61 61
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted_date'], $allowed_types[$int_type_selected]['TEXT'], $delete_date)));
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 
68 68
 $int_page_current = min(sys_get_param_id('int_page_current', 1), $page_max);
69 69
 
70
-if(sys_get_param('page_prev') && $int_page_current > 1) {
70
+if (sys_get_param('page_prev') && $int_page_current > 1) {
71 71
   $int_page_current--;
72
-} elseif(sys_get_param('page_next') && $int_page_current < $page_max) {
72
+} elseif (sys_get_param('page_next') && $int_page_current < $page_max) {
73 73
   $int_page_current++;
74 74
 }
75 75
 
76
-for($i = 1; $i <= $page_max; $i++) {
76
+for ($i = 1; $i <= $page_max; $i++) {
77 77
   $template->assign_block_vars('page', array('NUMBER' => $i));
78 78
 }
79 79
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 $StartRec = ($int_page_current - 1) * 25;
82 82
 
83 83
 $Messages = DBStaticMessages::db_message_list_admin_by_type($int_type_selected, $StartRec);
84
-while($row = db_fetch($Messages)) {
84
+while ($row = db_fetch($Messages)) {
85 85
   $row['FROM'] = htmlentities($row['FROM'], ENT_COMPAT, 'UTF-8');
86 86
   $row['OWNER_NAME'] = htmlentities($row['OWNER_NAME'], ENT_COMPAT, 'UTF-8');
87 87
   $row['TEXT'] = nl2br($row['TEXT']);
Please login to merge, or discard this patch.
includes/classes/RequestInfo.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
     // Инфа об устройстве и браузере - общая для всех
88 88
     sn_db_transaction_start();
89 89
     $this->device_cypher = $_COOKIE[SN_COOKIE_D];
90
-    if($this->device_cypher) {
90
+    if ($this->device_cypher) {
91 91
       $cypher_safe = db_escape($this->device_cypher);
92 92
       $device_id = classSupernova::$db->doSelectFetch("SELECT `device_id` FROM {{security_device}} WHERE `device_cypher` = '{$cypher_safe}' LIMIT 1 FOR UPDATE");
93
-      if(!empty($device_id['device_id'])) {
93
+      if (!empty($device_id['device_id'])) {
94 94
         $this->device_id = $device_id['device_id'];
95 95
       }
96 96
     }
97 97
 
98
-    if($this->device_id <= 0) {
98
+    if ($this->device_id <= 0) {
99 99
       do {
100 100
         $cypher_safe = db_escape($this->device_cypher = sys_random_string());
101 101
         $row = classSupernova::$db->doSelectFetch("SELECT `device_id` FROM {{security_device}} WHERE `device_cypher` = '{$cypher_safe}' LIMIT 1 FOR UPDATE");
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
     $this->page_address_id = db_get_set_unique_id_value($this->page_address, 'url_id', 'security_url', 'url_string');
119 119
     sn_db_transaction_commit();
120 120
 
121
-    if($this->write_full_url) {
121
+    if ($this->write_full_url) {
122 122
       sn_db_transaction_start();
123 123
       $this->page_url = substr($_SERVER['REQUEST_URI'], strlen(SN_ROOT_RELATIVE));
124
-      if(strpos($_SERVER['REQUEST_URI'], '/simulator.php') === 0) {
124
+      if (strpos($_SERVER['REQUEST_URI'], '/simulator.php') === 0) {
125 125
         $this->page_url = '/simulator.php';
126 126
       }
127 127
       $this->page_url_id = db_get_set_unique_id_value($this->page_url, 'url_id', 'security_url', 'url_string');
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
    */
145 145
   public function db_security_entry_insert($user_id_unsafe) {
146 146
     // TODO $user_id = !empty(self::$user['id']) ? self::$user['id'] : 'NULL';
147
-    if(empty($user_id_unsafe)) {
147
+    if (empty($user_id_unsafe)) {
148 148
       // self::flog('Нет ИД пользователя');
149 149
       return true;
150 150
     }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
   public function db_counter_insert($user_id_unsafe) {
167 167
     global $sys_stop_log_hit;
168 168
 
169
-    if($sys_stop_log_hit || !classSupernova::$config->game_counter) {
169
+    if ($sys_stop_log_hit || !classSupernova::$config->game_counter) {
170 170
       return;
171 171
     }
172 172
 
Please login to merge, or discard this patch.
includes/classes/DBStaticNews.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
       LEFT JOIN {{survey}} AS s ON s.survey_announce_id = a.idAnnounce
44 44
       LEFT JOIN {{users}} AS u ON u.id = a.user_id
45 45
     {$query_where}
46
-    ORDER BY `tsTimeStamp` DESC, idAnnounce" .
46
+    ORDER BY `tsTimeStamp` DESC, idAnnounce".
47 47
       ($query_limit ? " LIMIT {$query_limit}" : ''));
48 48
 
49 49
     $template->assign_var('NEWS_COUNT', classSupernova::$db->db_num_rows($announce_list));
Please login to merge, or discard this patch.
includes/classes/UBE/UBEDebris.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
    */
28 28
   public function debris_add_resource($resource_id, $resource_amount) {
29 29
     // В обломках может быть только металл или кристалл
30
-    if($resource_id != RES_METAL && $resource_id != RES_CRYSTAL) {
30
+    if ($resource_id != RES_METAL && $resource_id != RES_CRYSTAL) {
31 31
       return;
32 32
     }
33 33
     $this->debris[$resource_id] += $resource_amount;
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
    * @param bool  $is_simulator
39 39
    */
40 40
   public function add_wrecks(array $wreckage, $is_simulator) {
41
-    foreach($wreckage as $resource_id => $resource_amount) {
41
+    foreach ($wreckage as $resource_id => $resource_amount) {
42 42
       $this->debris_add_resource($resource_id, floor($resource_amount *
43 43
         ($is_simulator
44 44
           ? UBE_SHIP_WRECKS_TO_DEBRIS_AVG
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
    * @param bool  $is_simulator
55 55
    */
56 56
   public function add_cargo_drop(array $dropped_resources, $is_simulator) {
57
-    foreach($dropped_resources as $resource_id => $resource_amount) {
57
+    foreach ($dropped_resources as $resource_id => $resource_amount) {
58 58
       $this->debris_add_resource($resource_id, floor($resource_amount *
59 59
         ($is_simulator
60 60
           ? UBE_CARGO_DROPPED_TO_DEBRIS_AVG
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
    * @param $moon_debris_left_part
94 94
    */
95 95
   public function debris_adjust_proportional($moon_debris_left_part) {
96
-    foreach($this->debris as $resource_id => &$resource_amount) {
96
+    foreach ($this->debris as $resource_id => &$resource_amount) {
97 97
       $resource_amount = floor($resource_amount * $moon_debris_left_part);
98 98
     }
99 99
   }
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
    */
115 115
   public function report_generate_array() {
116 116
     return array(
117
-      'ube_report_debris_metal'          => (float)$this->debris_get_resource(RES_METAL),
118
-      'ube_report_debris_crystal'        => (float)$this->debris_get_resource(RES_CRYSTAL),
119
-      'ube_report_debris_total_in_metal' => (float)$this->debris_in_metal(),
117
+      'ube_report_debris_metal'          => (float) $this->debris_get_resource(RES_METAL),
118
+      'ube_report_debris_crystal'        => (float) $this->debris_get_resource(RES_CRYSTAL),
119
+      'ube_report_debris_total_in_metal' => (float) $this->debris_in_metal(),
120 120
     );
121 121
   }
122 122
 
Please login to merge, or discard this patch.