Completed
Push — work-fleets ( aedb07...3b3d1f )
by SuperNova.WS
05:31
created
includes/update_old.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -197,8 +197,7 @@  discard block
 block discarded – undo
197 197
           if($old_que_item[4] == 'build')
198 198
           {
199 199
             $old_que_item[4] = BUILD_CREATE;
200
-          }
201
-          else
200
+          } else
202 201
           {
203 202
             $old_que_item[4] = BUILD_DESTROY;
204 203
           }
@@ -667,18 +666,15 @@  discard block
 block discarded – undo
667 666
             if(preg_match('/^Using Black Market page (\d+)$/', $comment, $matches2))
668 667
             {
669 668
               $reason = RPG_MARKET;
670
-            }
671
-            elseif(preg_match('/^Spent for officer (.+) ID (\d+)$/', $comment, $matches2))
669
+            } elseif(preg_match('/^Spent for officer (.+) ID (\d+)$/', $comment, $matches2))
672 670
             {
673 671
               $reason = RPG_MERCENARY;
674 672
               $comment = "Spent for mercenary {$matches2[1]} GUID {$matches2[2]}";
675
-            }
676
-            elseif(preg_match('/^Incoming From Referral ID\ ?(\d+)$/', $comment, $matches2))
673
+            } elseif(preg_match('/^Incoming From Referral ID\ ?(\d+)$/', $comment, $matches2))
677 674
             {
678 675
               $reason = RPG_REFERRAL;
679 676
               $comment = "Incoming from referral ID {$matches[1]}";
680
-            }
681
-            elseif(preg_match('/^Through admin interface for user .* ID \d+ (.*)$/', $comment, $matches2))
677
+            } elseif(preg_match('/^Through admin interface for user .* ID \d+ (.*)$/', $comment, $matches2))
682 678
             {
683 679
               $reason = RPG_ADMIN;
684 680
               $comment = $matches2[1];
@@ -1716,8 +1712,7 @@  discard block
 block discarded – undo
1716 1712
         if(!isset($found[$index]))
1717 1713
         {
1718 1714
           $found[$index] = $row['BUDDY_ID'];
1719
-        }
1720
-        else
1715
+        } else
1721 1716
         {
1722 1717
           $lost[] = $row['BUDDY_ID'];
1723 1718
         }
@@ -2169,8 +2164,7 @@  discard block
 block discarded – undo
2169 2164
               $que_data[QI_PLANET_ID] = 'NULL';
2170 2165
             }
2171 2166
           }
2172
-        }
2173
-        else
2167
+        } else
2174 2168
         {
2175 2169
           $que_data[QI_PLANET_ID] = 'NULL';
2176 2170
         }
Please login to merge, or discard this patch.
includes/debug.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,11 +140,13 @@
 block discarded – undo
140 140
       $error_backtrace['locks'] = classSupernova::$locks;
141 141
       $error_backtrace['cSN_data'] = classSupernova::$data;
142 142
       foreach($error_backtrace['cSN_data'] as &$location) {
143
-        foreach($location as $location_id => &$location_data) //          $location_data = $location_id;
143
+        foreach($location as $location_id => &$location_data) {
144
+          //          $location_data = $location_id;
144 145
         {
145 146
           $location_data = isset($location_data['username']) ? $location_data['username'] :
146 147
             (isset($location_data['name']) ? $location_data['name'] : $location_id);
147 148
         }
149
+        }
148 150
       }
149 151
       $error_backtrace['cSN_queries'] = classSupernova::$queries;
150 152
     }
Please login to merge, or discard this patch.
includes/update.php 1 patch
Braces   +21 added lines, -9 removed lines patch added patch discarded remove patch
@@ -399,7 +399,9 @@  discard block
 block discarded – undo
399 399
         $units_levels = array();
400 400
         foreach($planet_unit_list as $unit_id) {
401 401
           $unit_name = &$units_info[$unit_id][P_NAME];
402
-          if(!isset($row[$unit_name]) || !$row[$unit_name]) continue;
402
+          if(!isset($row[$unit_name]) || !$row[$unit_name]) {
403
+            continue;
404
+          }
403 405
           $units_levels[$unit_id] = $row[$unit_name];
404 406
           $unit_data[] = "({$user_id}," . LOC_PLANET . ",{$planet_id},{$units_info[$unit_id][P_UNIT_TYPE]},{$unit_id},{$units_levels[$unit_id]})";
405 407
           if(count($unit_data) > 30) {
@@ -413,7 +415,9 @@  discard block
 block discarded – undo
413 415
         if($row['que']) {
414 416
           $que = explode(';', $row['que']);
415 417
           foreach($que as $que_item) {
416
-            if(!$que_item) continue;
418
+            if(!$que_item) {
419
+              continue;
420
+            }
417 421
 
418 422
             $que_item = explode(',', $que_item);
419 423
 
@@ -445,9 +449,13 @@  discard block
 block discarded – undo
445 449
           $return_resources = array(RES_METAL => 0, RES_CRYSTAL => 0, RES_DEUTERIUM => 0, );
446 450
           $hangar_units = sys_unit_str2arr($row['b_hangar_id']);
447 451
           foreach($hangar_units as $unit_id => $unit_count) {
448
-            if($unit_count <= 0) continue;
452
+            if($unit_count <= 0) {
453
+              continue;
454
+            }
449 455
             foreach($units_info[$unit_id][P_COST] as $resource_id => $resource_amount) {
450
-              if(!in_array($resource_id, $group_resource_loot)) continue;
456
+              if(!in_array($resource_id, $group_resource_loot)) {
457
+                continue;
458
+              }
451 459
               $return_resources[$resource_id] += $unit_count * $resource_amount;
452 460
             }
453 461
           }
@@ -464,11 +472,13 @@  discard block
 block discarded – undo
464 472
         }
465 473
       }
466 474
 
467
-      if(!empty($unit_data))
468
-        upd_do_query('REPLACE INTO {{unit}} (`unit_player_id`, `unit_location_type`, `unit_location_id`, `unit_type`, `unit_snid`, `unit_level`) VALUES ' . implode(',', $unit_data) . ';');
475
+      if(!empty($unit_data)) {
476
+              upd_do_query('REPLACE INTO {{unit}} (`unit_player_id`, `unit_location_type`, `unit_location_id`, `unit_type`, `unit_snid`, `unit_level`) VALUES ' . implode(',', $unit_data) . ';');
477
+      }
469 478
 
470
-      if(!empty($que_data))
471
-        upd_do_query('INSERT INTO {{que}} (`que_player_id`, `que_planet_id`, `que_planet_id_origin`, `que_type`, `que_time_left`, `que_unit_id`, `que_unit_amount`, `que_unit_mode`, `que_unit_level`, `que_unit_time`, `que_unit_price`) VALUES ' . implode(',', $que_data) . ';');
479
+      if(!empty($que_data)) {
480
+              upd_do_query('INSERT INTO {{que}} (`que_player_id`, `que_planet_id`, `que_planet_id_origin`, `que_type`, `que_time_left`, `que_unit_id`, `que_unit_amount`, `que_unit_mode`, `que_unit_level`, `que_unit_time`, `que_unit_price`) VALUES ' . implode(',', $que_data) . ';');
481
+      }
472 482
 
473 483
       upd_alter_table('planets', $drop, true);
474 484
     }
@@ -761,9 +771,11 @@  discard block
 block discarded – undo
761 771
         !empty($strings) ? doquery($query_string . implode(',', $strings)) : false;
762 772
       }
763 773
 
764
-      if(isset($update_tables['counter']['page'])) // TODO REMOVE
774
+      if(isset($update_tables['counter']['page'])) {
775
+        // TODO REMOVE
765 776
       {
766 777
         update_security_url("SELECT DISTINCT `page` as url FROM {{counter}}");
778
+      }
767 779
         update_security_url("SELECT DISTINCT `url` as url FROM {{counter}}");
768 780
       }
769 781
     }
Please login to merge, or discard this patch.
includes/functions/eco_queue.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -458,8 +458,7 @@
 block discarded – undo
458 458
 
459 459
     if(is_numeric($planet['id'])) {
460 460
       db_planet_set_by_id($planet['id'], "`que_processed` = UNIX_TIMESTAMP(NOW())");
461
-    }
462
-    elseif(is_numeric($user['id'])) {
461
+    } elseif(is_numeric($user['id'])) {
463 462
       db_user_set_by_id($user['id'], '`que_processed` = UNIX_TIMESTAMP(NOW())');
464 463
     }
465 464
 
Please login to merge, or discard this patch.
includes/functions/qst_quest.php 1 patch
Braces   +18 added lines, -22 removed lines patch added patch discarded remove patch
@@ -33,8 +33,7 @@  discard block
 block discarded – undo
33 33
           if($quest_rewards_amount < 0)
34 34
           {
35 35
             throw new Exception($lang['qst_adm_err_reward_amount']);
36
-          }
37
-          elseif($quest_rewards_amount > 0)
36
+          } elseif($quest_rewards_amount > 0)
38 37
           {
39 38
             $quest_rewards[] = "{$quest_rewards_id},{$quest_rewards_amount}";
40 39
           }
@@ -75,8 +74,7 @@  discard block
 block discarded – undo
75 74
               `quest_rewards` = '{$quest_rewards}'
76 75
             WHERE `quest_id` = {$quest_id} LIMIT 1;"
77 76
           );
78
-        }
79
-        else
77
+        } else
80 78
         {
81 79
           sn_db_perform('{{quest}}', array(
82 80
             'quest_name' => $quest_name,
@@ -94,8 +92,7 @@  discard block
 block discarded – undo
94 92
           msg_send_simple_message('*', 0, 0, MSG_TYPE_PLAYER, $lang['sys_administration'], $lang['news_title'], $text);
95 93
         }
96 94
         */
97
-      }
98
-      catch (Exception $e)
95
+      } catch (Exception $e)
99 96
       {
100 97
         message($e->getMessage(), $lang['sys_error']);
101 98
       }
@@ -119,8 +116,7 @@  discard block
 block discarded – undo
119 116
     }
120 117
     $query = doquery("SELECT count(*) AS count FROM {{quest}};", '', true);
121 118
     $config->db_saveItem('quest_total', $query['count']);
122
-  }
123
-  elseif(!$user_id)
119
+  } elseif(!$user_id)
124 120
   {
125 121
     $user_id = $user['id'];
126 122
   }
@@ -137,8 +133,7 @@  discard block
 block discarded – undo
137 133
   if($quest)
138 134
   {
139 135
     $quest_templatized = qst_templatize(qst_quest_parse($quest, false));
140
-  }
141
-  else
136
+  } else
142 137
   {
143 138
     $quest_templatized['quest_rewards_list'] = array();
144 139
   }
@@ -193,8 +188,7 @@  discard block
 block discarded – undo
193 188
       if($status == null)
194 189
       {
195 190
         $query_add_where .= "IS NULL";
196
-      }
197
-      else
191
+      } else
198 192
       {
199 193
         $query_add_where .= "= {$status}";
200 194
       }
@@ -223,8 +217,7 @@  discard block
 block discarded – undo
223 217
   if($block_name)
224 218
   {
225 219
     $template->assign_block_vars($block_name, $quest_templatized);
226
-  }
227
-  else
220
+  } else
228 221
   {
229 222
     $template->assign_vars($quest_templatized);
230 223
     if(!empty($quest_templatized['quest_rewards_list']))
@@ -292,7 +285,9 @@  discard block
 block discarded – undo
292 285
 
293 286
 function qst_reward(&$user, &$rewards, &$quest_list)
294 287
 {
295
-  if(empty($rewards)) return;
288
+  if(empty($rewards)) {
289
+    return;
290
+  }
296 291
 
297 292
   global $lang;
298 293
 
@@ -300,11 +295,12 @@  discard block
 block discarded – undo
300 295
   $total_rewards = array();
301 296
   $comment_dm = '';
302 297
 
303
-  foreach($rewards as $quest_id => $user_data)
304
-    foreach($user_data as $user_id => $planet_data)
298
+  foreach($rewards as $quest_id => $user_data) {
299
+      foreach($user_data as $user_id => $planet_data)
305 300
       foreach($planet_data as $planet_id => $reward_list)
306 301
       {
307 302
         $comment = sprintf($lang['qst_msg_complete_body'], $quest_list[$quest_id]['quest_name']);
303
+  }
308 304
         $comment_dm .= isset($reward_list[RES_DARK_MATTER]) ? $comment : '';
309 305
 
310 306
         $comment_reward = array();
@@ -336,17 +332,17 @@  discard block
 block discarded – undo
336 332
         $local_changeset = array();
337 333
         foreach($unit_data as $unit_id => $unit_amount)
338 334
         {
339
-          if(!isset($quest_rewards_allowed[$unit_id])) continue;
335
+          if(!isset($quest_rewards_allowed[$unit_id])) {
336
+            continue;
337
+          }
340 338
 
341 339
           if($unit_id == RES_DARK_MATTER)
342 340
           {
343 341
             rpg_points_change($user['id'], RPG_QUEST, $unit_amount, $comment_dm);
344
-          }
345
-          elseif(isset($group_resources[$unit_id]))
342
+          } elseif(isset($group_resources[$unit_id]))
346 343
           {
347 344
             $local_changeset[pname_resource_name($unit_id)] = array('delta' => $unit_amount);
348
-          }
349
-          else // Проверим на юниты
345
+          } else // Проверим на юниты
350 346
           {
351 347
             $db_changeset['unit'][] = sn_db_unit_changeset_prepare($unit_id, $unit_amount, $user_row, $planet_id);
352 348
           }
Please login to merge, or discard this patch.
includes/functions/msg_send_simple_message.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@  discard block
 block discarded – undo
79 79
     // TODO Добавить $sender - рассылка может быть и от кого-то
80 80
     db_message_insert_all($message_type, $from, $subject, $text);
81 81
     $owners = array();
82
-  }
83
-  else
82
+  } else
84 83
   {
85 84
     $insert_values = array();
86 85
     $insert_template = "('%u'," . str_replace('%', '%%', " '{$sender}', '{$timestamp}', '{$message_type}', '{$from}', '{$subject}', '{$text}')");
@@ -90,8 +89,7 @@  discard block
 block discarded – undo
90 89
       if($user['id'] != $owner)
91 90
       {
92 91
         $owner_row = db_user_by_id($owner);
93
-      }
94
-      else
92
+      } else
95 93
       {
96 94
         $owner_row = $user;
97 95
       }
Please login to merge, or discard this patch.
includes/functions/eco_get_build_data.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
38 38
     if($user['user_as_ally'])
39 39
     {
40 40
       $lab_level = doquery("SELECT ally_members AS effective_level FROM {{alliance}} WHERE id = {$user['user_as_ally']} LIMIT 1", true);
41
-    }
42
-    else
41
+    } else
43 42
     {
44 43
       $tech_intergalactic = mrc_get_level($user, false, TECH_RESEARCH) + 1;
45 44
       $lab_level['effective_level'] = 0;
@@ -238,8 +237,7 @@  discard block
 block discarded – undo
238 237
       //{
239 238
       //  $result = true;
240 239
       //}
241
-    }
242
-    elseif(($unit_id == UNIT_TECHNOLOGIES || in_array($unit_id, sn_get_groups('tech'))) && !$config->BuildLabWhileRun && $planet['que'])
240
+    } elseif(($unit_id == UNIT_TECHNOLOGIES || in_array($unit_id, sn_get_groups('tech'))) && !$config->BuildLabWhileRun && $planet['que'])
243 241
     {
244 242
       $result = eco_is_builds_in_que($planet['que'], array(STRUC_LABORATORY, STRUC_LABORATORY_NANO));
245 243
     }
Please login to merge, or discard this patch.
ajax_version_check.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,12 +41,10 @@
 block discarded – undo
41 41
 if(!$check_result)
42 42
 {
43 43
   $version_check = SNC_VER_ERROR_CONNECT;
44
-}
45
-elseif(($version_check = intval($check_result)) && $version_check == $check_result)
44
+} elseif(($version_check = intval($check_result)) && $version_check == $check_result)
46 45
 {
47 46
   $version_check = $check_result;
48
-}
49
-else
47
+} else
50 48
 {
51 49
   // JSON decode if string
52 50
   $check_result = json_decode($check_result, true);
Please login to merge, or discard this patch.
jumpgate.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@
 block discarded – undo
115 115
     ));
116 116
 
117 117
     display($template, $lang['tech'][STRUC_MOON_GATE]);
118
-  }
119
-  else
118
+  } else
120 119
   {
121 120
     message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10);
122 121
   }
Please login to merge, or discard this patch.