Completed
Push — work-fleets ( 961997...006942 )
by SuperNova.WS
06:22
created
includes/includes/sys_stat.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -39,23 +39,23 @@  discard block
 block discarded – undo
39 39
 
40 40
   $sta_update_msg = db_escape($sta_update_msg);
41 41
 
42
-  if($next_step) {
42
+  if ($next_step) {
43 43
     $sta_update_step++;
44 44
   }
45 45
   $sta_update_msg = "Update in progress. Step {$sta_update_step}/14: {$sta_update_msg}.";
46 46
 
47 47
   classSupernova::$config->db_saveItem('var_stat_update_msg', $sta_update_msg);
48
-  if($next_step) {
48
+  if ($next_step) {
49 49
     classSupernova::$debug->warning($sta_update_msg, 'Stat update', LOG_INFO_STAT_PROCESS);
50 50
   }
51 51
 }
52 52
 
53 53
 function sys_stat_calculate_flush(&$data, $force = false) {
54
-  if(count($data) < 25 && !$force) {
54
+  if (count($data) < 25 && !$force) {
55 55
     return;
56 56
   }
57 57
 
58
-  if(!empty($data)) {
58
+  if (!empty($data)) {
59 59
     doquery('REPLACE INTO {{statpoints}}
60 60
       (`id_owner`, `id_ally`, `stat_type`, `stat_code`, `tech_points`, `tech_count`, `build_points`, `build_count`,
61 61
        `defs_points`, `defs_count`, `fleet_points`, `fleet_count`, `res_points`, `res_count`, `total_points`,
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
   $user_list = DBStaticUser::db_user_list('', true, 'id, dark_matter, metal, crystal, deuterium, user_as_ally, ally_id');
96 96
   $row_num = count($user_list);
97 97
   // while($player = db_fetch($query))
98
-  foreach($user_list as $player) {
99
-    if($i++ % 100 == 0) {
98
+  foreach ($user_list as $player) {
99
+    if ($i++ % 100 == 0) {
100 100
       sta_set_time_limit("calculating players stats (player {$i}/{$row_num})", false);
101 101
     }
102
-    if(array_key_exists($user_id = $player['id'], $user_skip_list)) {
102
+    if (array_key_exists($user_id = $player['id'], $user_skip_list)) {
103 103
       continue;
104 104
     }
105 105
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     // $points[$user_id][UNIT_RESOURCES] += $resources;
110 110
 
111 111
     // А здесь мы фильтруем пользователей по $user_skip_list - далее не нужно этого делать, потому что
112
-    if(!isset($user_skip_list[$user_id])) {
112
+    if (!isset($user_skip_list[$user_id])) {
113 113
       $user_allies[$user_id] = $player['ally_id'];
114 114
     }
115 115
   }
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
   $i = 0;
124 124
   $query = DBStaticPlanet::db_planet_list_resources_by_owner();
125 125
   $row_num = db_num_rows($query);
126
-  while($planet = db_fetch($query)) {
127
-    if($i++ % 100 == 0) {
126
+  while ($planet = db_fetch($query)) {
127
+    if ($i++ % 100 == 0) {
128 128
       sta_set_time_limit("calculating planets stats (planet {$i}/{$row_num})", false);
129 129
     }
130
-    if(array_key_exists($user_id = $planet['id_owner'], $user_skip_list)) {
130
+    if (array_key_exists($user_id = $planet['id_owner'], $user_skip_list)) {
131 131
       continue;
132 132
     }
133 133
 
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
   $i = 0;
143 143
   $query = FleetList::dbQueryAllId();
144 144
   $row_num = db_num_rows($query);
145
-  while($fleet_row = db_fetch($query)) {
146
-    if($i++ % 100 == 0) {
145
+  while ($fleet_row = db_fetch($query)) {
146
+    if ($i++ % 100 == 0) {
147 147
       sta_set_time_limit("calculating flying fleets stats (fleet {$i}/{$row_num})", false);
148 148
     }
149 149
     $objFleet = new Fleet();
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
     // К тому же при включённом кэшировании это быстро забъёт кэш холодными данными
152 152
     // $objFleet->_reset();
153 153
     $objFleet->dbRowParse($fleet_row);
154
-    if(array_key_exists($user_id = $objFleet->playerOwnerId, $user_skip_list)) {
154
+    if (array_key_exists($user_id = $objFleet->playerOwnerId, $user_skip_list)) {
155 155
       continue;
156 156
     }
157 157
 
158
-    foreach($objFleet->shipsIterator() as $unit_id => $unit) {
158
+    foreach ($objFleet->shipsIterator() as $unit_id => $unit) {
159 159
       $counts[$user_id][UNIT_SHIPS] += $unit->count;
160 160
 
161
-      if(!isset($unit_cost_cache[$unit_id][0])) {
161
+      if (!isset($unit_cost_cache[$unit_id][0])) {
162 162
         $unit_cost_cache[$unit_id][0] = get_unit_param($unit_id, P_COST);
163 163
       }
164 164
       $unit_cost_data = &$unit_cost_cache[$unit_id][0];
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
   $i = 0;
179 179
   $query = DBStaticUnit::db_unit_list_stat_calculate();
180 180
   $row_num = db_num_rows($query);
181
-  while($unit = db_fetch($query)) {
182
-    if($i++ % 100 == 0) {
181
+  while ($unit = db_fetch($query)) {
182
+    if ($i++ % 100 == 0) {
183 183
       sta_set_time_limit("calculating unit stats (unit {$i}/{$row_num})", false);
184 184
     }
185
-    if(array_key_exists($user_id = $unit['unit_player_id'], $user_skip_list)) {
185
+    if (array_key_exists($user_id = $unit['unit_player_id'], $user_skip_list)) {
186 186
       continue;
187 187
     }
188 188
 
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
   $i = 0;
197 197
   $query = DBStaticQue::db_que_list_stat();
198 198
   $row_num = db_num_rows($query);
199
-  while($que_item = db_fetch($query)) {
200
-    if($i++ % 100 == 0) {
199
+  while ($que_item = db_fetch($query)) {
200
+    if ($i++ % 100 == 0) {
201 201
       sta_set_time_limit("calculating ques stats (que item {$i}/{$row_num})", false);
202 202
     }
203
-    if(array_key_exists($user_id = $que_item['que_player_id'], $user_skip_list)) {
203
+    if (array_key_exists($user_id = $que_item['que_player_id'], $user_skip_list)) {
204 204
       continue;
205 205
     }
206 206
     $que_unit_amount = $que_item['que_unit_amount'];
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
   sta_set_time_limit('posting new user stats to DB');
221 221
   $data = array();
222
-  foreach($user_allies as $user_id => $ally_id) {
222
+  foreach ($user_allies as $user_id => $ally_id) {
223 223
     // $counts[UNIT_RESOURCES] дублирует $points[UNIT_RESOURCES], поэтому $points не заполняем, а берем $counts и делим на 1000
224 224
     $points[$user_id][UNIT_RESOURCES] = $counts[$user_id][UNIT_RESOURCES] / 1000;
225 225
     $points[$user_id] = array_map('floor', $points[$user_id]);
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
     $user_points = array_sum($points[$user_id]);
232 232
     $user_counts = array_sum($counts[$user_id]);
233 233
 
234
-    $data[] = $q = "({$user_id},{$ally_id},1,1,'{$points[$user_id][UNIT_TECHNOLOGIES]}','{$counts[$user_id][UNIT_TECHNOLOGIES]}'," .
235
-      "'{$points[$user_id][UNIT_STRUCTURES]}','{$counts[$user_id][UNIT_STRUCTURES]}','{$user_defence_points}','{$user_defence_counts}'," .
236
-      "'{$points[$user_id][UNIT_SHIPS]}','{$counts[$user_id][UNIT_SHIPS]}','{$points[$user_id][UNIT_RESOURCES]}','{$counts[$user_id][UNIT_RESOURCES]}'," .
237
-      "{$user_points},{$user_counts}," . SN_TIME_NOW . ")";
234
+    $data[] = $q = "({$user_id},{$ally_id},1,1,'{$points[$user_id][UNIT_TECHNOLOGIES]}','{$counts[$user_id][UNIT_TECHNOLOGIES]}',".
235
+      "'{$points[$user_id][UNIT_STRUCTURES]}','{$counts[$user_id][UNIT_STRUCTURES]}','{$user_defence_points}','{$user_defence_counts}',".
236
+      "'{$points[$user_id][UNIT_SHIPS]}','{$counts[$user_id][UNIT_SHIPS]}','{$points[$user_id][UNIT_RESOURCES]}','{$counts[$user_id][UNIT_RESOURCES]}',".
237
+      "{$user_points},{$user_counts},".SN_TIME_NOW.")";
238 238
 
239 239
     sys_stat_calculate_flush($data);
240 240
   }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         SUM(u.`tech_points`)+aus.`tech_points`, SUM(u.`tech_count`)+aus.`tech_count`, SUM(u.`build_points`)+aus.`build_points`, SUM(u.`build_count`)+aus.`build_count`,
255 255
         SUM(u.`defs_points`)+aus.`defs_points`, SUM(u.`defs_count`)+aus.`defs_count`, SUM(u.`fleet_points`)+aus.`fleet_points`, SUM(u.`fleet_count`)+aus.`fleet_count`,
256 256
         SUM(u.`res_points`)+aus.`res_points`, SUM(u.`res_count`)+aus.`res_count`, SUM(u.`total_points`)+aus.`total_points`, SUM(u.`total_count`)+aus.`total_count`,
257
-        " . SN_TIME_NOW . ", NULL, u.`id_ally`, 2, 1,
257
+        " . SN_TIME_NOW.", NULL, u.`id_ally`, 2, 1,
258 258
         a.tech_rank, a.build_rank, a.defs_rank, a.fleet_rank, a.res_rank, a.total_rank
259 259
       FROM {{statpoints}} AS u
260 260
         JOIN {{alliance}} AS al ON al.id = u.id_ally
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
   // Updating player's ranks
277 277
   sta_set_time_limit("updating ranks for players");
278
-  foreach($rankNames as $rankName) {
278
+  foreach ($rankNames as $rankName) {
279 279
     sta_set_time_limit("updating player rank '{$rankName}'", false);
280 280
     doquery($qryResetRowNum);
281 281
     doquery(sprintf($qryFormat, $rankName, 1));
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
   sta_set_time_limit("updating ranks for Alliances");
285 285
   // --- Updating Allie's ranks
286
-  foreach($rankNames as $rankName) {
286
+  foreach ($rankNames as $rankName) {
287 287
     sta_set_time_limit("updating Alliances rank '{$rankName}'", false);
288 288
     doquery($qryResetRowNum);
289 289
     doquery(sprintf($qryFormat, $rankName, 2));
Please login to merge, or discard this patch.
includes/functions/sys_bbcode.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -103,23 +103,23 @@
 block discarded – undo
103 103
 
104 104
   !empty(classSupernova::$config->url_faq) ? $msg = str_replace('faq://', classSupernova::$config->url_faq, $msg) : false;
105 105
 
106
-  foreach(classSupernova::$design['bbcodes'] as $auth_level => $replaces) {
107
-    if($auth_level > $author_auth) {
106
+  foreach (classSupernova::$design['bbcodes'] as $auth_level => $replaces) {
107
+    if ($auth_level > $author_auth) {
108 108
       continue;
109 109
     }
110 110
 
111
-    foreach($replaces as $key => $html) {
111
+    foreach ($replaces as $key => $html) {
112 112
       $msg = preg_replace(''.$key.'', $html, $msg);
113 113
     }
114 114
   }
115 115
 
116
-  foreach(classSupernova::$design['smiles'] as $auth_level => $replaces) {
117
-    if($auth_level > $author_auth) {
116
+  foreach (classSupernova::$design['smiles'] as $auth_level => $replaces) {
117
+    if ($auth_level > $author_auth) {
118 118
       continue;
119 119
     }
120 120
 
121
-    foreach($replaces as $key => $imgName) {
122
-      $msg = preg_replace("#" . addcslashes($key, '()[]{}') . "#isU","<img src=\"design/images/smileys/".$imgName.".gif\" align=\"absmiddle\" title=\"".$key."\" alt=\"".$key."\">",$msg);
121
+    foreach ($replaces as $key => $imgName) {
122
+      $msg = preg_replace("#".addcslashes($key, '()[]{}')."#isU", "<img src=\"design/images/smileys/".$imgName.".gif\" align=\"absmiddle\" title=\"".$key."\" alt=\"".$key."\">", $msg);
123 123
     }
124 124
   }
125 125
 
Please login to merge, or discard this patch.
admin/userlist.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 define('INSIDE', true);
13 13
 define('INSTALL', false);
14 14
 define('IN_ADMIN', true);
15
-require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15
+require('../common.'.substr(strrchr(__FILE__, '.'), 1));
16 16
 
17 17
 global $user;
18
-if($user['authlevel'] < 3) {
18
+if ($user['authlevel'] < 3) {
19 19
   AdminMessage(classLocale::$lang['adm_err_denied']);
20 20
 }
21 21
 
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 $sort = sys_get_param_int('sort', SORT_ID);
40 40
 $sort = $sort_fields[$sort] ? $sort : SORT_ID;
41 41
 
42
-if(($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) {
42
+if (($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) {
43 43
   $user_selected = DBStaticUser::db_user_by_id($user_id, false, 'id, username, authlevel');
44
-  if($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) {
45
-    switch($action) {
44
+  if ($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) {
45
+    switch ($action) {
46 46
       case ACTION_DELETE:
47 47
         DeleteSelectedUser($user_id);
48 48
         sys_redirect("{$_SERVER['SCRIPT_NAME']}?sort={$sort}");
@@ -62,20 +62,20 @@  discard block
 block discarded – undo
62 62
 $template = gettemplate('admin/userlist', true);
63 63
 
64 64
 $multi_ip = array();
65
-foreach(DBStaticUser::db_user_list_admin_multiaccounts() as $ip) {
65
+foreach (DBStaticUser::db_user_list_admin_multiaccounts() as $ip) {
66 66
   $multi_ip[$ip['user_lastip']] = $ip['ip_count'];
67 67
 }
68 68
 
69 69
 $geoip = geoip_status();
70 70
 $count = 0;
71
-foreach(DBStaticUser::db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page) as $user_row ) {
71
+foreach (DBStaticUser::db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page) as $user_row) {
72 72
   $count++;
73
-  if($user_row['banaday']) {
73
+  if ($user_row['banaday']) {
74 74
     $ban_details = db_ban_list_get_details($user_row);
75 75
   }
76 76
 
77 77
   $geoip_info = $geoip ? geoip_ip_info(ip2longu($user_row['user_lastip'])) : array();
78
-  foreach($geoip_info as $key => $value) {
78
+  foreach ($geoip_info as $key => $value) {
79 79
     $geoip_info[strtoupper($key)] = $value;
80 80
     unset($geoip_info[$key]);
81 81
   }
Please login to merge, or discard this patch.
includes/vars/vars_mission_checks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
   'checkSpeedPercentOld'       => FLIGHT_FLEET_SPEED_WRONG,
11 11
   'checkTargetInUniverse'      => FLIGHT_VECTOR_BEYOND_UNIVERSE,
12 12
   'checkTargetNotSource'       => FLIGHT_VECTOR_SAME_SOURCE,
13
-  'checkSenderNoVacation'      => FLIGHT_PLAYER_VACATION_OWN,  // tODO
13
+  'checkSenderNoVacation'      => FLIGHT_PLAYER_VACATION_OWN, // tODO
14 14
   'checkTargetNoVacation'      => FLIGHT_PLAYER_VACATION,
15 15
   'checkFleetNotEmpty'         => FLIGHT_SHIPS_NO_SHIPS,
16 16
   // 'checkUnitsPositive'         => FLIGHT_SHIPS_NEGATIVE, // Unused - 'cause it's not allowed to put negative units into Unit class
Please login to merge, or discard this patch.
includes/vars/vars_structures.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
       'factor' => 1.5,
16 16
     ),
17 17
     P_UNIT_PRODUCTION => array(
18
-      RES_METAL     => function ($level, $production_factor, $user, $planet_row) {return  40 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
19
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return -13 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
18
+      RES_METAL     => function($level, $production_factor, $user, $planet_row) {return  40 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
19
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return -13 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
20 20
     ),
21 21
     P_MINING_IS_MANAGED => true,
22 22
   ),
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
       'factor' => 1.6,
34 34
     ),
35 35
     P_UNIT_PRODUCTION => array(
36
-      RES_CRYSTAL   => function ($level, $production_factor, $user, $planet_row) {return  32 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
37
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return -16 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
36
+      RES_CRYSTAL   => function($level, $production_factor, $user, $planet_row) {return  32 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
37
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return -16 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
38 38
     ),
39 39
     P_MINING_IS_MANAGED => true,
40 40
   ),
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
       'factor' => 1.5,
52 52
     ),
53 53
     P_UNIT_PRODUCTION => array(
54
-      RES_DEUTERIUM => function ($level, $production_factor, $user, $planet_row) {return  10 * $level * pow(1.1, $level) * (0.1 * $production_factor) * (-0.002 * $planet_row["temp_max"] + 1.28);},
55
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return -20 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
54
+      RES_DEUTERIUM => function($level, $production_factor, $user, $planet_row) {return  10 * $level * pow(1.1, $level) * (0.1 * $production_factor) * (-0.002 * $planet_row["temp_max"] + 1.28); },
55
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return -20 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
56 56
     ),
57 57
     P_MINING_IS_MANAGED => true,
58 58
   ),
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
       'factor' => 1.5,
70 70
     ),
71 71
     P_UNIT_PRODUCTION => array(
72
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 5 + 15) * $level * pow(1.1, $level) * (0.1 * $production_factor);},
72
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 5 + 15) * $level * pow(1.1, $level) * (0.1 * $production_factor); },
73 73
     ),
74 74
     P_MINING_IS_MANAGED => true,
75 75
   ),
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
       'factor' => 1.8,
88 88
     ),
89 89
     P_UNIT_PRODUCTION => array(
90
-      RES_DEUTERIUM => function ($level, $production_factor, $user, $planet_row) {return -10 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
91
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return  30 * $level * pow(1.05 + 0.01 * mrc_get_level($user, null, TECH_ENERGY), $level) * (0.1 * $production_factor);},
90
+      RES_DEUTERIUM => function($level, $production_factor, $user, $planet_row) {return -10 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
91
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return  30 * $level * pow(1.05 + 0.01 * mrc_get_level($user, null, TECH_ENERGY), $level) * (0.1 * $production_factor); },
92 92
     ),
93 93
     P_MINING_IS_MANAGED => true,
94 94
   ),
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
       'factor' => 2,
106 106
     ),
107 107
     'storage' => array(
108
-      RES_METAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);},
108
+      RES_METAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); },
109 109
     ),
110 110
   ),
111 111
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
       'factor' => 2,
122 122
     ),
123 123
     'storage' => array(
124
-      RES_CRYSTAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);},
124
+      RES_CRYSTAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); },
125 125
     ),
126 126
   ),
127 127
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
       'factor' => 2,
138 138
     ),
139 139
     'storage' => array(
140
-      RES_DEUTERIUM => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);},
140
+      RES_DEUTERIUM => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); },
141 141
     ),
142 142
   ),
143 143
 
Please login to merge, or discard this patch.
includes/vars/vars_combats.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     'shield' => 10,
36 36
     'armor' => 400,
37 37
     'attack' => 5,
38
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
38
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
39 39
   ),
40 40
   SHIP_CARGO_BIG => array(
41 41
     'name' => 'big_ship_cargo',
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     'shield' => 25,
56 56
     'armor' => 1200,
57 57
     'attack' => 5,
58
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
58
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
59 59
     'engine' => array(
60 60
       array(
61 61
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     'shield' => 50,
84 84
     'armor' => 3000,
85 85
     'attack' => 10,
86
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
86
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
87 87
     'engine' => array(
88 88
       array(
89 89
         'tech' => TECH_ENGINE_ION,
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     'shield' => 200,
112 112
     'armor' => 70000,
113 113
     'attack' => 50,
114
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
114
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
115 115
     'engine' => array(
116 116
       array(
117 117
         'tech' => TECH_ENGINE_HYPER,
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     'shield' => 100,
141 141
     'armor' => 3000,
142 142
     'attack' => 50,
143
-    'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ),
143
+    'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,),
144 144
     'engine' => array(
145 145
       array(
146 146
         'tech' => TECH_ENGINE_ION,
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     'shield' => 10,
169 169
     'armor' => 1600,
170 170
     'attack' => 1,
171
-    'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050, ),
171
+    'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050,),
172 172
     'engine' => array(
173 173
       array(
174 174
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     'shield' =>  0.01,
197 197
     'armor' => 100,
198 198
     'attack' =>  0.01,
199
-    'amplify' => array( SHIP_SPY => 1,),
199
+    'amplify' => array(SHIP_SPY => 1,),
200 200
     'engine' => array(
201 201
       array(
202 202
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
       'factor' => 1,
221 221
     ),
222 222
     P_UNIT_PRODUCTION => array(
223
-      RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor);},
223
+      RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); },
224 224
     ),
225 225
     P_MINING_IS_MANAGED => true,
226 226
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     'shield' => 10,
230 230
     'armor' => 200,
231 231
     'attack' => 1,
232
-    'amplify' => array(SHIP_SPY => 1, ),
232
+    'amplify' => array(SHIP_SPY => 1,),
233 233
     'engine' => array(
234 234
       array(
235 235
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     'shield' => 10,
262 262
     'armor' => 400,
263 263
     'attack' => 50,
264
-    'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ),
264
+    'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,),
265 265
     'engine' => array(
266 266
       array(
267 267
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     'shield' => 25,
291 291
     'armor' => 1000,
292 292
     'attack' => 150,
293
-    'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7, ),
293
+    'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7,),
294 294
     'engine' => array(
295 295
       array(
296 296
         'tech' => TECH_ENGINE_ION,
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
     'shield' =>  50,
350 350
     'armor' => 2700,
351 351
     'attack' => 400,
352
-    'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5, ),
352
+    'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5,),
353 353
     'engine' => array(
354 354
       array(
355 355
         'tech' => TECH_ENGINE_ION,
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     'shield' =>  200,
409 409
     'armor' =>  6000,
410 410
     'attack' => 1000,
411
-    'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76, ),
411
+    'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76,),
412 412
     'engine' => array(
413 413
       array(
414 414
         'tech' => TECH_ENGINE_HYPER,
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
     'shield' =>  500,
505 505
     'armor' => 11000,
506 506
     'attack' => 2000,
507
-    'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125, ),
507
+    'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125,),
508 508
     'engine' => array(
509 509
       array(
510 510
         'tech' => TECH_ENGINE_HYPER,
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
     'shield' => 20,
609 609
     'armor' => 200,
610 610
     'attack' => 80,
611
-    'amplify' => array(SHIP_SPY => 7, ),
611
+    'amplify' => array(SHIP_SPY => 7,),
612 612
   ),
613 613
   UNIT_DEF_TURRET_LASER_SMALL => array(
614 614
     'name' => 'small_laser',
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
     'shield' => 25,
627 627
     'armor' => 200,
628 628
     'attack' => 100,
629
-    'amplify' => array(SHIP_SPY => 5, ),
629
+    'amplify' => array(SHIP_SPY => 5,),
630 630
   ),
631 631
   UNIT_DEF_TURRET_LASER_BIG => array(
632 632
     'name' => 'big_laser',
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
     'shield' => 100,
645 645
     'armor' => 800,
646 646
     'attack' => 250,
647
-    'amplify' => array(SHIP_SPY => 2, ),
647
+    'amplify' => array(SHIP_SPY => 2,),
648 648
   ),
649 649
   UNIT_DEF_TURRET_GAUSS => array(
650 650
     'name' => 'gauss_canyon',
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
     'armor' => 3500,
663 663
     'shield' => 200,
664 664
     'attack' => 1100,
665
-    'amplify' => array(SHIP_SPY => 0.5, ),
665
+    'amplify' => array(SHIP_SPY => 0.5,),
666 666
   ),
667 667
   UNIT_DEF_TURRET_ION => array(
668 668
     'name' => 'ionic_canyon',
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
     'shield' => 500,
681 681
     'armor' => 800,
682 682
     'attack' => 150,
683
-    'amplify' => array(SHIP_SPY => 3.3, ),
683
+    'amplify' => array(SHIP_SPY => 3.3,),
684 684
   ),
685 685
   UNIT_DEF_TURRET_PLASMA => array(
686 686
     'name' => 'buster_canyon',
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
     'shield' => 300,
699 699
     'armor' => 10000,
700 700
     'attack' => 3000,
701
-    'amplify' => array(SHIP_SPY => 0.17, ),
701
+    'amplify' => array(SHIP_SPY => 0.17,),
702 702
   ),
703 703
 
704 704
   UNIT_DEF_SHIELD_SMALL => array(
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
     'shield' => 2000,
719 719
     'armor' => 2000,
720 720
     'attack' => 1,
721
-    'amplify' => array(SHIP_SPY => 500, ),
721
+    'amplify' => array(SHIP_SPY => 500,),
722 722
   ),
723 723
   UNIT_DEF_SHIELD_BIG => array(
724 724
     'name' => 'big_protection_shield',
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
     'shield' => 2000,
738 738
     'armor' => 10000,
739 739
     'attack' => 1,
740
-    'amplify' => array(SHIP_SPY => 500, ),
740
+    'amplify' => array(SHIP_SPY => 500,),
741 741
   ),
742 742
   UNIT_DEF_SHIELD_PLANET => array(
743 743
     'name'      => 'planet_protector',
Please login to merge, or discard this patch.
includes/vars/vars_menu.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -104,21 +104,21 @@  discard block
 block discarded – undo
104 104
     'LEVEL' => 'submenu',
105 105
     'TYPE'  => 'lang',
106 106
     'ITEM'  => 'tech[UNIT_STRUCTURES]',
107
-    'LINK'  => 'buildings.php?mode=' . QUE_STRUCTURES,
107
+    'LINK'  => 'buildings.php?mode='.QUE_STRUCTURES,
108 108
     'ICON'  => true,
109 109
   ),
110 110
   'menu_planet_shipyard'   => array(
111 111
     'LEVEL' => 'submenu',
112 112
     'TYPE'  => 'lang',
113 113
     'ITEM'  => 'Shipyard',
114
-    'LINK'  => 'buildings.php?mode=' . SUBQUE_FLEET,
114
+    'LINK'  => 'buildings.php?mode='.SUBQUE_FLEET,
115 115
     'ICON'  => true,
116 116
   ),
117 117
   'menu_planet_defense'    => array(
118 118
     'LEVEL' => 'submenu',
119 119
     'TYPE'  => 'lang',
120 120
     'ITEM'  => 'Defense',
121
-    'LINK'  => 'buildings.php?mode=' . SUBQUE_DEFENSE,
121
+    'LINK'  => 'buildings.php?mode='.SUBQUE_DEFENSE,
122 122
     'ICON'  => true,
123 123
   ),
124 124
   'menu_planet_resources'  => array(
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     'LEVEL' => 'submenu',
148 148
     'TYPE'  => 'lang',
149 149
     'ITEM'  => 'Research',
150
-    'LINK'  => 'buildings.php?mode=' . QUE_RESEARCH,
150
+    'LINK'  => 'buildings.php?mode='.QUE_RESEARCH,
151 151
     'ICON'  => true,
152 152
   ),
153 153
   'menu_empire_techtree' => array(
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
     'LEVEL' => 'submenu',
234 234
     'TYPE'  => 'lang',
235 235
     'ITEM'  => 'tech[UNIT_MERCENARIES]',
236
-    'LINK'  => 'officer.php?mode=' . UNIT_MERCENARIES,
236
+    'LINK'  => 'officer.php?mode='.UNIT_MERCENARIES,
237 237
     'ICON'  => true,
238 238
   ),
239 239
   'menu_empire_schematics'  => array(
240 240
     'LEVEL' => 'submenu',
241 241
     'TYPE'  => 'lang',
242 242
     'ITEM'  => 'tech[UNIT_PLANS]',
243
-    'LINK'  => 'officer.php?mode=' . UNIT_PLANS,
243
+    'LINK'  => 'officer.php?mode='.UNIT_PLANS,
244 244
     'ICON'  => true,
245 245
   ),
246 246
   'menu_empire_artifacts'   => array(
@@ -270,14 +270,14 @@  discard block
 block discarded – undo
270 270
     'LEVEL' => 'submenu',
271 271
     'TYPE'  => 'lang',
272 272
     'ITEM'  => 'Chat',
273
-    'LINK'  => 'index.php?page=chat&mode=' . CHAT_MODE_COMMON,
273
+    'LINK'  => 'index.php?page=chat&mode='.CHAT_MODE_COMMON,
274 274
     'ICON'  => true,
275 275
   ),
276 276
   'menu_ally_chat'     => array(
277 277
     'LEVEL'    => 'submenu',
278 278
     'TYPE'     => 'lang',
279 279
     'ITEM'     => 'AllyChat',
280
-    'LINK'     => 'index.php?page=chat&mode=' . CHAT_MODE_ALLY,
280
+    'LINK'     => 'index.php?page=chat&mode='.CHAT_MODE_ALLY,
281 281
     'ICON'     => true,
282 282
     'DISABLED' => classSupernova::$config->game_mode == GAME_BLITZ,
283 283
   ),
@@ -458,8 +458,8 @@  discard block
 block discarded – undo
458 458
   ),
459 459
   'menu_admin_version_info'  => array(
460 460
     'TYPE' => 'text',
461
-    'ITEM' => (classSupernova::$config->server_updater_check_last ? date(FMT_DATE, classSupernova::$config->server_updater_check_last) : '') . '<div class="' .
462
-      $sn_version_check_class[classSupernova::$config->server_updater_check_result] . '">' . classLocale::$lang['adm_opt_ver_response_short'][classSupernova::$config->server_updater_check_result] . '</div>',
461
+    'ITEM' => (classSupernova::$config->server_updater_check_last ? date(FMT_DATE, classSupernova::$config->server_updater_check_last) : '').'<div class="'.
462
+      $sn_version_check_class[classSupernova::$config->server_updater_check_result].'">'.classLocale::$lang['adm_opt_ver_response_short'][classSupernova::$config->server_updater_check_result].'</div>',
463 463
   ),
464 464
 
465 465
   'USER_AUTHLEVEL_NAME'      => array(
@@ -547,13 +547,13 @@  discard block
 block discarded – undo
547 547
   'menu_admin_planet_list_planets' => array(
548 548
     'TYPE'       => 'lang',
549 549
     'ITEM'       => 'adm_pltlst',
550
-    'LINK'       => 'admin/adm_planet_list.php?planet_type=' . PT_PLANET,
550
+    'LINK'       => 'admin/adm_planet_list.php?planet_type='.PT_PLANET,
551 551
     'AUTH_LEVEL' => 3,
552 552
   ),
553 553
   'menu_admin_planet_list_moons'   => array(
554 554
     'TYPE'       => 'lang',
555 555
     'ITEM'       => 'adm_moonlst',
556
-    'LINK'       => 'admin/adm_planet_list.php?planet_type=' . PT_MOON,
556
+    'LINK'       => 'admin/adm_planet_list.php?planet_type='.PT_MOON,
557 557
     'AUTH_LEVEL' => 3,
558 558
   ),
559 559
   'menu_admin_planet_moon_add'     => array(
Please login to merge, or discard this patch.
includes/alliance/ali_external_search.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
3
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
4 4
   classSupernova::$debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
5 5
 }
6 6
 
7 7
 $template = gettemplate('ali_search', true);
8 8
 
9 9
 $ali_search_text = sys_get_param_str('searchtext');
10
-if($ali_search_text) {
10
+if ($ali_search_text) {
11 11
   $template->assign_var('SEARCH_TEXT', $ali_search_text);
12 12
 
13 13
   $search = DBStaticAlly::db_ally_search_by_name_or_tag($ali_search_text);
14
-  if(classSupernova::$db->db_num_rows($search)) {
15
-    while($ally_row = db_fetch($search)) {
14
+  if (classSupernova::$db->db_num_rows($search)) {
15
+    while ($ally_row = db_fetch($search)) {
16 16
       $template->assign_block_vars('alliances', array(
17 17
         'ID'          => $ally_row['id'],
18 18
         'TAG'         => $ally_row['ally_tag'],
Please login to merge, or discard this patch.
tests.int/FleetTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 define('SN_IN_FLEET', true);
6 6
 define('SN_RENDER_NAVBAR_PLANET', true);
7 7
 
8
-include('../common.' . substr(strrchr(__FILE__, '.'), 1));
8
+include('../common.'.substr(strrchr(__FILE__, '.'), 1));
9 9
 
10 10
 // TODO - Переместить это куда-нибудь
11 11
 $fleet_page = sys_get_param_int('fleet_page', sys_get_param_int('mode'));
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 //  break;
193 193
     }
194 194
 
195
-    if($exceptionCode !== null) {
196
-      print('<span style="color: red; font-size: 200%;">FAILED! Expected Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - FAILED!</span><br />');
195
+    if ($exceptionCode !== null) {
196
+      print('<span style="color: red; font-size: 200%;">FAILED! Expected Exception ['.$exceptionCode.']: "'.classLocale::$lang['fl_attack_error'][$exceptionCode].'" - FAILED!</span><br />');
197 197
       print('<div style="color: red; font-size: 200%;">NO EXCEPTION RAISED</div>');
198 198
       pdie();
199 199
     } else {
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
     if ($exceptionCode !== null && $e->getCode() === $exceptionCode) {
204 204
 //      print('<span style="color: darkgreen;">Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - passed</span><br />');
205 205
     } else {
206
-      print('<div style="color: red; font-size: 200%;">Expected Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - FAILED!</div>');
207
-      print('<div style="color: red; font-size: 200%;">Got Exception [' . $e->getCode() . ']: "' . $e->getMessage() . '"/"' . classLocale::$lang['fl_attack_error'][$e->getCode()] . '" . "</div>');
206
+      print('<div style="color: red; font-size: 200%;">Expected Exception ['.$exceptionCode.']: "'.classLocale::$lang['fl_attack_error'][$exceptionCode].'" - FAILED!</div>');
207
+      print('<div style="color: red; font-size: 200%;">Got Exception ['.$e->getCode().']: "'.$e->getMessage().'"/"'.classLocale::$lang['fl_attack_error'][$e->getCode()].'" . "</div>');
208 208
       throw $e;
209 209
     }
210 210
   }
Please login to merge, or discard this patch.