Completed
Push — trunk ( 0e7a2e...6a6c5e )
by SuperNova.WS
07:28
created
classes/Pages/Deprecated/PageMessage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         ORDER BY `message_time` DESC;";
329 329
     }
330 330
 
331
-    if($this->showAll) {
331
+    if ($this->showAll) {
332 332
       $message_query = $this->db->selectIterator($message_query);
333 333
     } else {
334 334
       $message_query = new DbSqlPaging($message_query, PAGING_PAGE_SIZE_DEFAULT_MESSAGES, sys_get_param_int(PagingRenderer::KEYWORD));
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
       $this->mode = sys_get_param_str('msg_delete') ? static::MESSAGES_MODE_DELETE : sys_get_param_str('mode');
484 484
     }
485 485
 
486
-    if($this->showAll = sys_get_param_str('msg_show_all') ? true : false) {
486
+    if ($this->showAll = sys_get_param_str('msg_show_all') ? true : false) {
487 487
       $this->mode = static::MESSAGES_MODE_MESSAGES;
488 488
     }
489 489
 
Please login to merge, or discard this patch.
classes/General/Helpers/PagingRenderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
       $this->addFirstLast();
115 115
     }
116 116
 
117
-    if(!empty($this->result)) {
117
+    if (!empty($this->result)) {
118 118
       $template = gettemplate('_paging');
119 119
       $template->assign_recursive([
120 120
         'PAGING_ROOT' => $this->rootUrl,
Please login to merge, or discard this patch.
classes/General/Helpers/URLHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
       }
20 20
     }
21 21
 
22
-    if(!empty($paramList)) {
22
+    if (!empty($paramList)) {
23 23
       $strParams = implode('&', $paramList);
24 24
     }
25 25
 
Please login to merge, or discard this patch.
classes/Common/Pimple/Container.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
 
240 240
         $factory = $this->values[$id];
241 241
 
242
-        $extended = function ($c) use ($callable, $factory) {
242
+        $extended = function($c) use ($callable, $factory) {
243 243
             return $callable($factory($c), $c);
244 244
         };
245 245
 
Please login to merge, or discard this patch.
classes/Core/GlobalContainer.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -89,91 +89,91 @@
 block discarded – undo
89 89
 
90 90
     // Services --------------------------------------------------------------------------------------------------------
91 91
     // Default db
92
-    $gc->db = function (GlobalContainer $c) {
92
+    $gc->db = function(GlobalContainer $c) {
93 93
       SN::$db = new \DBAL\db_mysql($c);
94 94
 
95 95
       return SN::$db;
96 96
     };
97 97
 
98
-    $gc->debug = function (/** @noinspection PhpUnusedParameterInspection */
98
+    $gc->debug = function(/** @noinspection PhpUnusedParameterInspection */
99 99
       GlobalContainer $c) {
100 100
       return new \debug();
101 101
     };
102 102
 
103
-    $gc->cache = function (GlobalContainer $gc) {
103
+    $gc->cache = function(GlobalContainer $gc) {
104 104
       return new \classCache($gc->cachePrefix);
105 105
     };
106 106
 
107
-    $gc->config = function (GlobalContainer $gc) {
107
+    $gc->config = function(GlobalContainer $gc) {
108 108
       return new \classConfig($gc->cachePrefix);
109 109
     };
110 110
 
111 111
 
112
-    $gc->repository = function (GlobalContainer $gc) {
112
+    $gc->repository = function(GlobalContainer $gc) {
113 113
       return new Repository($gc);
114 114
     };
115 115
 
116
-    $gc->storage = function (GlobalContainer $gc) {
116
+    $gc->storage = function(GlobalContainer $gc) {
117 117
       return new \Storage($gc);
118 118
     };
119 119
 
120
-    $gc->design = function (GlobalContainer $gc) {
120
+    $gc->design = function(GlobalContainer $gc) {
121 121
       return new \Design($gc);
122 122
     };
123 123
 
124
-    $gc->bbCodeParser = function (GlobalContainer $gc) {
124
+    $gc->bbCodeParser = function(GlobalContainer $gc) {
125 125
       return new \BBCodeParser($gc);
126 126
     };
127 127
 
128
-    $gc->fleetDispatcher = function (GlobalContainer $gc) {
128
+    $gc->fleetDispatcher = function(GlobalContainer $gc) {
129 129
       return new \Fleet\FleetDispatcher($gc);
130 130
     };
131 131
 
132
-    $gc->watchdog = function (GlobalContainer $gc) {
132
+    $gc->watchdog = function(GlobalContainer $gc) {
133 133
       return new Watchdog($gc);
134 134
     };
135 135
 
136
-    $gc->valueStorage = function (GlobalContainer $gc) {
136
+    $gc->valueStorage = function(GlobalContainer $gc) {
137 137
       return new ValueStorage([]);
138 138
     };
139 139
 
140
-    $gc->bonusCatalog = function (GlobalContainer $gc) {
140
+    $gc->bonusCatalog = function(GlobalContainer $gc) {
141 141
       return new BonusCatalog($gc);
142 142
     };
143 143
 
144
-    $gc->general = function (GlobalContainer $gc) {
144
+    $gc->general = function(GlobalContainer $gc) {
145 145
       return new General($gc);
146 146
     };
147 147
 
148
-    $gc->economicHelper = function (GlobalContainer $gc) {
148
+    $gc->economicHelper = function(GlobalContainer $gc) {
149 149
       return new EconomicHelper($gc);
150 150
     };
151 151
 
152
-    $gc->playerLevelHelper = function (GlobalContainer $gc) {
152
+    $gc->playerLevelHelper = function(GlobalContainer $gc) {
153 153
       return new PlayerLevelHelper($gc);
154 154
     };
155 155
 
156
-    $gc->pimp = function (GlobalContainer $gc) {
156
+    $gc->pimp = function(GlobalContainer $gc) {
157 157
       return new SnPimp($gc);
158 158
     };
159 159
 
160
-    $gc->modules = function (GlobalContainer $gc) {
160
+    $gc->modules = function(GlobalContainer $gc) {
161 161
       return new ModulesManager($gc);
162 162
     };
163 163
 
164 164
     // Dummy objects ---------------------------------------------------------------------------------------------------
165
-    $gc->theUser = function (GlobalContainer $gc) {
165
+    $gc->theUser = function(GlobalContainer $gc) {
166 166
       return new \TheUser($gc);
167 167
     };
168 168
 
169 169
 
170 170
     // Models ----------------------------------------------------------------------------------------------------------
171 171
     $gc->skinEntityClass = \SkinV2::class;
172
-    $gc->skinModel = function (GlobalContainer $gc) {
172
+    $gc->skinModel = function(GlobalContainer $gc) {
173 173
       return new \SkinModel($gc);
174 174
     };
175 175
 
176
-    $gc->textModel = function (GlobalContainer $gc) {
176
+    $gc->textModel = function(GlobalContainer $gc) {
177 177
       return new \TextModel($gc);
178 178
     };
179 179
 
Please login to merge, or discard this patch.
fleet.php 1 patch
Switch Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -77,121 +77,121 @@  discard block
 block discarded – undo
77 77
 }
78 78
 
79 79
 switch ($fleet_page) {
80
-  case 3:
80
+    case 3:
81 81
 
82
-  case 2:
83
-    $fleet_group_mr = sys_get_param_id('fleet_group');
84
-    $fleetarray     = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true);
85
-    $fleetarray = is_array($fleetarray) ? $fleetarray : array();
82
+    case 2:
83
+      $fleet_group_mr = sys_get_param_id('fleet_group');
84
+      $fleetarray     = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true);
85
+      $fleetarray = is_array($fleetarray) ? $fleetarray : array();
86 86
 
87
-    foreach($fleetarray as $ship_id => &$ship_amount) {
88
-      if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
89
-        $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true));
90
-        die();
91
-      }
92
-      $ship_amount = floatval($ship_amount);
93
-    }
94
-
95
-    $UsedPlanet = false;
96
-    $YourPlanet = false;
97
-    $missiontype = array();
98
-    if ($planet > SN::$config->game_maxPlanet) {
99
-      $target_mission = MT_EXPLORE;
100
-      $missiontype[MT_EXPLORE] = $lang['type_mission'][MT_EXPLORE];
101
-    } elseif ($galaxy && $system && $planet) {
102
-      $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
103
-
104
-      $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
105
-
106
-      if ($TargetPlanet['id_owner']) {
107
-        $UsedPlanet = true;
108
-        if ($TargetPlanet['id_owner'] == $user['id']) {
109
-          $YourPlanet = true;
87
+      foreach($fleetarray as $ship_id => &$ship_amount) {
88
+        if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
89
+          $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true));
90
+          die();
110 91
         }
92
+        $ship_amount = floatval($ship_amount);
111 93
       }
112 94
 
113
-      if (!$UsedPlanet) {
114
-        if ($fleetarray[SHIP_COLONIZER]) {
115
-          $missiontype[MT_COLONIZE] = $lang['type_mission'][MT_COLONIZE];
116
-          $target_mission = MT_COLONIZE;
117
-          $planet_type = PT_PLANET;
118
-        } else {
119
-          messageBox ("<font color=\"red\"><b>". $lang['fl_no_planet_type'] ."</b></font>", $lang['fl_error']);
120
-        }
121
-      } else {
122
-        $recyclers = 0;
123
-        foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
124
-          $recyclers += $fleetarray[$recycler_id];
95
+      $UsedPlanet = false;
96
+      $YourPlanet = false;
97
+      $missiontype = array();
98
+      if ($planet > SN::$config->game_maxPlanet) {
99
+        $target_mission = MT_EXPLORE;
100
+        $missiontype[MT_EXPLORE] = $lang['type_mission'][MT_EXPLORE];
101
+      } elseif ($galaxy && $system && $planet) {
102
+        $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
103
+
104
+        $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
105
+
106
+        if ($TargetPlanet['id_owner']) {
107
+          $UsedPlanet = true;
108
+          if ($TargetPlanet['id_owner'] == $user['id']) {
109
+            $YourPlanet = true;
110
+          }
125 111
         }
126
-        if ($recyclers > 0 && $planet_type == PT_DEBRIS) {
127
-          $target_mission = MT_RECYCLE;
128
-          $missiontype[MT_RECYCLE] = $lang['type_mission'][MT_RECYCLE];
129
-        } elseif ($planet_type == PT_PLANET || $planet_type == PT_MOON) {
130
-          if ($YourPlanet) {
131
-            $missiontype[MT_RELOCATE] = $lang['type_mission'][MT_RELOCATE];
132
-            $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
112
+
113
+        if (!$UsedPlanet) {
114
+          if ($fleetarray[SHIP_COLONIZER]) {
115
+            $missiontype[MT_COLONIZE] = $lang['type_mission'][MT_COLONIZE];
116
+            $target_mission = MT_COLONIZE;
117
+            $planet_type = PT_PLANET;
133 118
           } else {
134
-            // Not Your Planet
135
-            if ($fleetarray[SHIP_SPY]) {
136
-              // Only spy missions if any spy
137
-              $missiontype[MT_SPY] = $lang['type_mission'][MT_SPY];
119
+            messageBox ("<font color=\"red\"><b>". $lang['fl_no_planet_type'] ."</b></font>", $lang['fl_error']);
120
+          }
121
+        } else {
122
+          $recyclers = 0;
123
+          foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
124
+            $recyclers += $fleetarray[$recycler_id];
125
+          }
126
+          if ($recyclers > 0 && $planet_type == PT_DEBRIS) {
127
+            $target_mission = MT_RECYCLE;
128
+            $missiontype[MT_RECYCLE] = $lang['type_mission'][MT_RECYCLE];
129
+          } elseif ($planet_type == PT_PLANET || $planet_type == PT_MOON) {
130
+            if ($YourPlanet) {
131
+              $missiontype[MT_RELOCATE] = $lang['type_mission'][MT_RELOCATE];
132
+              $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
138 133
             } else {
139
-              // If no spies...
140
-              if ($fleet_group_mr) {
141
-                $missiontype[MT_AKS] = $lang['type_mission'][MT_AKS];
134
+              // Not Your Planet
135
+              if ($fleetarray[SHIP_SPY]) {
136
+                // Only spy missions if any spy
137
+                $missiontype[MT_SPY] = $lang['type_mission'][MT_SPY];
142 138
               } else {
143
-                $missiontype[MT_ATTACK] = $lang['type_mission'][MT_ATTACK];
144
-                $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
145
-
146
-                $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD];
147
-
148
-                if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
149
-                  $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY];
139
+                // If no spies...
140
+                if ($fleet_group_mr) {
141
+                  $missiontype[MT_AKS] = $lang['type_mission'][MT_AKS];
142
+                } else {
143
+                  $missiontype[MT_ATTACK] = $lang['type_mission'][MT_ATTACK];
144
+                  $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
145
+
146
+                  $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD];
147
+
148
+                  if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
149
+                    $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY];
150
+                  }
150 151
                 }
151 152
               }
152 153
             }
153 154
           }
154 155
         }
155 156
       }
156
-    }
157
-
158
-    if (!$target_mission && is_array($missiontype)) {
159
-      $target_mission = MT_ATTACK;
160
-    }
161
-
162
-//    $sn_group_missions = sn_get_groups('missions');
163
-//    foreach($sn_group_missions as $mission_id => $cork) {
164
-//      $missiontype[$mission_id] = $lang['type_mission'][$mission_id];
165
-//    }
166
-//
167
-//
168
-    ksort($missiontype);
169
-
170
-    $speed_percent = sys_get_param_int('speed', 10);
171
-    $travel_data   = flt_travel_data($user, $planetrow, array('galaxy' => $galaxy, 'system' => $system, 'planet' => $planet), $fleetarray, $speed_percent);
172
-
173
-//    $fleet_speed   = flt_fleet_speed($user, $fleetarray);
174
-    $fleet_speed   = $travel_data['fleet_speed'];
175
-    $distance      = $travel_data['distance'];
176
-    $duration      = $travel_data['duration'];
177
-    $consumption   = $travel_data['consumption'];
178
-  // No Break
179
-
180
-  case 1:
181
-    if ($galaxy && $system && $planet) {
182
-      $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
183
-
184
-      $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
185
-    }
186
-
187
-  case 0:
188
-    $template_result += array(
189
-      'thisgalaxy'      => $planetrow['galaxy'],
190
-      'thissystem'      => $planetrow['system'],
191
-      'thisplanet'      => $planetrow['planet'],
192
-      'thisplanet_type' => $planetrow['planet_type'],
193
-    );
194
-  // no break
157
+
158
+      if (!$target_mission && is_array($missiontype)) {
159
+        $target_mission = MT_ATTACK;
160
+      }
161
+
162
+  //    $sn_group_missions = sn_get_groups('missions');
163
+  //    foreach($sn_group_missions as $mission_id => $cork) {
164
+  //      $missiontype[$mission_id] = $lang['type_mission'][$mission_id];
165
+  //    }
166
+  //
167
+  //
168
+      ksort($missiontype);
169
+
170
+      $speed_percent = sys_get_param_int('speed', 10);
171
+      $travel_data   = flt_travel_data($user, $planetrow, array('galaxy' => $galaxy, 'system' => $system, 'planet' => $planet), $fleetarray, $speed_percent);
172
+
173
+  //    $fleet_speed   = flt_fleet_speed($user, $fleetarray);
174
+      $fleet_speed   = $travel_data['fleet_speed'];
175
+      $distance      = $travel_data['distance'];
176
+      $duration      = $travel_data['duration'];
177
+      $consumption   = $travel_data['consumption'];
178
+    // No Break
179
+
180
+    case 1:
181
+      if ($galaxy && $system && $planet) {
182
+        $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
183
+
184
+        $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
185
+      }
186
+
187
+    case 0:
188
+      $template_result += array(
189
+        'thisgalaxy'      => $planetrow['galaxy'],
190
+        'thissystem'      => $planetrow['system'],
191
+        'thisplanet'      => $planetrow['planet'],
192
+        'thisplanet_type' => $planetrow['planet_type'],
193
+      );
194
+    // no break
195 195
 
196 196
 }
197 197
 
@@ -213,35 +213,35 @@  discard block
 block discarded – undo
213 213
 }
214 214
 
215 215
 switch($fleet_page) {
216
-  case 1:
217
-    require('includes/includes/flt_page1.inc');
218
-  break;
219
-
220
-  case 2:
221
-    require_once('includes/includes/flt_page2.inc');
222
-    sn_fleet_page2();
223
-  break;
224
-
225
-  case 3:
226
-    require_once('includes/includes/flt_page3.inc');
227
-    sn_fleet_page3();
228
-  break;
229
-
230
-  case 4:
231
-    require('includes/includes/flt_page4.inc');
232
-  break;
233
-
234
-  case 5:
235
-    $template = gettemplate('fleet5', true);
236
-    $pageFleet5Gathering = new \Pages\Deprecated\PageFleet5Gathering();
237
-    $pageFleet5Gathering->modelFleet5Gathering($user, $planetrow, $template);
238
-    // Building list of own planets & moons
239
-    $pageFleet5Gathering->viewPage5Gathering($user, $planetrow, $template);
240
-  break;
241
-
242
-  default:
243
-    define('SN_RENDER_NAVBAR_PLANET', true);
244
-
245
-    require('includes/includes/flt_page0.inc');
246
-  break;
216
+    case 1:
217
+      require('includes/includes/flt_page1.inc');
218
+    break;
219
+
220
+    case 2:
221
+      require_once('includes/includes/flt_page2.inc');
222
+      sn_fleet_page2();
223
+    break;
224
+
225
+    case 3:
226
+      require_once('includes/includes/flt_page3.inc');
227
+      sn_fleet_page3();
228
+    break;
229
+
230
+    case 4:
231
+      require('includes/includes/flt_page4.inc');
232
+    break;
233
+
234
+    case 5:
235
+      $template = gettemplate('fleet5', true);
236
+      $pageFleet5Gathering = new \Pages\Deprecated\PageFleet5Gathering();
237
+      $pageFleet5Gathering->modelFleet5Gathering($user, $planetrow, $template);
238
+      // Building list of own planets & moons
239
+      $pageFleet5Gathering->viewPage5Gathering($user, $planetrow, $template);
240
+    break;
241
+
242
+    default:
243
+      define('SN_RENDER_NAVBAR_PLANET', true);
244
+
245
+      require('includes/includes/flt_page0.inc');
246
+    break;
247 247
 }
Please login to merge, or discard this patch.
includes/init.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use Player\playerTimeDiff;
5 5
 
6 6
 // Защита от двойного инита
7
-if(defined('INIT')) {
7
+if (defined('INIT')) {
8 8
   return;
9 9
 }
10 10
 
@@ -122,47 +122,47 @@  discard block
 block discarded – undo
122 122
 // Но нужно, пока у нас есть не MVC-страницы
123 123
 $sn_page_data = $sn_mvc['pages'][$sn_page_name];
124 124
 $sn_page_name_file = 'includes/pages/' . $sn_page_data['filename'] . DOT_PHP_EX;
125
-if($sn_page_name) {
125
+if ($sn_page_name) {
126 126
   // Merging page options to global option pull
127
-  if(is_array($sn_page_data['options'])) {
127
+  if (is_array($sn_page_data['options'])) {
128 128
     SN::$options = array_merge(SN::$options, $sn_page_data['options']);
129 129
   }
130 130
 
131
-  if(isset($sn_page_data) && file_exists($sn_page_name_file)) {
131
+  if (isset($sn_page_data) && file_exists($sn_page_name_file)) {
132 132
     require_once($sn_page_name_file);
133 133
   }
134 134
 }
135 135
 
136
-if((defined('IN_AJAX') && IN_AJAX === true) || (defined('IN_ADMIN') && IN_ADMIN === true) || (!empty(SN::$options[PAGE_OPTION_ADMIN]))) {
136
+if ((defined('IN_AJAX') && IN_AJAX === true) || (defined('IN_ADMIN') && IN_ADMIN === true) || (!empty(SN::$options[PAGE_OPTION_ADMIN]))) {
137 137
   SN::$options[PAGE_OPTION_FLEET_UPDATE_SKIP] = true;
138 138
 }
139 139
 
140 140
 
141 141
 // А теперь проверяем - поддерживают ли у нас загруженный код такую страницу
142 142
 // TODO - костыль, что бы работали старые модули. Убрать!
143
-if(is_array($sn_data['pages'])) {
143
+if (is_array($sn_data['pages'])) {
144 144
   $sn_mvc['pages'] = array_merge($sn_mvc['pages'], $sn_data['pages']);
145 145
 }
146
-if(!isset($sn_mvc['pages'][$sn_page_name])) {
146
+if (!isset($sn_mvc['pages'][$sn_page_name])) {
147 147
   $sn_page_name = '';
148 148
 }
149 149
 
150 150
 $lang->lng_switch(sys_get_param_str('lang'));
151 151
 
152 152
 
153
-if(SN::$config->server_updater_check_auto && SN::$config->server_updater_check_last + SN::$config->server_updater_check_period <= SN_TIME_NOW) {
153
+if (SN::$config->server_updater_check_auto && SN::$config->server_updater_check_last + SN::$config->server_updater_check_period <= SN_TIME_NOW) {
154 154
   \Common\Tools\VersionCheckerDeprecated::performCheckVersion();
155 155
 }
156 156
 
157
-if(SN::$config->user_birthday_gift && SN_TIME_NOW - SN::$config->user_birthday_celebrate > PERIOD_DAY) {
157
+if (SN::$config->user_birthday_gift && SN_TIME_NOW - SN::$config->user_birthday_celebrate > PERIOD_DAY) {
158 158
   require_once(SN_ROOT_PHYSICAL . 'includes/includes/user_birthday_celebrate.php');
159 159
   sn_user_birthday_celebrate();
160 160
 }
161 161
 
162
-if(!SN::$config->var_online_user_count || SN::$config->var_online_user_time + 30 < SN_TIME_NOW) {
162
+if (!SN::$config->var_online_user_count || SN::$config->var_online_user_time + 30 < SN_TIME_NOW) {
163 163
   SN::$config->db_saveItem('var_online_user_count', db_user_count(true));
164 164
   SN::$config->db_saveItem('var_online_user_time', SN_TIME_NOW);
165
-  if(SN::$config->server_log_online) {
165
+  if (SN::$config->server_log_online) {
166 166
     doquery("INSERT IGNORE INTO `{{log_users_online}}` SET online_count = " . SN::$config->var_online_user_count . ";");
167 167
   }
168 168
 }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
 $template_result[F_ACCOUNT_IS_AUTHORIZED] = $sys_user_logged_in = !empty($user) && isset($user['id']) && $user['id'];
187 187
 
188
-if(!empty($user['id'])) {
188
+if (!empty($user['id'])) {
189 189
   SN::$user_options->user_change($user['id']);
190 190
 }
191 191
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         : false
199 199
       );
200 200
 
201
-if($template_result[F_LOGIN_STATUS] == LOGIN_ERROR_USERNAME_RESTRICTED_CHARACTERS) {
201
+if ($template_result[F_LOGIN_STATUS] == LOGIN_ERROR_USERNAME_RESTRICTED_CHARACTERS) {
202 202
   $prohibited_characters = array_map(function($value) {
203 203
     return "'" . htmlentities($value, ENT_QUOTES, 'UTF-8') . "'";
204 204
   }, str_split(LOGIN_REGISTER_CHARACTERS_PROHIBITED));
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 }
207 207
 
208 208
 
209
-if(defined('DEBUG_AUTH') && DEBUG_AUTH && !defined('IN_AJAX')) {
209
+if (defined('DEBUG_AUTH') && DEBUG_AUTH && !defined('IN_AJAX')) {
210 210
   pdump('Отключи отладку перед продакшном!');
211 211
 }
212 212
 
@@ -220,17 +220,17 @@  discard block
 block discarded – undo
220 220
 
221 221
 StatUpdateLauncher::unlock();
222 222
 
223
-if($template_result[F_GAME_DISABLE] = SN::$config->game_disable) {
223
+if ($template_result[F_GAME_DISABLE] = SN::$config->game_disable) {
224 224
   $template_result[F_GAME_DISABLE_REASON] = HelperString::nl2br(
225 225
     SN::$config->game_disable == GAME_DISABLE_REASON
226 226
       ? SN::$config->game_disable_reason
227 227
       : $lang['sys_game_disable_reason'][SN::$config->game_disable]
228 228
   );
229
-  if(defined('IN_API')) {
229
+  if (defined('IN_API')) {
230 230
     return;
231 231
   }
232 232
 
233
-  if(
233
+  if (
234 234
     ($user['authlevel'] < 1 || !(defined('IN_ADMIN') && IN_ADMIN))
235 235
     &&
236 236
     !(defined('INSTALL_MODE') && defined('LOGIN_LOGOUT'))
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
 
246 246
 // TODO ban
247 247
 // TODO $skip_ban_check
248
-if($template_result[F_BANNED_STATUS] && !$skip_ban_check) {
249
-  if(defined('IN_API')) {
248
+if ($template_result[F_BANNED_STATUS] && !$skip_ban_check) {
249
+  if (defined('IN_API')) {
250 250
     return;
251 251
   }
252 252
 
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 $allow_anonymous = $allow_anonymous || (isset($sn_page_data['allow_anonymous']) && $sn_page_data['allow_anonymous']);
261 261
 
262 262
 
263
-if($sys_user_logged_in && INITIAL_PAGE == 'login') {
263
+if ($sys_user_logged_in && INITIAL_PAGE == 'login') {
264 264
   sys_redirect(SN_ROOT_VIRTUAL . 'overview.php');
265
-} elseif($account_logged_in && !$sys_user_logged_in) { // empty(core_auth::$user['id'])
266
-} elseif(!$allow_anonymous && !$sys_user_logged_in) {
265
+} elseif ($account_logged_in && !$sys_user_logged_in) { // empty(core_auth::$user['id'])
266
+} elseif (!$allow_anonymous && !$sys_user_logged_in) {
267 267
   sys_redirect(SN_ROOT_VIRTUAL . 'login.php');
268 268
 }
269 269
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
   'fleet_update_last',
287 287
   SN::$config->fleet_update_interval,
288 288
   // Promise
289
-  function () {SN::$gc->fleetDispatcher->dispatch();},
289
+  function() {SN::$gc->fleetDispatcher->dispatch(); },
290 290
   WATCHDOG_TIME_SQL,
291 291
   false
292 292
 );
Please login to merge, or discard this patch.