Completed
Push — work-fleets ( 21e5a3...e0f70d )
by SuperNova.WS
05:07
created
includes/classes/UBE/UBERound.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
    * @version 2016-02-25 23:42:45 41a4.68
37 37
    */
38 38
   public function make_snapshot(UBEFleetList $UBEFleetList) {
39
-    foreach($UBEFleetList->_container as $fleet_id => $UBEFleet) {
40
-      foreach($UBEFleet->unit_list->_container as $UBEUnit) {
39
+    foreach ($UBEFleetList->_container as $fleet_id => $UBEFleet) {
40
+      foreach ($UBEFleet->unit_list->_container as $UBEUnit) {
41 41
         $this->snapshot[$fleet_id][$UBEUnit->unitId] = new UBESnapshotUnit();
42 42
         $this->snapshot[$fleet_id][$UBEUnit->unitId]->init_from_UBEUnit($UBEUnit);
43 43
       }
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
    * @version 2016-02-25 23:42:45 41a4.68
54 54
    */
55 55
   public function sql_generate_unit_array(array &$sql_perform_ube_report_unit, &$unit_sort_order, UBEFleetList $UBEFleetList, array $outer_prefix) {
56
-    foreach($this->snapshot as $fleet_id => $fleet_snapshot) {
56
+    foreach ($this->snapshot as $fleet_id => $fleet_snapshot) {
57 57
       $inner_prefix = array(
58 58
         $UBEFleetList[$fleet_id]->owner_id,
59 59
         $fleet_id,
60 60
       );
61
-      foreach($fleet_snapshot as $unit_id => $unit_snapshot) {
61
+      foreach ($fleet_snapshot as $unit_id => $unit_snapshot) {
62 62
         $sql_perform_ube_report_unit[] = array_merge(
63 63
           $outer_prefix,
64 64
           $inner_prefix,
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
       UBE_PLAYER_IS_DEFENDER => array(),
102 102
     );
103 103
 
104
-    foreach($this->snapshot as $fleet_id => $fleet_snapshot) {
104
+    foreach ($this->snapshot as $fleet_id => $fleet_snapshot) {
105 105
       $fleet_owner_id = $ube->fleet_list[$fleet_id]->owner_id;
106 106
       $planet_ube_row = $ube->fleet_list[$fleet_id]->UBE_PLANET;
107 107
 
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
         'PLAYER_NAME' => htmlentities($ube->players[$fleet_owner_id]->name, ENT_COMPAT, 'UTF-8'),
112 112
       );
113 113
 
114
-      if(is_array($planet_ube_row)) {
114
+      if (is_array($planet_ube_row)) {
115 115
         $template_fleet += $planet_ube_row;
116 116
         $template_fleet[PLANET_NAME] = $template_fleet[PLANET_NAME] ? htmlentities($template_fleet[PLANET_NAME], ENT_COMPAT, 'UTF-8') : '';
117 117
         $template_fleet['PLANET_TYPE_TEXT'] = $lang['sys_planet_type_sh'][$template_fleet['PLANET_TYPE']];
118 118
       }
119 119
 
120
-      foreach($fleet_snapshot as $unit_id => $unit_snapshot) {
120
+      foreach ($fleet_snapshot as $unit_id => $unit_snapshot) {
121 121
         $template_fleet['.']['ship'][] = $unit_snapshot->report_render_unit($prevSnapshot[$fleet_id][$unit_id]);
122 122
       }
123 123
 
Please login to merge, or discard this patch.
includes/classes/UBE/UBEDebug.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
    * @version 41a6.0
12 12
    */
13 13
   public static function unit_dump_header() {
14
-    if(!defined('DEBUG_UBE')) {
14
+    if (!defined('DEBUG_UBE')) {
15 15
       return;
16 16
     }
17 17
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
    * @version 41a6.0
49 49
    */
50 50
   public static function unit_dump(UBEUnit $unit, $desc = '', UBEUnit $before = null) {
51
-    if(!defined('DEBUG_UBE')) {
51
+    if (!defined('DEBUG_UBE')) {
52 52
       return;
53 53
     }
54 54
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
    * @version 41a6.0
87 87
    */
88 88
   public static function unit_dump_footer() {
89
-    if(!defined('DEBUG_UBE')) {
89
+    if (!defined('DEBUG_UBE')) {
90 90
       return;
91 91
     }
92 92
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
    * @return UBEUnit
102 102
    */
103 103
   public static function unit_dump_defender(UBEUnit $attacking_unit_pool, UBEUnit $defending_unit_pool, $defending_fleet_id) {
104
-    if(!defined('DEBUG_UBE')) {
104
+    if (!defined('DEBUG_UBE')) {
105 105
       return null;
106 106
     }
107 107
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
    * @version 41a6.0
128 128
    */
129 129
   public static function unit_dump_delta(UBEUnit $unit, $field, UBEUnit $before = null) {
130
-    if(!defined('DEBUG_UBE')) {
130
+    if (!defined('DEBUG_UBE')) {
131 131
       return;
132 132
     }
133 133
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     print(pretty_number($unit->$field));
137 137
     print("</td>");
138 138
     print("<td>");
139
-    if(!empty($before)) {
139
+    if (!empty($before)) {
140 140
       print('' . pretty_number($unit->$field - $before->$field) . '');
141 141
     }
142 142
     print("</td>");
Please login to merge, or discard this patch.
includes/classes/UBE/ArrayAccessV2.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 
44 44
   public function __clone() {
45
-    if(static::$_clonable == ArrayAccessV2::CLONE_NONE) {
45
+    if (static::$_clonable == ArrayAccessV2::CLONE_NONE) {
46 46
       return;
47 47
     }
48 48
 
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
   }
51 51
 
52 52
   protected static function _deep_clone(&$array) {
53
-    foreach($array as &$value) {
54
-      if(is_object($value)) {
53
+    foreach ($array as &$value) {
54
+      if (is_object($value)) {
55 55
         $value = clone $value;
56
-      } elseif(is_array($value) && static::$_clonable == ArrayAccessV2::CLONE_DEEP) {
56
+      } elseif (is_array($value) && static::$_clonable == ArrayAccessV2::CLONE_DEEP) {
57 57
         static::_deep_clone($value);
58 58
       }
59 59
     }
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
    */
68 68
   public function __call($method_name, array $arguments) {
69 69
     $object_first = reset($this->_container);
70
-    if($object_first !== false && method_exists($object_first, $method_name)) {
71
-      foreach($this->_container as $unit_id => $object) {
70
+    if ($object_first !== false && method_exists($object_first, $method_name)) {
71
+      foreach ($this->_container as $unit_id => $object) {
72 72
         call_user_func_array(array($object, $method_name), $arguments);
73 73
       }
74 74
     }
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
    */
84 84
   public function getSumProperty($property_name) {
85 85
     $result = 0.0;
86
-    foreach($this->_container as $object) {
87
-      if(is_object($object) && property_exists($object, $property_name)) {
86
+    foreach ($this->_container as $object) {
87
+      if (is_object($object) && property_exists($object, $property_name)) {
88 88
         $result += $object->$property_name;
89 89
       }
90 90
     }
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
    * @return mixed
101 101
    */
102 102
   public function aggregateByMethod($method_name, &$result) {
103
-    foreach($this->_container as $object) {
104
-      if(is_object($object) && method_exists($object, $method_name)) {
103
+    foreach ($this->_container as $object) {
104
+      if (is_object($object) && method_exists($object, $method_name)) {
105 105
         call_user_func(array($object, $method_name), $result);
106 106
       }
107 107
     }
Please login to merge, or discard this patch.
includes/classes/FleetList.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
       (!empty($where_safe) ? " WHERE {$where_safe}" : '') .
38 38
       " FOR UPDATE;"
39 39
     );
40
-    while($row = db_fetch($query)) {
40
+    while ($row = db_fetch($query)) {
41 41
       /**
42 42
        * @var Fleet $fleet
43 43
        */
44 44
       $fleet = $this->_createElement();
45 45
       $fleet->dbRowParse($row);
46 46
 
47
-      if(isset($this[$fleet->dbId])) {
47
+      if (isset($this[$fleet->dbId])) {
48 48
         // Нужно ли ????
49 49
         classSupernova::$debug->error('Fleet list already set');
50 50
       }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
    * @return static
171 171
    */
172 172
   public static function dbGetFleetListAndMissileByCoordinates($coordinates, $for_phalanx = false) {
173
-    if(empty($coordinates) || !is_array($coordinates)) {
173
+    if (empty($coordinates) || !is_array($coordinates)) {
174 174
       return array();
175 175
     }
176 176
 
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
      * @var Fleet[] $array_of_Fleet
200 200
      */
201 201
     $array_of_Fleet = array();
202
-    if(!empty($fleet_db_list) && $fleet_db_list->count()) {
203
-      foreach($fleet_db_list->_container as $fleet_id => $objFleet) {
202
+    if (!empty($fleet_db_list) && $fleet_db_list->count()) {
203
+      foreach ($fleet_db_list->_container as $fleet_id => $objFleet) {
204 204
         $array_of_Fleet[$fleet_id] = $objFleet;
205 205
       }
206 206
       $planet_fleets = flt_get_fleets_to_planet_by_array_of_Fleet($array_of_Fleet);
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
       "SELECT * FROM `{{iraks}}`" .
250 250
       (!empty($where) ? " WHERE {$where}" : '') .
251 251
       " FOR UPDATE;");
252
-    while($missile_db_row = db_fetch($query)) {
252
+    while ($missile_db_row = db_fetch($query)) {
253 253
       /**
254 254
        * @var Fleet $objFleet
255 255
        */
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
    */
272 272
   public static function dbGetFleetListAndMissileINCOMING($owner_id) {
273 273
     $owner_id_safe = idval($owner_id);
274
-    if(empty($owner_id_safe)) {
274
+    if (empty($owner_id_safe)) {
275 275
       return array();
276 276
     }
277 277
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
    */
306 306
   public static function fleet_count_flying($player_id, $mission_id = 0) {
307 307
     $player_id_safe = idval($player_id);
308
-    if(!empty($player_id_safe)) {
308
+    if (!empty($player_id_safe)) {
309 309
       $mission_id_safe = intval($mission_id);
310 310
       $result = static::db_fleet_count(
311 311
         "`fleet_owner` = {$player_id_safe}" .
Please login to merge, or discard this patch.
includes/classes/UnitResourceLoot.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
   public static function _init($group_name = '') {
27 27
     parent::_init($group_name);
28 28
 
29
-    foreach(static::$_group_unit_id_list as $resource_id) {
29
+    foreach (static::$_group_unit_id_list as $resource_id) {
30 30
       static::$_group_pnames[$resource_id] = pname_resource_name($resource_id);
31 31
     }
32 32
 
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
     !is_array($resource_array) ? $resource_array = array() : false;
50 50
 
51
-    foreach($resource_array as $resource_id => $resource_actual_delta) {
52
-      if(!$resource_actual_delta) {
51
+    foreach ($resource_array as $resource_id => $resource_actual_delta) {
52
+      if (!$resource_actual_delta) {
53 53
         // No delta - no changes
54 54
         continue;
55 55
       }
Please login to merge, or discard this patch.
includes/classes/Player.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -229,8 +229,8 @@
 block discarded – undo
229 229
   public function calcColonyMaxCount($astrotech = -1) {
230 230
     global $config;
231 231
 
232
-    if($astrotech == -1) {
233
-      if(!isset($this->db_row[UNIT_PLAYER_COLONIES_MAX])) {
232
+    if ($astrotech == -1) {
233
+      if (!isset($this->db_row[UNIT_PLAYER_COLONIES_MAX])) {
234 234
 
235 235
         $expeditions = get_player_max_expeditons($this->db_row);
236 236
         $astrotech = mrc_get_level($this->db_row, false, TECH_ASTROTECH);
Please login to merge, or discard this patch.
includes/classes/PlayerList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
    * @version 41a6.16
24 24
    */
25 25
   protected function db_load_player_by_id($player_id) {
26
-    if(isset($this[$player_id])) {
26
+    if (isset($this[$player_id])) {
27 27
       return;
28 28
     }
29 29
 
Please login to merge, or discard this patch.
blitz_register.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -2,12 +2,12 @@  discard block
 block discarded – undo
2 2
 
3 3
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if($user['authlevel'] < AUTH_LEVEL_DEVELOPER) {
5
+if ($user['authlevel'] < AUTH_LEVEL_DEVELOPER) {
6 6
   $error_message = $config->game_mode == GAME_BLITZ ? 'sys_blitz_page_disabled' : (
7 7
   !$config->game_blitz_register ? 'sys_blitz_registration_disabled' : ''
8 8
   );
9 9
 
10
-  if($error_message) {
10
+  if ($error_message) {
11 11
     message($lang[$error_message], $lang['sys_error'], 'overview.php', 10);
12 12
     die();
13 13
   }
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
 $current_round = intval($config->db_loadItem('game_blitz_register_round'));
27 27
 $current_price = intval($config->db_loadItem('game_blitz_register_price'));
28 28
 
29
-if($config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) {
29
+if ($config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) {
30 30
   sn_db_transaction_start();
31 31
   $user = db_user_by_id($user['id'], true);
32 32
   $is_registered = db_blitz_reg_get_id_by_player_and_round($user, $current_round);
33
-  if(sys_get_param_str('register_me')) {
34
-    if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) {
33
+  if (sys_get_param_str('register_me')) {
34
+    if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) {
35 35
       db_blitz_reg_insert($user, $current_round);
36 36
       classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица");
37 37
     }
38
-  } elseif(sys_get_param_str('register_me_not') && !empty($is_registered)) {
38
+  } elseif (sys_get_param_str('register_me_not') && !empty($is_registered)) {
39 39
     db_blitz_reg_delete($user, $current_round);
40 40
     classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION_CANCEL, $current_price, "Отмена регистрации в раунде {$current_round} Блица");
41 41
   }
@@ -50,17 +50,17 @@  discard block
 block discarded – undo
50 50
 $blitz_players = 0;
51 51
 $blitz_prize_dark_matter = 0;
52 52
 $blitz_prize_places = 0;
53
-if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) {
54
-  if(sys_get_param_str('generate')) {
53
+if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) {
54
+  if (sys_get_param_str('generate')) {
55 55
     $next_id = 0;
56 56
     $query = db_blitz_reg_get_random_id($current_round);
57
-    while($row = db_fetch($query)) {
57
+    while ($row = db_fetch($query)) {
58 58
       $next_id++;
59 59
       $blitz_name = 'Игрок' . $next_id;
60 60
       $blitz_password = sys_random_string(8);
61 61
       db_blitz_reg_update_with_name_and_password($blitz_name, $blitz_password, $row, $current_round);
62 62
     }
63
-  } elseif(sys_get_param_str('import_generated')) {
63
+  } elseif (sys_get_param_str('import_generated')) {
64 64
     // ЭТО НА БЛИЦЕ!!!
65 65
     db_player_list_blitz_delete_players();
66 66
     db_planets_purge();
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     $system = $system_step;
83 83
     $planet = round($config->game_maxPlanet / 2);
84 84
 
85
-    foreach($imported_string as &$string_data) {
85
+    foreach ($imported_string as &$string_data) {
86 86
       $string_data = explode(',', $string_data);
87 87
       $username_safe = $string_data[0];
88 88
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
       $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], 30, '', false);
104 104
 
105
-      if(($system += $system_step) >= $config->game_maxSystem) {
105
+      if (($system += $system_step) >= $config->game_maxSystem) {
106 106
         $galaxy++;
107 107
         $system = $system_step;
108 108
       }
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
     $config->db_saveItem('users_amount', $config->users_amount + $new_players);
113 113
     // pdump($imported_string);
114 114
     // generated_string
115
-  } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) {
115
+  } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) {
116 116
     $blitz_result = explode(';', $blitz_result_string);
117 117
     $blitz_last_update = $blitz_result[0]; // Пока не используется
118 118
     unset($blitz_result[0]);
119
-    foreach($blitz_result as $blitz_result_data) {
119
+    foreach ($blitz_result as $blitz_result_data) {
120 120
       $blitz_result_data = explode(',', $blitz_result_data);
121
-      if(count($blitz_result_data) == 5) {
121
+      if (count($blitz_result_data) == 5) {
122 122
         $blitz_result_data[1] = db_escape($blitz_result_data[1]);
123 123
         db_blitz_reg_update_results($blitz_result_data, $current_round);
124 124
       }
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
     $blitz_result = array();
127 127
   }
128 128
 
129
-  if($config->game_mode == GAME_BLITZ) {
129
+  if ($config->game_mode == GAME_BLITZ) {
130 130
     $blitz_result = array($config->db_loadItem('var_stat_update'));
131 131
     $query = db_player_list_export_blitz_info();
132
-    while($row = db_fetch($query)) {
132
+    while ($row = db_fetch($query)) {
133 133
       $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}";
134 134
     }
135 135
   } else {
136 136
     $query = db_blitz_reg_get_player_list($current_round);
137
-    while($row = db_fetch($query)) {
137
+    while ($row = db_fetch($query)) {
138 138
       $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}";
139 139
       $row['blitz_online'] ? $blitz_prize_players_active++ : false;
140 140
       $blitz_players++;
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
     $blitz_prize_dark_matter = $blitz_prize_players_active * 20000;
143 143
     $blitz_prize_places = ceil($blitz_prize_players_active / 5);
144 144
 
145
-    if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) {
145
+    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 146
       // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter');
147 147
       $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places');
148 148
       sn_db_transaction_start();
149 149
       $query = db_blitz_reg_get_player_list_order_by_place($current_round);
150
-      while($row = db_fetch($query)) {
151
-        if(!$row['blitz_place']) {
150
+      while ($row = db_fetch($query)) {
151
+        if (!$row['blitz_place']) {
152 152
           continue;
153 153
         }
154 154
 
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
 
158 158
         $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter'];
159 159
         pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']);
160
-        if($reward) {
160
+        if ($reward) {
161 161
           rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf(
162 162
             $lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name']
163 163
           ));
164 164
           db_blitz_reg_update_apply_results($reward, $row, $current_round);
165 165
         }
166 166
 
167
-        if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) {
167
+        if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) {
168 168
           break;
169 169
         }
170 170
       }
@@ -179,12 +179,12 @@  discard block
 block discarded – undo
179 179
 
180 180
 $player_registered = false;
181 181
 $query = db_blitz_reg_get_player_list_and_users($current_round);
182
-while($row = db_fetch($query)) {
182
+while ($row = db_fetch($query)) {
183 183
   $tpl_player_data = array(
184 184
     'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)),
185 185
   );
186 186
 
187
-  if($config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) {
187
+  if ($config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) {
188 188
     // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда
189 189
     $tpl_player_data = array_merge($tpl_player_data, array(
190 190
       'ID'                       => $row['id'],
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
   }
198 198
 
199 199
   $template->assign_block_vars('registrations', $tpl_player_data);
200
-  if($row['id'] == $user['id']) {
200
+  if ($row['id'] == $user['id']) {
201 201
     $player_registered = $row;
202 202
   }
203 203
 }
Please login to merge, or discard this patch.
includes/init_secondary.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if($config->server_updater_check_auto && $config->server_updater_check_last + $config->server_updater_check_period <= SN_TIME_NOW) {
3
+if ($config->server_updater_check_auto && $config->server_updater_check_last + $config->server_updater_check_period <= SN_TIME_NOW) {
4 4
   include(SN_ROOT_PHYSICAL . 'ajax_version_check' . DOT_PHP_EX);
5 5
 }
6 6
 
7
-if($config->user_birthday_gift && SN_TIME_NOW - $config->user_birthday_celebrate > PERIOD_DAY) {
7
+if ($config->user_birthday_gift && SN_TIME_NOW - $config->user_birthday_celebrate > PERIOD_DAY) {
8 8
   require_once(SN_ROOT_PHYSICAL . "includes/includes/user_birthday_celebrate" . DOT_PHP_EX);
9 9
   sn_user_birthday_celebrate();
10 10
 }
11 11
 
12
-if(!$config->var_online_user_count || $config->var_online_user_time + 30 < SN_TIME_NOW) {
12
+if (!$config->var_online_user_count || $config->var_online_user_time + 30 < SN_TIME_NOW) {
13 13
   $config->db_saveItem('var_online_user_count', db_user_count(true));
14 14
   $config->db_saveItem('var_online_user_time', SN_TIME_NOW);
15
-  if($config->server_log_online) {
15
+  if ($config->server_log_online) {
16 16
     db_log_online_insert();
17 17
   }
18 18
 }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 $template_result[F_ACCOUNT_IS_AUTHORIZED] = $sys_user_logged_in = !empty($user) && isset($user['id']) && $user['id'];
43 43
 //pdump($template_result[F_ACCOUNT_IS_AUTHORIZED]);die();
44 44
 
45
-if(!empty($user['id'])) {
45
+if (!empty($user['id'])) {
46 46
   classSupernova::$user_options->user_change($user['id']);
47 47
 }
48 48
 
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
     : false
56 56
   );
57 57
 
58
-if($template_result[F_LOGIN_STATUS] == LOGIN_ERROR_USERNAME_RESTRICTED_CHARACTERS) {
59
-  $prohibited_characters = array_map(function ($value) {
58
+if ($template_result[F_LOGIN_STATUS] == LOGIN_ERROR_USERNAME_RESTRICTED_CHARACTERS) {
59
+  $prohibited_characters = array_map(function($value) {
60 60
     return "'" . htmlentities($value, ENT_QUOTES, 'UTF-8') . "'";
61 61
   }, str_split(LOGIN_REGISTER_CHARACTERS_PROHIBITED));
62 62
   $template_result[F_LOGIN_MESSAGE] .= implode(', ', $prohibited_characters);
63 63
 }
64 64
 
65 65
 
66
-if(defined('DEBUG_AUTH') && DEBUG_AUTH && !defined('IN_AJAX')) {
66
+if (defined('DEBUG_AUTH') && DEBUG_AUTH && !defined('IN_AJAX')) {
67 67
   pdump("Отключи отладку перед продакшном!");
68 68
 }
69 69
 
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
   ? define('INSTALL_MODE', GAME_DISABLE_INSTALL)
78 78
   : false;
79 79
 
80
-if($template_result[F_GAME_DISABLE] = $config->game_disable) {
80
+if ($template_result[F_GAME_DISABLE] = $config->game_disable) {
81 81
   $template_result[F_GAME_DISABLE_REASON] = sys_bbcodeParse(
82 82
     $config->game_disable == GAME_DISABLE_REASON
83 83
       ? $config->game_disable_reason
84 84
       : $lang['sys_game_disable_reason'][$config->game_disable]
85 85
   );
86
-  if(defined('IN_API')) {
86
+  if (defined('IN_API')) {
87 87
     return;
88 88
   }
89 89
 
90
-  if(
90
+  if (
91 91
     ($user['authlevel'] < 1 || !(defined('IN_ADMIN') && IN_ADMIN))
92 92
     &&
93 93
     !(defined('INSTALL_MODE') && defined('LOGIN_LOGOUT'))
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 
101 101
 // TODO ban
102 102
 // TODO $skip_ban_check
103
-if($template_result[F_BANNED_STATUS] && !$skip_ban_check) {
104
-  if(defined('IN_API')) {
103
+if ($template_result[F_BANNED_STATUS] && !$skip_ban_check) {
104
+  if (defined('IN_API')) {
105 105
     return;
106 106
   }
107 107
 
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 // pdump($allow_anonymous, '$allow_anonymous');
120 120
 // pdump($sys_user_logged_in, '$sys_user_logged_in');
121 121
 
122
-if($sys_user_logged_in && INITIAL_PAGE == 'login') {
122
+if ($sys_user_logged_in && INITIAL_PAGE == 'login') {
123 123
   sys_redirect(SN_ROOT_VIRTUAL . 'overview.php');
124
-} elseif($account_logged_in && !$sys_user_logged_in) { // empty(core_auth::$user['id'])
124
+} elseif ($account_logged_in && !$sys_user_logged_in) { // empty(core_auth::$user['id'])
125 125
 //  pdump($sn_page_name);
126 126
 //  pdump(INITIAL_PAGE);
127 127
 //  die('{Тут должна быть ваша реклама. Точнее - ввод имени игрока}');
128
-} elseif(!$allow_anonymous && !$sys_user_logged_in) {
128
+} elseif (!$allow_anonymous && !$sys_user_logged_in) {
129 129
   // sn_setcookie(SN_COOKIE, '', time() - PERIOD_WEEK, SN_ROOT_RELATIVE);
130 130
   sys_redirect(SN_ROOT_VIRTUAL . 'login.php');
131 131
 }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 global $skip_fleet_update;
148 148
 $skip_fleet_update = $skip_fleet_update || $supernova->options['fleet_update_skip'] || defined('IN_ADMIN');
149
-if(
149
+if (
150 150
   !$skip_fleet_update
151 151
   && !(defined('IN_AJAX') && IN_AJAX === true)
152 152
   && SN_TIME_NOW - strtotime($config->fleet_update_last) > $config->fleet_update_interval
Please login to merge, or discard this patch.