Test Failed
Push — trunk ( dc8fe4...b76cfb )
by SuperNova.WS
10:59
created
blitz_register.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
 
5 5
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
6 6
 
7
-if($user['authlevel'] < AUTH_LEVEL_DEVELOPER) {
7
+if ($user['authlevel'] < AUTH_LEVEL_DEVELOPER) {
8 8
   $error_message = SN::$config->game_mode == GAME_BLITZ ? 'sys_blitz_page_disabled' : (
9 9
     !SN::$config->game_blitz_register ? 'sys_blitz_registration_disabled' : ''
10 10
   );
11 11
 
12
-  if($error_message) {
12
+  if ($error_message) {
13 13
     SnTemplate::messageBox($lang[$error_message], $lang['sys_error'], 'overview.php', 10);
14 14
     die();
15 15
   }
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 $current_round = intval(SN::$config->db_loadItem('game_blitz_register_round'));
20 20
 $current_price = intval(SN::$config->db_loadItem('game_blitz_register_price'));
21 21
 
22
-if(SN::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) {
22
+if (SN::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) {
23 23
   SN::db_transaction_start();
24 24
   $user = db_user_by_id($user['id'], true);
25 25
   $is_registered = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `user_id` = {$user['id']} AND `round_number` = {$current_round} FOR UPDATE;", true);
26
-  if(sys_get_param_str('register_me')) {
27
-    if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) {
26
+  if (sys_get_param_str('register_me')) {
27
+    if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) {
28 28
       doquery("INSERT IGNORE INTO {{blitz_registrations}} SET `user_id` = {$user['id']}, `round_number` = {$current_round};");
29 29
       //mm_points_change($user['id'], RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица");
30 30
       SN::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица");
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 $blitz_players = 0;
46 46
 $blitz_prize_dark_matter = 0;
47 47
 $blitz_prize_places = 0;
48
-if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) {
49
-  if(sys_get_param_str('generate')) {
48
+if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) {
49
+  if (sys_get_param_str('generate')) {
50 50
     $next_id = 0;
51 51
     $query = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY RAND();");
52
-    while($row = db_fetch($query)) {
52
+    while ($row = db_fetch($query)) {
53 53
       $next_id++;
54 54
       $blitz_name = 'Игрок' . $next_id;
55 55
       $blitz_password = sys_random_string(8);
56 56
       doquery("UPDATE {{blitz_registrations}} SET blitz_name = '{$blitz_name}', blitz_password = '{$blitz_password}' WHERE `id` = {$row['id']} AND `round_number` = {$current_round};");
57 57
     }
58
-  } elseif(sys_get_param_str('import_generated')) {
58
+  } elseif (sys_get_param_str('import_generated')) {
59 59
     // ЭТО НА БЛИЦЕ!!!
60 60
     doquery("DELETE FROM {{users}} WHERE username like 'Игрок%';");
61 61
     doquery("DELETE FROM {{planets}} WHERE id_owner not in (SELECT `id` FROM {{users}});");
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     $system = $system_step;
78 78
     $planet = round(SN::$config->game_maxPlanet / 2);
79 79
 
80
-    foreach($imported_string as &$string_data) {
80
+    foreach ($imported_string as &$string_data) {
81 81
       $string_data = explode(',', $string_data);
82 82
       $username_safe = $string_data[0];
83 83
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
       $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], Universe::MOON_MAX_SIZE, false);
93 93
 
94
-      if(($system += $system_step) >= SN::$config->game_maxSystem) {
94
+      if (($system += $system_step) >= SN::$config->game_maxSystem) {
95 95
         $galaxy++;
96 96
         $system = $system_step;
97 97
       }
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 
101 101
     SN::$config->db_saveItem('users_amount', SN::$config->users_amount + $new_players);
102 102
     // generated_string
103
-  } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) {
103
+  } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) {
104 104
     $blitz_result = explode(';', $blitz_result_string);
105 105
     $blitz_last_update = $blitz_result[0]; // Пока не используется
106 106
     unset($blitz_result[0]);
107
-    foreach($blitz_result as $blitz_result_data) {
107
+    foreach ($blitz_result as $blitz_result_data) {
108 108
       $blitz_result_data = explode(',', $blitz_result_data);
109
-      if(count($blitz_result_data) == 5) {
109
+      if (count($blitz_result_data) == 5) {
110 110
         $blitz_result_data[1] = SN::$db->db_escape($blitz_result_data[1]);
111 111
         doquery(
112 112
           "UPDATE `{{blitz_registrations}}` SET
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
     $blitz_result = array();
121 121
   }
122 122
 
123
-  if(SN::$config->game_mode == GAME_BLITZ) {
123
+  if (SN::$config->game_mode == GAME_BLITZ) {
124 124
     $blitz_result = array(SN::$config->db_loadItem('var_stat_update'));
125 125
     $query = doquery("SELECT id, username, total_rank, total_points, onlinetime FROM {{users}} ORDER BY `id`;");
126
-    while($row = db_fetch($query)) {
126
+    while ($row = db_fetch($query)) {
127 127
       $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}";
128 128
     }
129 129
   } else {
130 130
     $query = doquery("SELECT blitz_name, blitz_password, blitz_online FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `id`;");
131
-    while($row = db_fetch($query)) {
131
+    while ($row = db_fetch($query)) {
132 132
       $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}";
133 133
       $row['blitz_online'] ? $blitz_prize_players_active++ : false;
134 134
       $blitz_players++;
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
     'Игрок40'
144 144
     */
145 145
 
146
-    if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) {
146
+    if (sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) {
147 147
       // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter');
148 148
       $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places');
149 149
       SN::db_transaction_start();
150 150
       $query = doquery("SELECT * FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `blitz_place` FOR UPDATE;");
151
-      while($row = db_fetch($query)) {
152
-        if(!$row['blitz_place']) {
151
+      while ($row = db_fetch($query)) {
152
+        if (!$row['blitz_place']) {
153 153
           continue;
154 154
         }
155 155
 
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
         $blitz_prize_places_actual--;
158 158
 
159 159
         $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter'];
160
-pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}",$row['id']);
161
-        if($reward) {
160
+pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']);
161
+        if ($reward) {
162 162
           rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf(
163 163
             $lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name']
164 164
           ));
165 165
           doquery("UPDATE {{blitz_registrations}} SET blitz_reward_dark_matter = blitz_reward_dark_matter + ($reward) WHERE id = {$row['id']} AND `round_number` = {$current_round};");
166 166
         }
167 167
 
168
-        if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) {
168
+        if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) {
169 169
           break;
170 170
         }
171 171
       }
@@ -185,12 +185,12 @@  discard block
 block discarded – undo
185 185
     JOIN {{users}} AS u ON u.id = br.user_id
186 186
   WHERE br.`round_number` = {$current_round}
187 187
   order by `blitz_place`, `timestamp`;");
188
-while($row = db_fetch($query)) {
188
+while ($row = db_fetch($query)) {
189 189
   $tpl_player_data = array(
190 190
     'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)),
191 191
   );
192 192
 
193
-  if(SN::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) {
193
+  if (SN::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) {
194 194
     // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда
195 195
     $tpl_player_data = array_merge($tpl_player_data, array(
196 196
       'ID' => $row['id'],
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
   }
204 204
 
205 205
   $template->assign_block_vars('registrations', $tpl_player_data);
206
-  if($row['id'] == $user['id']) {
206
+  if ($row['id'] == $user['id']) {
207 207
     $player_registered = $row;
208 208
   }
209 209
 }
Please login to merge, or discard this patch.
classes/SN.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -452,11 +452,13 @@  discard block
 block discarded – undo
452 452
     $location_info = &static::$location_info[$location_type];
453 453
     $id_field = $location_info[P_ID];
454 454
     $table_name = $location_info[P_TABLE_NAME];
455
-    if ($result = static::db_query_update("UPDATE {{{$table_name}}} SET {$set} WHERE `{$id_field}` = {$record_id}")) // TODO Как-то вернуть может быть LIMIT 1 ?
455
+    if ($result = static::db_query_update("UPDATE {{{$table_name}}} SET {$set} WHERE `{$id_field}` = {$record_id}")) {
456
+      // TODO Как-то вернуть может быть LIMIT 1 ?
456 457
     {
457 458
       if (static::$db->db_affected_rows()) {
458 459
         // Обновляем данные только если ряд был затронут
459 460
         DBStaticUnit::cache_clear();
461
+    }
460 462
       }
461 463
     }
462 464
 
@@ -486,9 +488,11 @@  discard block
 block discarded – undo
486 488
     $set = trim($set);
487 489
     $table_name = static::$location_info[$location_type][P_TABLE_NAME];
488 490
     if ($result = static::db_query_insert("INSERT INTO `{{{$table_name}}}` SET {$set}")) {
489
-      if (static::$db->db_affected_rows()) // Обновляем данные только если ряд был затронут
491
+      if (static::$db->db_affected_rows()) {
492
+        // Обновляем данные только если ряд был затронут
490 493
       {
491 494
         $record_id = SN::$db->db_insert_id();
495
+      }
492 496
         // Вытаскиваем запись целиком, потому что в $set могли быть "данные по умолчанию"
493 497
         $result = static::db_get_record_by_id($location_type, $record_id);
494 498
         // Очищаем второстепенные кэши - потому что вставленная запись могла повлиять на результаты запросов или локация или еще чего
@@ -508,10 +512,12 @@  discard block
 block discarded – undo
508 512
     $id_field = $location_info[P_ID];
509 513
     $table_name = $location_info[P_TABLE_NAME];
510 514
     if ($result = static::db_query_delete("DELETE FROM `{{{$table_name}}}` WHERE `{$id_field}` = {$safe_record_id}")) {
511
-      if (static::$db->db_affected_rows()) // Обновляем данные только если ряд был затронут
515
+      if (static::$db->db_affected_rows()) {
516
+        // Обновляем данные только если ряд был затронут
512 517
       {
513 518
         DBStaticUnit::cache_clear();
514 519
       }
520
+      }
515 521
     }
516 522
 
517 523
     return $result;
@@ -525,11 +531,13 @@  discard block
 block discarded – undo
525 531
     $table_name = static::$location_info[$location_type][P_TABLE_NAME];
526 532
 
527 533
     if ($result = static::db_query_delete("DELETE FROM `{{{$table_name}}}` WHERE {$condition}")) {
528
-      if (static::$db->db_affected_rows()) // Обновляем данные только если ряд был затронут
534
+      if (static::$db->db_affected_rows()) {
535
+        // Обновляем данные только если ряд был затронут
529 536
       {
530 537
         // Обнуление кэша, потому что непонятно, что поменялось
531 538
         DBStaticUnit::cache_clear();
532 539
       }
540
+      }
533 541
     }
534 542
 
535 543
     return $result;
Please login to merge, or discard this patch.
classes/Unit/DBStaticUnit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     $unit_snid = intval($unit_snid);
46 46
 
47
-    $resultOld = $unit_snid ? (isset($allUnits[$unit_snid]) ? $allUnits[$unit_snid] : null ) : $allUnits;
47
+    $resultOld = $unit_snid ? (isset($allUnits[$unit_snid]) ? $allUnits[$unit_snid] : null) : $allUnits;
48 48
 
49 49
     return $resultOld;
50 50
   }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
   }
88 88
 
89 89
   public static function db_unit_count_by_user_and_type_and_snid($user_id, $unit_type = 0, $unit_snid = 0) {
90
-    $query  = doquery(
90
+    $query = doquery(
91 91
       "SELECT unit_snid, sum(unit_level) as `qty`  FROM {{unit}} WHERE `unit_player_id` = {$user_id} " .
92 92
       ($unit_type ? "AND `unit_type` = {$unit_type} " : '') .
93 93
       ($unit_snid ? "AND `unit_snid` = {$unit_snid} " : '') .
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
    * @return bool
237 237
    */
238 238
   protected static function dbAdd($playerId, $planetId, $unitSnId, $amount) {
239
-    if (!in_array($unitSnId, sn_get_groups([UNIT_SHIPS_STR, UNIT_DEFENCE_STR, UNIT_ARTIFACTS_STR, UNIT_STRUCTURES_STR,]))) {
239
+    if (!in_array($unitSnId, sn_get_groups([UNIT_SHIPS_STR, UNIT_DEFENCE_STR, UNIT_ARTIFACTS_STR, UNIT_STRUCTURES_STR, ]))) {
240 240
       return false;
241 241
     }
242 242
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 //        'unit_level'         => $level,
270 270
 //      ]);
271 271
 
272
-      $fields     += [
272
+      $fields += [
273 273
         'unit_type'  => get_unit_param($unitSnId, P_UNIT_TYPE),
274 274
         'unit_level' => $amount,
275 275
       ];
Please login to merge, or discard this patch.
classes/classConfig.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
     'advGoogleLeftMenuCode'        => '(Place here code for banner)',
238 238
 
239 239
     // Alliance bonus calculations
240
-    'ali_bonus_algorithm'          => 0,  // Bonus calculation algorithm
240
+    'ali_bonus_algorithm'          => 0, // Bonus calculation algorithm
241 241
     'ali_bonus_brackets'           => 10, // Brackets count for ALI_BONUS_BY_RANK
242
-    'ali_bonus_brackets_divisor'   => 10,// Bonus divisor for ALI_BONUS_BY_RANK
242
+    'ali_bonus_brackets_divisor'   => 10, // Bonus divisor for ALI_BONUS_BY_RANK
243 243
     'ali_bonus_divisor'            => 10000000, // Rank divisor for ALI_BONUS_BY_POINTS
244 244
     'ali_bonus_members'            => 10, // Minimum alliance size to start using bonus
245 245
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
     'eco_scale_storage'            => 1,
283 283
     'eco_stockman_fleet'           => '', // Black Market - Starting amount of s/h ship merchant to sell
284
-    'eco_stockman_fleet_populate'  => 1,  // Populate empty Stockman fleet with ships or not
284
+    'eco_stockman_fleet_populate'  => 1, // Populate empty Stockman fleet with ships or not
285 285
     'empire_mercenary_base_period' => PERIOD_MONTH, // Base
286 286
     'empire_mercenary_temporary'   => 0, // Temporary empire-wide mercenaries
287 287
 
@@ -292,21 +292,21 @@  discard block
 block discarded – undo
292 292
     'energy_basic_income'          => 0,
293 293
 
294 294
     // Bashing protection settings
295
-    'fleet_bashing_attacks'        => 3,      // Max amount of attack per wave - 3 by default
296
-    'fleet_bashing_interval'       => 1800,   // Maximum interval between attacks when they still count as one wave - 30m by default
297
-    'fleet_bashing_scope'          => 86400,  // Interval on which bashing waves counts - 24h by default
298
-    'fleet_bashing_war_delay'      => 43200,  // Delay before start bashing after declaring war to alliance - 12h by default
299
-    'fleet_bashing_waves'          => 3,      // Max amount of waves per day - 3 by default
295
+    'fleet_bashing_attacks'        => 3, // Max amount of attack per wave - 3 by default
296
+    'fleet_bashing_interval'       => 1800, // Maximum interval between attacks when they still count as one wave - 30m by default
297
+    'fleet_bashing_scope'          => 86400, // Interval on which bashing waves counts - 24h by default
298
+    'fleet_bashing_war_delay'      => 43200, // Delay before start bashing after declaring war to alliance - 12h by default
299
+    'fleet_bashing_waves'          => 3, // Max amount of waves per day - 3 by default
300 300
 
301 301
     'Fleet_Cdr'   => 30,
302 302
     'fleet_speed' => 1,
303 303
 
304
-    self::FLEET_UPDATE_MAX_RUN_TIME => 30,     // Maximum length in seconds for single fleet dispatch run
304
+    self::FLEET_UPDATE_MAX_RUN_TIME => 30, // Maximum length in seconds for single fleet dispatch run
305 305
     'fleet_update_interval'         => 4,
306 306
     'fleet_update_lock'             => '', // SQL time when lock was acquired
307 307
 
308
-    'game_adminEmail'       => 'root@localhost',    // Admin email to show to users
309
-    'game_counter'          => 0,  // Does built-in page hit counter is on?
308
+    'game_adminEmail'       => 'root@localhost', // Admin email to show to users
309
+    'game_counter'          => 0, // Does built-in page hit counter is on?
310 310
     // Defaults
311 311
     'game_default_language' => 'ru',
312 312
     'game_default_skin'     => 'skins/EpicBlue/',
@@ -320,14 +320,14 @@  discard block
 block discarded – undo
320 320
     'game_maxSystem'      => 199,
321 321
     'game_maxPlanet'      => 15,
322 322
     // Game global settings
323
-    'game_mode'           => 0,           // 0 - SuperNova, 1 - oGame
323
+    'game_mode'           => 0, // 0 - SuperNova, 1 - oGame
324 324
     'game_name'           => 'SuperNova', // Server name (would be on banners and on top of left menu)
325 325
 
326 326
     'game_news_actual'        => PERIOD_DAY_3, // How long announcement would be marked as "New". In seconds. Default - 3 days
327
-    'game_news_overview'      => 3,    // How much last news to show in Overview page
328
-    'game_news_overview_show' => PERIOD_WEEK_2,    // How long news will be shown in Overview page in seconds. Default - 2 weeks
327
+    'game_news_overview'      => 3, // How much last news to show in Overview page
328
+    'game_news_overview_show' => PERIOD_WEEK_2, // How long news will be shown in Overview page in seconds. Default - 2 weeks
329 329
     // Noob protection
330
-    'game_noob_factor'        => 5,    // Multiplier to divide "stronger" and "weaker" users
330
+    'game_noob_factor'        => 5, // Multiplier to divide "stronger" and "weaker" users
331 331
     'game_noob_points'        => 5000, // Below this point user treated as noob. 0 to disable
332 332
 
333 333
     'game_multiaccount_enabled' => 0, // 1 - allow interactions for players with same IP (multiaccount)
@@ -382,12 +382,12 @@  discard block
 block discarded – undo
382 382
     'payment_currency_exchange_wmz' => 1,
383 383
     'payment_currency_exchange_pln' => 3.86,
384 384
 
385
-    'payment_lot_price' => 1,     // Lot's price in default currency
386
-    'payment_lot_size'  => 2500,  // Lot size. Also service as minimum amount of DM that could be bought with one transaction
385
+    'payment_lot_price' => 1, // Lot's price in default currency
386
+    'payment_lot_size'  => 2500, // Lot size. Also service as minimum amount of DM that could be bought with one transaction
387 387
 
388 388
     'planet_capital_cost'          => 25000, // Cost in DM to move Capital to current planet
389
-    'planet_capital_mining_rate'   => 2.0,   // Capital Mining rates
390
-    'planet_capital_building_rate' => 2.0,   // Capital Building rates
389
+    'planet_capital_mining_rate'   => 2.0, // Capital Mining rates
390
+    'planet_capital_building_rate' => 2.0, // Capital Building rates
391 391
     'planet_teleport_cost'         => 50000, // Cost of planet teleportation
392 392
     'planet_teleport_timeout'      => 86400, // Timeout for next teleportation
393 393
 
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
     'resource_multiplier'     => 1,
410 410
 
411 411
     //Role play system
412
-    'rpg_bonus_divisor'       => 10,    // Amount of DM referral should get for partner have 1 DM bonus
412
+    'rpg_bonus_divisor'       => 10, // Amount of DM referral should get for partner have 1 DM bonus
413 413
     'rpg_bonus_minimum'       => 10000, // Minimum DM amount for starting paying bonuses to affiliate
414 414
 
415 415
     // Black Market - General
@@ -474,12 +474,12 @@  discard block
 block discarded – undo
474 474
     'url_purchase_metamatter' => '',
475 475
     'url_rules'               => '',
476 476
 
477
-    'users_amount'              => 1,                // Total users count
477
+    'users_amount'              => 1, // Total users count
478 478
     'game_users_online_timeout' => PERIOD_MINUTE_15, // Seconds, How long user should consider ONLINE for online counter
479
-    'game_users_update_online'  => 30,               // How often user online should be refreshed (seconds)
480
-    'var_online_user_time'      => 0,                // When last time user online was refreshed
481
-    'var_online_user_count'     => 0,                // Last calculated online user count
482
-    'server_log_online'         => 0,                // Log online user count
479
+    'game_users_update_online'  => 30, // How often user online should be refreshed (seconds)
480
+    'var_online_user_time'      => 0, // When last time user online was refreshed
481
+    'var_online_user_count'     => 0, // Last calculated online user count
482
+    'server_log_online'         => 0, // Log online user count
483 483
 
484 484
     'user_birthday_celebrate' => 0, // When last time celebrations (i.e. gift-giving) was made - timestamp
485 485
     'user_birthday_gift'      => 0, // User birthday gift - Dark Matter points
Please login to merge, or discard this patch.
classes/SnTemplate.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $insert_position = $is_positioned == '-' ? 0 : count($menu);
129 129
       }
130 130
 
131
-      $insert_position     += $is_positioned == '+' ? 1 : 0;
131
+      $insert_position += $is_positioned == '+' ? 1 : 0;
132 132
       $spliced             = array_splice($menu, $insert_position, count($menu) - $insert_position);
133 133
       $menu[$menu_item_id] = $menu_item;
134 134
 
@@ -541,11 +541,11 @@  discard block
 block discarded – undo
541 541
    * @return array
542 542
    */
543 543
   public static function addFileName($fileNames, $anArray, $ext = '.css') {
544
-    if(!is_array($fileNames)) {
544
+    if (!is_array($fileNames)) {
545 545
       $fileNames = [$fileNames];
546 546
     }
547 547
 
548
-    foreach($fileNames as $fileName) {
548
+    foreach ($fileNames as $fileName) {
549 549
       if (file_exists(SN_ROOT_PHYSICAL . $fileName . '.min' . $ext)) {
550 550
         $anArray[$fileName . '.min' . $ext] = '';
551 551
       } elseif (file_exists(SN_ROOT_PHYSICAL . $fileName . '.css' . $ext)) {
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
       'LANG'     => $language ? $language : '',
677 677
       'referral' => $id_ref ? '&id_ref=' . $id_ref : '',
678 678
 
679
-      'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '',// "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
679
+      'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '', // "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
680 680
       'FILENAME'       => basename($_SERVER['PHP_SELF']),
681 681
     ));
682 682
 
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
       'QUE_ID'   => QUE_RESEARCH,
910 910
       'QUE_HTML' => 'topnav',
911 911
 
912
-      'RESEARCH_ONGOING' => (boolean)$user['que'],
912
+      'RESEARCH_ONGOING' => (boolean) $user['que'],
913 913
 
914 914
       'TIME_TEXT'       => sprintf($str_date_format, $time_now_parsed['year'], $lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'],
915 915
         $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds']
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
       SnTemplate::renderFooter($page, $template_result);
1200 1200
     }
1201 1201
 
1202
-    $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false;;
1202
+    $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false; ;
1203 1203
 
1204 1204
     SN::$db->db_disconnect();
1205 1205
 
Please login to merge, or discard this patch.
tools/classes/Spritify.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
     $images = [];
100 100
 
101 101
     foreach (scandir($dirRealPath) as $fileNameOnly) {
102
-      if (in_array($fileNameOnly, ['.', '..',]) || is_dir($fullPath = "$dirRealPath/$fileNameOnly")) {
102
+      if (in_array($fileNameOnly, ['.', '..', ]) || is_dir($fullPath = "$dirRealPath/$fileNameOnly")) {
103 103
         continue;
104 104
       }
105 105
       $images = self::tryReadFile($fullPath, $images);
Please login to merge, or discard this patch.
tools/classes/ImageContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
   }
55 55
 
56 56
   public function __get($property) {
57
-    if (in_array($property, ['height', 'width',]) && ($this->$property === -1)) {
57
+    if (in_array($property, ['height', 'width', ]) && ($this->$property === -1)) {
58 58
       if (isset($this->image)) {
59 59
         $this->width  = imagesx($this->image);
60 60
         $this->height = imagesy($this->image);
Please login to merge, or discard this patch.
tools/classes/ImageFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
   }
51 51
 
52 52
   public function __get($property) {
53
-    if (in_array($property, ['height', 'width',])) {
53
+    if (in_array($property, ['height', 'width', ])) {
54 54
       return $this->getImageContainer() ? $this->getImageContainer()->$property : 0;
55 55
     }
56 56
 
Please login to merge, or discard this patch.
tools/classes/Sprite.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
    */
47 47
   public static function createGridSquare($images, $layout) {
48 48
     $gridSize = ceil(sqrt(count($images)));
49
-    usort($images, function (ImageFile $a, ImageFile $b) { return $b->height - $a->height; });
49
+    usort($images, function(ImageFile $a, ImageFile $b) { return $b->height - $a->height; });
50 50
 
51 51
     $sprite = new static($gridSize);
52 52
     foreach ($images as $image) {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
       $line->generate($this->height, $scaleToPx);
95 95
 
96 96
       $this->height += $line->height;
97
-      $this->width  = max($this->width, $line->width);
97
+      $this->width = max($this->width, $line->width);
98 98
 
99 99
       // $line->image2->savePng($dirOut . count($breakpoints) . '.png'); // TODO remove debug
100 100
     }
Please login to merge, or discard this patch.