Test Failed
Branch trunk (412648)
by SuperNova.WS
03:40
created
includes/vars_combats.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('INSIDE'))
3
+if (!defined('INSIDE'))
4 4
 {
5 5
   die('Hack attempt!');
6 6
 }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     'shield' => 10,
39 39
     'armor' => 400,
40 40
     'attack' => 5,
41
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
41
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
42 42
   ),
43 43
   SHIP_CARGO_BIG => array(
44 44
     'name' => 'big_ship_cargo',
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     'shield' => 25,
59 59
     'armor' => 1200,
60 60
     'attack' => 5,
61
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
61
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
62 62
     'engine' => array(
63 63
       array(
64 64
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     'shield' => 50,
87 87
     'armor' => 3000,
88 88
     'attack' => 10,
89
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
89
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
90 90
     'engine' => array(
91 91
       array(
92 92
         'tech' => TECH_ENGINE_ION,
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     'shield' => 200,
115 115
     'armor' => 70000,
116 116
     'attack' => 50,
117
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
117
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
118 118
     'engine' => array(
119 119
       array(
120 120
         'tech' => TECH_ENGINE_HYPER,
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     'shield' => 100,
144 144
     'armor' => 3000,
145 145
     'attack' => 50,
146
-    'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ),
146
+    'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,),
147 147
     'engine' => array(
148 148
       array(
149 149
         'tech' => TECH_ENGINE_ION,
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     'shield' => 10,
172 172
     'armor' => 1600,
173 173
     'attack' => 1,
174
-    'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050, ),
174
+    'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050,),
175 175
     'engine' => array(
176 176
       array(
177 177
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     'shield' =>  0.01,
200 200
     'armor' => 100,
201 201
     'attack' =>  0.01,
202
-    'amplify' => array( SHIP_SPY => 1,),
202
+    'amplify' => array(SHIP_SPY => 1,),
203 203
     'engine' => array(
204 204
       array(
205 205
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
       'factor' => 1,
224 224
     ),
225 225
     P_UNIT_PRODUCTION => array(
226
-      RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor);},
226
+      RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); },
227 227
     ),
228 228
     P_MINING_IS_MANAGED => true,
229 229
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
     'shield' => 10,
233 233
     'armor' => 200,
234 234
     'attack' => 1,
235
-    'amplify' => array(SHIP_SPY => 1, ),
235
+    'amplify' => array(SHIP_SPY => 1,),
236 236
     'engine' => array(
237 237
       array(
238 238
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     'shield' => 10,
265 265
     'armor' => 400,
266 266
     'attack' => 50,
267
-    'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ),
267
+    'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,),
268 268
     'engine' => array(
269 269
       array(
270 270
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     'shield' => 25,
294 294
     'armor' => 1000,
295 295
     'attack' => 150,
296
-    'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7, ),
296
+    'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7,),
297 297
     'engine' => array(
298 298
       array(
299 299
         'tech' => TECH_ENGINE_ION,
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
     'shield' =>  50,
353 353
     'armor' => 2700,
354 354
     'attack' => 400,
355
-    'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5, ),
355
+    'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5,),
356 356
     'engine' => array(
357 357
       array(
358 358
         'tech' => TECH_ENGINE_ION,
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
     'shield' =>  200,
412 412
     'armor' =>  6000,
413 413
     'attack' => 1000,
414
-    'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76, ),
414
+    'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76,),
415 415
     'engine' => array(
416 416
       array(
417 417
         'tech' => TECH_ENGINE_HYPER,
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
     'shield' =>  500,
508 508
     'armor' => 11000,
509 509
     'attack' => 2000,
510
-    'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125, ),
510
+    'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125,),
511 511
     'engine' => array(
512 512
       array(
513 513
         'tech' => TECH_ENGINE_HYPER,
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
     'shield' => 20,
612 612
     'armor' => 200,
613 613
     'attack' => 80,
614
-    'amplify' => array(SHIP_SPY => 7, ),
614
+    'amplify' => array(SHIP_SPY => 7,),
615 615
   ),
616 616
   UNIT_DEF_TURRET_LASER_SMALL => array(
617 617
     'name' => 'small_laser',
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
     'shield' => 25,
630 630
     'armor' => 200,
631 631
     'attack' => 100,
632
-    'amplify' => array(SHIP_SPY => 5, ),
632
+    'amplify' => array(SHIP_SPY => 5,),
633 633
   ),
634 634
   UNIT_DEF_TURRET_LASER_BIG => array(
635 635
     'name' => 'big_laser',
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
     'shield' => 100,
648 648
     'armor' => 800,
649 649
     'attack' => 250,
650
-    'amplify' => array(SHIP_SPY => 2, ),
650
+    'amplify' => array(SHIP_SPY => 2,),
651 651
   ),
652 652
   UNIT_DEF_TURRET_GAUSS => array(
653 653
     'name' => 'gauss_canyon',
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
     'armor' => 3500,
666 666
     'shield' => 200,
667 667
     'attack' => 1100,
668
-    'amplify' => array(SHIP_SPY => 0.5, ),
668
+    'amplify' => array(SHIP_SPY => 0.5,),
669 669
   ),
670 670
   UNIT_DEF_TURRET_ION => array(
671 671
     'name' => 'ionic_canyon',
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
     'shield' => 500,
684 684
     'armor' => 800,
685 685
     'attack' => 150,
686
-    'amplify' => array(SHIP_SPY => 3.3, ),
686
+    'amplify' => array(SHIP_SPY => 3.3,),
687 687
   ),
688 688
   UNIT_DEF_TURRET_PLASMA => array(
689 689
     'name' => 'buster_canyon',
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
     'shield' => 300,
702 702
     'armor' => 10000,
703 703
     'attack' => 3000,
704
-    'amplify' => array(SHIP_SPY => 0.17, ),
704
+    'amplify' => array(SHIP_SPY => 0.17,),
705 705
   ),
706 706
 
707 707
   UNIT_DEF_SHIELD_SMALL => array(
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
     'shield' => 2000,
722 722
     'armor' => 2000,
723 723
     'attack' => 1,
724
-    'amplify' => array(SHIP_SPY => 500, ),
724
+    'amplify' => array(SHIP_SPY => 500,),
725 725
   ),
726 726
   UNIT_DEF_SHIELD_BIG => array(
727 727
     'name' => 'big_protection_shield',
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
     'shield' => 2000,
741 741
     'armor' => 10000,
742 742
     'attack' => 1,
743
-    'amplify' => array(SHIP_SPY => 500, ),
743
+    'amplify' => array(SHIP_SPY => 500,),
744 744
   ),
745 745
   UNIT_DEF_SHIELD_PLANET => array(
746 746
     'name'      => 'planet_protector',
Please login to merge, or discard this patch.
search.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@
 block discarded – undo
61 61
         'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'),
62 62
         'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'),
63 63
       ));
64
-    }
65
-    elseif($type=='ally')
64
+    } elseif($type=='ally')
66 65
     {
67 66
       $template->assign_block_vars('search_result', array(
68 67
         'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'),
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
14 14
 
15
-if(classSupernova::$config->game_mode == GAME_BLITZ) {
15
+if (classSupernova::$config->game_mode == GAME_BLITZ) {
16 16
   messageBox($lang['sys_blitz_page_disabled'], $lang['sys_error'], 'overview.php', 10);
17 17
   die();
18 18
 }
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 $template = gettemplate('search', true);
27 27
 
28
-if($searchtext && $type)
28
+if ($searchtext && $type)
29 29
 {
30
-  switch($type)
30
+  switch ($type)
31 31
   {
32 32
     case "planetname":
33 33
       // $search = db_planet_list_search($searchtext);
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
     break;
44 44
   }
45 45
 
46
-  while($row = db_fetch($search))
46
+  while ($row = db_fetch($search))
47 47
   {
48
-    if($type=='playername' || $type=='planetname')
48
+    if ($type == 'playername' || $type == 'planetname')
49 49
     {
50 50
       $template->assign_block_vars('search_result', array(
51 51
         'PLAYER_ID' => $row['uid'],
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'),
63 63
       ));
64 64
     }
65
-    elseif($type=='ally')
65
+    elseif ($type == 'ally')
66 66
     {
67 67
       $template->assign_block_vars('search_result', array(
68 68
         'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'),
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
   'ally' => 'sys_alliance',
82 82
 );
83 83
 
84
-foreach($search_type as $type_id => $type_lang)
84
+foreach ($search_type as $type_id => $type_lang)
85 85
 {
86 86
   $template->assign_block_vars('type', array(
87 87
     'ID' => $type_id,
Please login to merge, or discard this patch.
quest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-define('INSIDE'  , true);
11
-define('INSTALL' , false);
10
+define('INSIDE', true);
11
+define('INSTALL', false);
12 12
 
13 13
 require('common.' . substr(strrchr(__FILE__, '.'), 1));
14 14
 
Please login to merge, or discard this patch.
alliance.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
   if($user_request['id_user'])
26 26
   {
27 27
     require('includes/alliance/ali_external_request.inc');
28
-  }
29
-  else
28
+  } else
30 29
   {
31 30
     switch($mode)
32 31
     {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if(classSupernova::$config->game_mode == GAME_BLITZ) {
5
+if (classSupernova::$config->game_mode == GAME_BLITZ) {
6 6
   messageBox($lang['sys_blitz_page_disabled'], $lang['sys_error'], 'overview.php', 10);
7 7
   die();
8 8
 }
@@ -14,21 +14,21 @@  discard block
 block discarded – undo
14 14
 
15 15
 $mode = sys_get_param_str('mode');
16 16
 
17
-if($mode == 'ainfo')
17
+if ($mode == 'ainfo')
18 18
 {
19 19
   include('includes/alliance/ali_info.inc');
20 20
 }
21 21
 
22
-if(!$user['ally_id'])
22
+if (!$user['ally_id'])
23 23
 {
24 24
   $user_request = doquery("SELECT * FROM {{alliance_requests}} WHERE `id_user` ='{$user['id']}' LIMIT 1;", '', true);
25
-  if($user_request['id_user'])
25
+  if ($user_request['id_user'])
26 26
   {
27 27
     require('includes/alliance/ali_external_request.inc');
28 28
   }
29 29
   else
30 30
   {
31
-    switch($mode)
31
+    switch ($mode)
32 32
     {
33 33
       case 'search':
34 34
         require('includes/alliance/ali_external_search.inc');
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 sn_ali_fill_user_ally($user);
54 54
 //$ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$user['ally_id']}'", '', true);
55
-if(!isset($user['ally']))
55
+if (!isset($user['ally']))
56 56
 {
57 57
   db_user_set_by_id($user['id'], "`ally_id` = null, `ally_name` = null, `ally_register_time` = 0, `ally_rank_id` = 0");
58 58
   messageBox($lang['ali_sys_notFound'], $lang['your_alliance'], 'alliance.php');
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
 
82 82
 // This piece converting old ally data to new one
83 83
 //  unset($ally['ranklist']);
84
-if(!$ally['ranklist'] && $ally['ally_ranks'])
84
+if (!$ally['ranklist'] && $ally['ally_ranks'])
85 85
 {
86 86
   $ally_ranks = unserialize($ally['ally_ranks']);
87 87
   $i = 0;
88
-  foreach($ally_ranks as $rank_id => $rank)
88
+  foreach ($ally_ranks as $rank_id => $rank)
89 89
   {
90
-    foreach($ally_rights as $key => $value)
90
+    foreach ($ally_rights as $key => $value)
91 91
     {
92 92
       $ranks[$i][$value] = $rank[$rights_old[$key]];
93 93
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     $i++;
96 96
   }
97 97
 
98
-  if(!empty($ranks))
98
+  if (!empty($ranks))
99 99
   {
100 100
     ali_rank_list_save($ranks);
101 101
   }
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 
115 115
 $edit = sys_get_param_str('edit');
116 116
 ally_pre_call();
117
-switch($mode)
117
+switch ($mode)
118 118
 {
119 119
   case 'admin':
120
-    if(!array_key_exists($edit , $sn_ali_admin_internal))
120
+    if (!array_key_exists($edit, $sn_ali_admin_internal))
121 121
     {
122 122
       $edit = 'default';
123 123
     }
124
-    if($sn_ali_admin_internal[$edit]['include'])
124
+    if ($sn_ali_admin_internal[$edit]['include'])
125 125
     {
126 126
       require("includes/{$sn_ali_admin_internal[$edit]['include']}");
127 127
     }
128
-    if(isset($sn_ali_admin_internal[$edit]['function']) && is_callable($sn_ali_admin_internal[$edit]['function']))
128
+    if (isset($sn_ali_admin_internal[$edit]['function']) && is_callable($sn_ali_admin_internal[$edit]['function']))
129 129
     {
130 130
       call_user_func($sn_ali_admin_internal[$edit]['function']);
131 131
     }
@@ -136,6 +136,6 @@  discard block
 block discarded – undo
136 136
   default:             require('includes/alliance/ali_info.inc'); break;
137 137
 }
138 138
 
139
-function ally_pre_call(){$func_args = func_get_args();return sn_function_call('ally_pre_call', $func_args);}
139
+function ally_pre_call() {$func_args = func_get_args(); return sn_function_call('ally_pre_call', $func_args); }
140 140
 
141 141
 ?>
Please login to merge, or discard this patch.
ajax_version_check.php 3 patches
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.
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,19 +22,19 @@
 block discarded – undo
22 22
 */
23 23
 switch($mode)
24 24
 {
25
-  case SNC_MODE_REGISTER:
26
-    if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id)
27
-    {
28
-      if($ajax)
25
+    case SNC_MODE_REGISTER:
26
+      if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id)
29 27
       {
30
-        print(SNC_VER_REGISTER_ERROR_REGISTERED);
28
+        if($ajax)
29
+        {
30
+          print(SNC_VER_REGISTER_ERROR_REGISTERED);
31
+        }
32
+        die();
31 33
       }
32
-      die();
33
-    }
34
-    $url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL);
35
-//TODO REMOVE DEBUG!!!
36
-//$url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode('http://supernova.ws/');
37
-  break;
34
+      $url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL);
35
+  //TODO REMOVE DEBUG!!!
36
+  //$url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode('http://supernova.ws/');
37
+    break;
38 38
 }
39 39
 
40 40
 $check_result = sn_get_url_contents($url);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 . '&key=' . urlencode(classSupernova::$config->server_updater_key)
21 21
 . '&id=' . urlencode(classSupernova::$config->server_updater_id);
22 22
 */
23
-switch($mode)
23
+switch ($mode)
24 24
 {
25 25
   case SNC_MODE_REGISTER:
26
-    if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id)
26
+    if (classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id)
27 27
     {
28
-      if($ajax)
28
+      if ($ajax)
29 29
       {
30 30
         print(SNC_VER_REGISTER_ERROR_REGISTERED);
31 31
       }
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
 }
39 39
 
40 40
 $check_result = sn_get_url_contents($url);
41
-if(!$check_result)
41
+if (!$check_result)
42 42
 {
43 43
   $version_check = SNC_VER_ERROR_CONNECT;
44 44
 }
45
-elseif(($version_check = intval($check_result)) && $version_check == $check_result)
45
+elseif (($version_check = intval($check_result)) && $version_check == $check_result)
46 46
 {
47 47
   $version_check = $check_result;
48 48
 }
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
   $check_result = json_decode($check_result, true);
53 53
   $version_check = $check_result === null ? SNC_VER_UNKNOWN_RESPONSE : $check_result['version_check'];
54 54
 
55
-  switch($mode)
55
+  switch ($mode)
56 56
   {
57 57
     case SNC_MODE_REGISTER:
58
-      if($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED)
58
+      if ($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED)
59 59
       {
60 60
         classSupernova::$config->db_saveItem('server_updater_key', $check_result['site']['site_key']);
61 61
         classSupernova::$config->db_saveItem('server_updater_id', $check_result['site']['site_id']);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 classSupernova::$config->db_saveItem('server_updater_check_last', SN_TIME_NOW);
70 70
 classSupernova::$config->db_saveItem('server_updater_check_result', $version_check);
71 71
 
72
-if($ajax)
72
+if ($ajax)
73 73
 {
74 74
   define('IN_AJAX', true);
75 75
   print($version_check);
Please login to merge, or discard this patch.
buddy.php 2 patches
Braces   +12 added lines, -11 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
             sprintf($lang['buddy_msg_accept_text'], $user['username']));
57 57
           sn_db_transaction_commit();
58 58
           throw new exception('buddy_err_accept_none', ERR_NONE);
59
-        }
60
-        else
59
+        } else
61 60
         {
62 61
           throw new exception('buddy_err_accept_internal', ERR_ERROR);
63 62
         }
@@ -69,9 +68,11 @@  discard block
 block discarded – undo
69 68
           throw new exception('buddy_err_delete_alien', ERR_ERROR);
70 69
         }
71 70
 
72
-        if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) // Existing friendship
71
+        if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) {
72
+          // Existing friendship
73 73
         {
74 74
           $ex_friend_id = $buddy_row['BUDDY_SENDER_ID'] == $user['id'] ? $buddy_row['BUDDY_OWNER_ID'] : $buddy_row['BUDDY_SENDER_ID'];
75
+        }
75 76
 
76 77
           msg_send_simple_message($ex_friend_id, $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, $user['username'], $lang['buddy_msg_unfriend_title'],
77 78
             sprintf($lang['buddy_msg_unfriend_text'], $user['username']));
@@ -79,17 +80,19 @@  discard block
 block discarded – undo
79 80
           doquery("DELETE FROM {{buddy}} WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1;");
80 81
           sn_db_transaction_commit();
81 82
           throw new exception('buddy_err_unfriend_none', ERR_NONE);
82
-        }
83
-        elseif($buddy_row['BUDDY_SENDER_ID'] == $user['id']) // Player's outcoming request - either denied or waiting
83
+        } elseif($buddy_row['BUDDY_SENDER_ID'] == $user['id']) {
84
+          // Player's outcoming request - either denied or waiting
84 85
         {
85 86
           doquery("DELETE FROM {{buddy}} WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1;");
87
+        }
86 88
           sn_db_transaction_commit();
87 89
           throw new exception('buddy_err_delete_own', ERR_NONE);
88
-        }
89
-        elseif($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_WAITING) // Deny incoming request
90
+        } elseif($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_WAITING) {
91
+          // Deny incoming request
90 92
         {
91 93
           msg_send_simple_message($buddy_row['BUDDY_SENDER_ID'], $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, $user['username'], $lang['buddy_msg_deny_title'],
92 94
             sprintf($lang['buddy_msg_deny_text'], $user['username']));
95
+        }
93 96
 
94 97
           doquery("UPDATE {{buddy}} SET `BUDDY_STATUS` = " . BUDDY_REQUEST_DENIED . " WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1;");
95 98
           sn_db_transaction_commit();
@@ -104,8 +107,7 @@  discard block
 block discarded – undo
104 107
   if($new_friend_id = sys_get_param_id('request_user_id'))
105 108
   {
106 109
     $new_friend_row = db_user_by_id($new_friend_id, true, '`id`, `username`');
107
-  }
108
-  elseif($new_friend_name = sys_get_param_str_unsafe('request_user_name'))
110
+  } elseif($new_friend_name = sys_get_param_str_unsafe('request_user_name'))
109 111
   {
110 112
     $new_friend_row = db_user_by_username($new_friend_name, true, '`id`, `username`');
111 113
     $new_friend_name = db_escape($new_friend_name);
@@ -138,8 +140,7 @@  discard block
 block discarded – undo
138 140
     sn_db_transaction_commit();
139 141
     throw new exception('buddy_err_adding_none', ERR_NONE);
140 142
   }
141
-}
142
-catch(exception $e)
143
+} catch(exception $e)
143 144
 {
144 145
   $result[] = array(
145 146
     'STATUS'  => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR,
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -18,39 +18,39 @@  discard block
 block discarded – undo
18 18
 {
19 19
   sn_db_transaction_start();
20 20
 
21
-  if($buddy_id = sys_get_param_id('buddy_id'))
21
+  if ($buddy_id = sys_get_param_id('buddy_id'))
22 22
   {
23 23
     $buddy_row = doquery("SELECT BUDDY_SENDER_ID, BUDDY_OWNER_ID, BUDDY_STATUS FROM {{buddy}} WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1 FOR UPDATE;", true);
24
-    if(!is_array($buddy_row))
24
+    if (!is_array($buddy_row))
25 25
     {
26 26
       throw new exception('buddy_err_not_exist', ERR_ERROR);
27 27
     }
28 28
 
29
-    switch($mode = sys_get_param_str('mode'))
29
+    switch ($mode = sys_get_param_str('mode'))
30 30
     {
31 31
       case 'accept':
32
-        if($buddy_row['BUDDY_SENDER_ID'] == $user['id'])
32
+        if ($buddy_row['BUDDY_SENDER_ID'] == $user['id'])
33 33
         {
34 34
           throw new exception('buddy_err_accept_own', ERR_ERROR);
35 35
         }
36 36
 
37
-        if($buddy_row['BUDDY_OWNER_ID'] != $user['id'])
37
+        if ($buddy_row['BUDDY_OWNER_ID'] != $user['id'])
38 38
         {
39 39
           throw new exception('buddy_err_accept_alien', ERR_ERROR);
40 40
         }
41 41
 
42
-        if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE)
42
+        if ($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE)
43 43
         {
44 44
           throw new exception('buddy_err_accept_already', ERR_WARNING);
45 45
         }
46 46
 
47
-        if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_DENIED)
47
+        if ($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_DENIED)
48 48
         {
49 49
           throw new exception('buddy_err_accept_denied', ERR_ERROR);
50 50
         }
51 51
 
52 52
         doquery("UPDATE {{buddy}} SET `BUDDY_STATUS` = " . BUDDY_REQUEST_ACTIVE . " WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1;");
53
-        if(classSupernova::$db->db_affected_rows())
53
+        if (classSupernova::$db->db_affected_rows())
54 54
         {
55 55
           msg_send_simple_message($buddy_row['BUDDY_SENDER_ID'], $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, $user['username'], $lang['buddy_msg_accept_title'],
56 56
             sprintf($lang['buddy_msg_accept_text'], $user['username']));
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
       break;
65 65
 
66 66
       case 'delete':
67
-        if($buddy_row['BUDDY_SENDER_ID'] != $user['id'] && $buddy_row['BUDDY_OWNER_ID'] != $user['id'])
67
+        if ($buddy_row['BUDDY_SENDER_ID'] != $user['id'] && $buddy_row['BUDDY_OWNER_ID'] != $user['id'])
68 68
         {
69 69
           throw new exception('buddy_err_delete_alien', ERR_ERROR);
70 70
         }
71 71
 
72
-        if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) // Existing friendship
72
+        if ($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) // Existing friendship
73 73
         {
74 74
           $ex_friend_id = $buddy_row['BUDDY_SENDER_ID'] == $user['id'] ? $buddy_row['BUDDY_OWNER_ID'] : $buddy_row['BUDDY_SENDER_ID'];
75 75
 
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
           sn_db_transaction_commit();
81 81
           throw new exception('buddy_err_unfriend_none', ERR_NONE);
82 82
         }
83
-        elseif($buddy_row['BUDDY_SENDER_ID'] == $user['id']) // Player's outcoming request - either denied or waiting
83
+        elseif ($buddy_row['BUDDY_SENDER_ID'] == $user['id']) // Player's outcoming request - either denied or waiting
84 84
         {
85 85
           doquery("DELETE FROM {{buddy}} WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1;");
86 86
           sn_db_transaction_commit();
87 87
           throw new exception('buddy_err_delete_own', ERR_NONE);
88 88
         }
89
-        elseif($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_WAITING) // Deny incoming request
89
+        elseif ($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_WAITING) // Deny incoming request
90 90
         {
91 91
           msg_send_simple_message($buddy_row['BUDDY_SENDER_ID'], $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, $user['username'], $lang['buddy_msg_deny_title'],
92 92
             sprintf($lang['buddy_msg_deny_text'], $user['username']));
@@ -101,24 +101,24 @@  discard block
 block discarded – undo
101 101
 
102 102
   // New request?
103 103
   // Checking for user ID - in case if it was request from outside buddy system
104
-  if($new_friend_id = sys_get_param_id('request_user_id'))
104
+  if ($new_friend_id = sys_get_param_id('request_user_id'))
105 105
   {
106 106
     $new_friend_row = db_user_by_id($new_friend_id, true, '`id`, `username`');
107 107
   }
108
-  elseif($new_friend_name = sys_get_param_str_unsafe('request_user_name'))
108
+  elseif ($new_friend_name = sys_get_param_str_unsafe('request_user_name'))
109 109
   {
110 110
     $new_friend_row = db_user_by_username($new_friend_name, true, '`id`, `username`');
111 111
     $new_friend_name = db_escape($new_friend_name);
112 112
   }
113 113
 
114
-  if($new_friend_row['id'] == $user['id'])
114
+  if ($new_friend_row['id'] == $user['id'])
115 115
   {
116 116
     unset($new_friend_row);
117 117
     throw new exception('buddy_err_adding_self', ERR_ERROR);
118 118
   }
119 119
 
120 120
   // Checking for user name & request text - in case if it was request to adding new request
121
-  if(isset($new_friend_row['id']) && ($new_request_text = sys_get_param_str('request_text')))
121
+  if (isset($new_friend_row['id']) && ($new_request_text = sys_get_param_str('request_text')))
122 122
   {
123 123
     $check_relation = doquery("SELECT `BUDDY_ID` FROM {{buddy}} WHERE
124 124
       (`BUDDY_SENDER_ID` = {$user['id']} AND `BUDDY_OWNER_ID` = {$new_friend_row['id']})
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
       (`BUDDY_SENDER_ID` = {$new_friend_row['id']} AND `BUDDY_OWNER_ID` = {$user['id']})
127 127
       LIMIT 1 FOR UPDATE;"
128 128
     , true);
129
-    if(isset($check_relation['BUDDY_ID']))
129
+    if (isset($check_relation['BUDDY_ID']))
130 130
     {
131 131
       throw new exception('buddy_err_adding_exists', ERR_WARNING);
132 132
     }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     throw new exception('buddy_err_adding_none', ERR_NONE);
140 140
   }
141 141
 }
142
-catch(exception $e)
142
+catch (exception $e)
143 143
 {
144 144
   $result[] = array(
145 145
     'STATUS'  => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR,
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 sn_db_transaction_rollback();
151 151
 
152 152
 $query = db_buddy_list_by_user($user['id']);
153
-while($row = db_fetch($query))
153
+while ($row = db_fetch($query))
154 154
 {
155 155
   $row['BUDDY_REQUEST'] = HelperString::nl2br($row['BUDDY_REQUEST']);
156 156
 
Please login to merge, or discard this patch.
simulator.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if(sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG'))
5
+if (sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG'))
6 6
 {
7 7
   define('BE_DEBUG', true);
8 8
 }
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 $sym_defender = $_POST['defender'] ? $_POST['defender'] : array();
16 16
 $sym_attacker = $_POST['attacker'] ? $_POST['attacker'] : array();
17 17
 
18
-if($replay)
18
+if ($replay)
19 19
 {
20 20
   $unpacked = sn_ube_simulator_decode_replay($replay);
21 21
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
   $sym_attacker = array(1 => $sym_attacker);
29 29
 }
30 30
 
31
-if($_POST['submit'] || $execute)
31
+if ($_POST['submit'] || $execute)
32 32
 {
33 33
   $replay = sn_ube_simulator_encode_replay($sym_defender, 'D');
34 34
   $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A');
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 //    sn_ube_report_save($combat_data);
43 43
 //  }
44 44
 
45
-  if(sys_get_param_str('reload'))
45
+  if (sys_get_param_str('reload'))
46 46
   {
47 47
     $combat_data = sn_ube_report_load($combat_data[UBE_REPORT_CYPHER]);
48 48
   }
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
   $template = gettemplate('simulator', true);
63 63
   $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL);
64 64
 
65
-  foreach($techs_and_officers as $tech_id)
65
+  foreach ($techs_and_officers as $tech_id)
66 66
   {
67
-    if(!$sym_attacker[1][$tech_id])
67
+    if (!$sym_attacker[1][$tech_id])
68 68
     {
69 69
       $sym_attacker[1][$tech_id] = mrc_get_level($user, false, $tech_id);
70 70
     }
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
     UNIT_GOVERNORS => array(MRC_FORTIFIER),
79 79
     UNIT_DEFENCE => sn_get_groups('defense_active'),
80 80
   );
81
-  foreach($show_groups as $unit_group_id => $unit_group)
81
+  foreach ($show_groups as $unit_group_id => $unit_group)
82 82
   {
83 83
     $template->assign_block_vars('simulator', array(
84 84
       'GROUP' => $unit_group_id,
85 85
       'NAME' => $lang['tech'][$unit_group_id],
86 86
     ));
87 87
 
88
-    foreach($unit_group as $unit_id)
88
+    foreach ($unit_group as $unit_id)
89 89
     {
90 90
       $tab++;
91 91
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
   $sym_defender = $unpacked['D'];
23 23
   $sym_attacker = $unpacked['A'];
24
-}
25
-else
24
+} else
26 25
 {
27 26
   $sym_defender = array(0 => $sym_defender);
28 27
   $sym_attacker = array(1 => $sym_attacker);
@@ -62,8 +61,7 @@  discard block
 block discarded – undo
62 61
   ));
63 62
 
64 63
   display($template);
65
-}
66
-else
64
+} else
67 65
 {
68 66
   $template = gettemplate('simulator', true);
69 67
   $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL);
Please login to merge, or discard this patch.
login.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
 include('includes/init.' . substr(strrchr(__FILE__, '.'), 1));
17 17
 // die();
18
-if($template_result[F_USER_IS_AUTHORIZED]) {
18
+if ($template_result[F_USER_IS_AUTHORIZED]) {
19 19
   sys_redirect('index' . DOT_PHP_EX);
20 20
 }
21 21
 lng_include('login');
Please login to merge, or discard this patch.
market.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $newstock = $stock;
27 27
 $intError = MARKET_DEAL;
28 28
 
29
-switch($mode)
29
+switch ($mode)
30 30
 {
31 31
   case MARKET_RESOURCES: // Resource trader
32 32
     require('includes/includes/market_trader.inc');
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 }
83 83
 
84 84
 $message_id = sys_get_param_int('message');
85
-if($message_id != MARKET_NOTHING)
85
+if ($message_id != MARKET_NOTHING)
86 86
 {
87 87
   $template->assign_block_vars('result', array('MESSAGE' => $lang['eco_mrk_errors'][$message_id]));
88 88
 }
89 89
 
90
-if($message)
90
+if ($message)
91 91
 {
92 92
   $template->assign_block_vars('result', array('MESSAGE' => $message));
93 93
 }
Please login to merge, or discard this patch.