Completed
Push — trunk ( 9bb608...09520e )
by SuperNova.WS
04:21
created
includes/functions/eco_get_build_data.php 2 patches
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
  */
14 14
 function eco_get_lab_max_effective_level(&$user, $lab_require)
15 15
 {
16
-  if(!$user['user_as_ally'] && !isset($user['laboratories_active']))
16
+  if (!$user['user_as_ally'] && !isset($user['laboratories_active']))
17 17
   {
18 18
     $user['laboratories_active'] = array();
19 19
     $query = DBStaticUnit::db_unit_list_laboratories($user['id']);
20
-    while($row = db_fetch($query))
20
+    while ($row = db_fetch($query))
21 21
     {
22
-      if(!eco_unit_busy($user, $row, UNIT_TECHNOLOGIES))
22
+      if (!eco_unit_busy($user, $row, UNIT_TECHNOLOGIES))
23 23
       {
24 24
         $row += array(
25 25
           STRUC_LABORATORY => $level_lab = mrc_get_level($user, $row, STRUC_LABORATORY),
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
     uasort($user['laboratories_active'], 'eco_lab_sort_effectivness');
34 34
   }
35 35
 
36
-  if(!isset($user['research_effective_level'][$lab_require]))
36
+  if (!isset($user['research_effective_level'][$lab_require]))
37 37
   {
38
-    if($user['user_as_ally'])
38
+    if ($user['user_as_ally'])
39 39
     {
40 40
       $lab_level = doquery("SELECT ally_members AS effective_level FROM {{alliance}} WHERE id = {$user['user_as_ally']} LIMIT 1", true);
41 41
     }
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
       $tech_intergalactic = mrc_get_level($user, false, TECH_RESEARCH) + 1;
45 45
       $lab_level['effective_level'] = 0;
46 46
 
47
-      foreach($user['laboratories_active'] as $data)
47
+      foreach ($user['laboratories_active'] as $data)
48 48
       {
49
-        if($tech_intergalactic <= 0)
49
+        if ($tech_intergalactic <= 0)
50 50
         {
51 51
           break;
52 52
         }
53
-        if($data[STRUC_LABORATORY] >= $lab_require)
53
+        if ($data[STRUC_LABORATORY] >= $lab_require)
54 54
         {
55 55
           $lab_level['effective_level'] += $data['laboratory_effective_level'];
56 56
           $tech_intergalactic--;
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
   $cost[P_OPTIONS][P_TIME_RAW] = 0;
91 91
   $only_dark_matter = 0;
92 92
   $cost_in_metal = 0;
93
-  foreach($unit_data[P_COST] as $resource_id => $resource_amount) {
94
-    if($resource_id === P_FACTOR || !($resource_cost = $resource_amount * $price_increase)) {
93
+  foreach ($unit_data[P_COST] as $resource_id => $resource_amount) {
94
+    if ($resource_id === P_FACTOR || !($resource_cost = $resource_amount * $price_increase)) {
95 95
       continue;
96 96
     }
97 97
 
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
 
103 103
     $cost_in_metal += $cost[BUILD_CREATE][$resource_id] * $currentResourceExchange;
104 104
 
105
-    if(in_array($resource_id, $resources_loot)) {
105
+    if (in_array($resource_id, $resources_loot)) {
106 106
       $cost[P_OPTIONS][P_TIME_RAW] += $resource_cost * $currentResourceExchange / $rpg_exchange_deuterium;
107 107
       $resource_got = mrc_get_level($user, $planet, $resource_id);
108
-    } elseif($resource_id == RES_DARK_MATTER) {
108
+    } elseif ($resource_id == RES_DARK_MATTER) {
109 109
       $resource_got = mrc_get_level($user, null, $resource_id);
110
-    } elseif($resource_id == RES_ENERGY) {
110
+    } elseif ($resource_id == RES_ENERGY) {
111 111
       $resource_got = max(0, $planet['energy_max'] - $planet['energy_used']);
112 112
     } else {
113 113
       $resource_got = 0;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
   }
120 120
 
121 121
   $resources_normalized = 0;
122
-  foreach($resources_loot as $resource_id) {
122
+  foreach ($resources_loot as $resource_id) {
123 123
     $resources_normalized += floor(mrc_get_level($user, $planet, $resource_id)) * $config->__get('rpg_exchange_' . pname_resource_name($resource_id));
124 124
   }
125 125
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
   $cost[P_OPTIONS][P_TIME_RAW] = $cost[P_OPTIONS][P_TIME_RAW] * 60 * 60 / get_game_speed() / 2500;
136 136
 
137 137
   // TODO - Вынести в отдельную процедуру расчёт стоимости
138
-  if($only_cost) {
138
+  if ($only_cost) {
139 139
     return $cost;
140 140
   }
141 141
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
   $cost['RESULT'][BUILD_DESTROY] = BUILD_INDESTRUCTABLE;
148 148
 
149 149
   $mercenary = 0;
150
-  if(in_array($unit_id, sn_get_groups('structures'))) {
150
+  if (in_array($unit_id, sn_get_groups('structures'))) {
151 151
     $cost[RES_TIME][BUILD_CREATE] *= pow(0.5, mrc_get_level($user, $planet, STRUC_FACTORY_NANO)) / (mrc_get_level($user, $planet, STRUC_FACTORY_ROBOT) + 1);
152 152
     $cost['RESULT'][BUILD_DESTROY] =
153 153
       mrc_get_level($user, $planet, $unit_id, false, true)
@@ -157,19 +157,19 @@  discard block
 block discarded – undo
157 157
           )
158 158
         : BUILD_NO_UNITS;
159 159
     $mercenary = MRC_ENGINEER;
160
-  } elseif(in_array($unit_id, sn_get_groups('tech'))) {
160
+  } elseif (in_array($unit_id, sn_get_groups('tech'))) {
161 161
     $lab_level = eco_get_lab_max_effective_level($user, intval($unit_data['require'][STRUC_LABORATORY]));
162 162
     $cost[RES_TIME][BUILD_CREATE] /= $lab_level;
163 163
     $mercenary = MRC_ACADEMIC;
164
-  } elseif(in_array($unit_id, sn_get_groups('defense'))) {
165
-    $cost[RES_TIME][BUILD_CREATE] *= pow(0.5, mrc_get_level($user, $planet, STRUC_FACTORY_NANO)) / (mrc_get_level($user, $planet, STRUC_FACTORY_HANGAR) + 1) ;
164
+  } elseif (in_array($unit_id, sn_get_groups('defense'))) {
165
+    $cost[RES_TIME][BUILD_CREATE] *= pow(0.5, mrc_get_level($user, $planet, STRUC_FACTORY_NANO)) / (mrc_get_level($user, $planet, STRUC_FACTORY_HANGAR) + 1);
166 166
     $mercenary = MRC_FORTIFIER;
167
-  } elseif(in_array($unit_id, sn_get_groups('fleet'))) {
167
+  } elseif (in_array($unit_id, sn_get_groups('fleet'))) {
168 168
     $cost[RES_TIME][BUILD_CREATE] *= pow(0.5, mrc_get_level($user, $planet, STRUC_FACTORY_NANO)) / (mrc_get_level($user, $planet, STRUC_FACTORY_HANGAR) + 1);
169 169
     $mercenary = MRC_ENGINEER;
170 170
   }
171 171
 
172
-  if(
172
+  if (
173 173
     // If planet is capital
174 174
     $user['id_planet'] == $planet['id']
175 175
     &&
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
     $cost[RES_TIME][BUILD_CREATE] = $cost[RES_TIME][BUILD_CREATE] / classSupernova::$gc->config->planet_capital_building_rate;
181 181
   }
182 182
 
183
-  if($mercenary) {
183
+  if ($mercenary) {
184 184
     $cost[RES_TIME][BUILD_CREATE] = $cost[RES_TIME][BUILD_CREATE] / mrc_modify_value($user, $planet, $mercenary, 1);
185 185
   }
186 186
 
187
-  if(in_array($unit_id, sn_get_groups('governors')) || $only_dark_matter) {
187
+  if (in_array($unit_id, sn_get_groups('governors')) || $only_dark_matter) {
188 188
     $cost[RES_TIME][BUILD_CREATE] = $cost[RES_TIME][BUILD_DESTROY] = 0;
189 189
   } else {
190 190
     $cost[RES_TIME][BUILD_CREATE]  = $cost[RES_TIME][BUILD_CREATE] > 1 ? round($cost[RES_TIME][BUILD_CREATE]) : 1;
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
   return $cost;
195 195
 }
196 196
 
197
-function eco_can_build_unit($user, $planet, $unit_id){$result = null;return sn_function_call('eco_can_build_unit', array($user, $planet, $unit_id, &$result));}
197
+function eco_can_build_unit($user, $planet, $unit_id) {$result = null; return sn_function_call('eco_can_build_unit', array($user, $planet, $unit_id, &$result)); }
198 198
 function sn_eco_can_build_unit($user, $planet, $unit_id, &$result) {
199 199
   global $config;
200 200
 
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
   $result = $result == BUILD_ALLOWED && eco_unit_busy($user, $planet, $unit_id) ? BUILD_UNIT_BUSY : $result;
203 203
 
204 204
   $unit_param = get_unit_param($unit_id);
205
-  if($unit_param[P_UNIT_TYPE] != UNIT_MERCENARIES || !$config->empire_mercenary_temporary) {
205
+  if ($unit_param[P_UNIT_TYPE] != UNIT_MERCENARIES || !$config->empire_mercenary_temporary) {
206 206
     $requirement = &$unit_param[P_REQUIRE];
207
-    if($result == BUILD_ALLOWED && $requirement) {
208
-      foreach($requirement as $require_id => $require_level) {
209
-        if(mrc_get_level($user, $planet, $require_id) < $require_level) {
207
+    if ($result == BUILD_ALLOWED && $requirement) {
208
+      foreach ($requirement as $require_id => $require_level) {
209
+        if (mrc_get_level($user, $planet, $require_id) < $require_level) {
210 210
           $result = BUILD_REQUIRE_NOT_MEET;
211 211
           break;
212 212
         }
@@ -223,12 +223,12 @@  discard block
 block discarded – undo
223 223
 
224 224
   $unit_list = is_array($unit_list) ? $unit_list : array($unit_list => $unit_list);
225 225
   $planet_que = explode(';', $planet_que);
226
-  foreach($planet_que as $planet_que_item)
226
+  foreach ($planet_que as $planet_que_item)
227 227
   {
228
-    if($planet_que_item)
228
+    if ($planet_que_item)
229 229
     {
230 230
       list($planet_que_item) = explode(',', $planet_que_item);
231
-      if(in_array($planet_que_item, $unit_list))
231
+      if (in_array($planet_que_item, $unit_list))
232 232
       {
233 233
         $eco_is_builds_in_que = true;
234 234
         break;
@@ -239,21 +239,21 @@  discard block
 block discarded – undo
239 239
   return $eco_is_builds_in_que;
240 240
 }
241 241
 
242
-function eco_unit_busy(&$user, &$planet, $unit_id){$result = null;return sn_function_call('eco_unit_busy', [&$user, &$planet, $unit_id, &$result]);}
242
+function eco_unit_busy(&$user, &$planet, $unit_id) {$result = null; return sn_function_call('eco_unit_busy', [&$user, &$planet, $unit_id, &$result]); }
243 243
 function sn_eco_unit_busy(&$user, &$planet, $unit_id, &$result)
244 244
 {
245 245
   global $config;
246 246
 
247 247
   $result = isset($result) ? $result : false;
248
-  if(!$result)
248
+  if (!$result)
249 249
   {
250
-    if(($unit_id == STRUC_LABORATORY || $unit_id == STRUC_LABORATORY_NANO) && !$config->BuildLabWhileRun)
250
+    if (($unit_id == STRUC_LABORATORY || $unit_id == STRUC_LABORATORY_NANO) && !$config->BuildLabWhileRun)
251 251
     {
252 252
       $global_que = que_get($user['id'], $planet['id'], QUE_RESEARCH, false);
253
-      if(is_array($global_que['ques'][QUE_RESEARCH][$user['id']]))
253
+      if (is_array($global_que['ques'][QUE_RESEARCH][$user['id']]))
254 254
       {
255 255
         $first_element = reset($global_que['ques'][QUE_RESEARCH][$user['id']]);
256
-        if(is_array($first_element))
256
+        if (is_array($first_element))
257 257
         {
258 258
           $result = true;
259 259
         }
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
       //  $result = true;
264 264
       //}
265 265
     }
266
-    elseif(($unit_id == UNIT_TECHNOLOGIES || in_array($unit_id, sn_get_groups('tech'))) && !$config->BuildLabWhileRun && $planet['que'])
266
+    elseif (($unit_id == UNIT_TECHNOLOGIES || in_array($unit_id, sn_get_groups('tech'))) && !$config->BuildLabWhileRun && $planet['que'])
267 267
     {
268 268
       $result = eco_is_builds_in_que($planet['que'], array(STRUC_LABORATORY, STRUC_LABORATORY_NANO));
269 269
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-function eco_lab_sort_effectivness($a, $b)
4
-{
3
+function eco_lab_sort_effectivness($a, $b) {
5 4
   return $a['laboratory_effective_level'] > $b['laboratory_effective_level'] ? -1 : ($a['laboratory_effective_level'] < $b['laboratory_effective_level'] ? 1 : 0);
6 5
 }
7 6
 
@@ -11,8 +10,7 @@  discard block
 block discarded – undo
11 10
  * 1.0 - copyright (c) 2010 by Gorlum for http://supernova.ws
12 11
  * @version 1.0
13 12
  */
14
-function eco_get_lab_max_effective_level(&$user, $lab_require)
15
-{
13
+function eco_get_lab_max_effective_level(&$user, $lab_require) {
16 14
   if(!$user['user_as_ally'] && !isset($user['laboratories_active']))
17 15
   {
18 16
     $user['laboratories_active'] = array();
@@ -38,8 +36,7 @@  discard block
 block discarded – undo
38 36
     if($user['user_as_ally'])
39 37
     {
40 38
       $lab_level = doquery("SELECT ally_members AS effective_level FROM {{alliance}} WHERE id = {$user['user_as_ally']} LIMIT 1", true);
41
-    }
42
-    else
39
+    } else
43 40
     {
44 41
       $tech_intergalactic = mrc_get_level($user, false, TECH_RESEARCH) + 1;
45 42
       $lab_level['effective_level'] = 0;
@@ -217,8 +214,7 @@  discard block
 block discarded – undo
217 214
   return $result;
218 215
 }
219 216
 
220
-function eco_is_builds_in_que($planet_que, $unit_list)
221
-{
217
+function eco_is_builds_in_que($planet_que, $unit_list) {
222 218
   $eco_is_builds_in_que = false;
223 219
 
224 220
   $unit_list = is_array($unit_list) ? $unit_list : array($unit_list => $unit_list);
@@ -240,8 +236,7 @@  discard block
 block discarded – undo
240 236
 }
241 237
 
242 238
 function eco_unit_busy(&$user, &$planet, $unit_id){$result = null;return sn_function_call('eco_unit_busy', [&$user, &$planet, $unit_id, &$result]);}
243
-function sn_eco_unit_busy(&$user, &$planet, $unit_id, &$result)
244
-{
239
+function sn_eco_unit_busy(&$user, &$planet, $unit_id, &$result) {
245 240
   global $config;
246 241
 
247 242
   $result = isset($result) ? $result : false;
@@ -262,8 +257,7 @@  discard block
 block discarded – undo
262 257
       //{
263 258
       //  $result = true;
264 259
       //}
265
-    }
266
-    elseif(($unit_id == UNIT_TECHNOLOGIES || in_array($unit_id, sn_get_groups('tech'))) && !$config->BuildLabWhileRun && $planet['que'])
260
+    } elseif(($unit_id == UNIT_TECHNOLOGIES || in_array($unit_id, sn_get_groups('tech'))) && !$config->BuildLabWhileRun && $planet['que'])
267 261
     {
268 262
       $result = eco_is_builds_in_que($planet['que'], array(STRUC_LABORATORY, STRUC_LABORATORY_NANO));
269 263
     }
Please login to merge, or discard this patch.
classes/classConfig.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
     'advGoogleLeftMenuCode'        => '(Place here code for banner)',
133 133
 
134 134
     // Alliance bonus calculations
135
-    'ali_bonus_algorithm'          => 0,  // Bonus calculation algorithm
135
+    'ali_bonus_algorithm'          => 0, // Bonus calculation algorithm
136 136
     'ali_bonus_brackets'           => 10, // Brackets count for ALI_BONUS_BY_RANK
137
-    'ali_bonus_brackets_divisor'   => 10,// Bonus divisor for ALI_BONUS_BY_RANK
137
+    'ali_bonus_brackets_divisor'   => 10, // Bonus divisor for ALI_BONUS_BY_RANK
138 138
     'ali_bonus_divisor'            => 10000000, // Rank divisor for ALI_BONUS_BY_POINTS
139 139
     'ali_bonus_members'            => 10, // Minimum alliance size to start using bonus
140 140
 
@@ -170,17 +170,17 @@  discard block
 block discarded – undo
170 170
     'deuterium_basic_income'       => 0,
171 171
     'eco_scale_storage'            => 1,
172 172
     'eco_stockman_fleet'           => '', // Black Market - Starting amount of s/h ship merchant to sell
173
-    'eco_stockman_fleet_populate'  => 1,  // Populate empty Stockman fleet with ships or not
173
+    'eco_stockman_fleet_populate'  => 1, // Populate empty Stockman fleet with ships or not
174 174
     'empire_mercenary_base_period' => PERIOD_MONTH, // Base
175 175
     'empire_mercenary_temporary'   => 0, // Temporary empire-wide mercenaries
176 176
     'energy_basic_income'          => 0,
177 177
 
178 178
     // Bashing protection settings
179
-    'fleet_bashing_attacks'        => 3,      // Max amount of attack per wave - 3 by default
180
-    'fleet_bashing_interval'       => 1800,   // Maximum interval between attacks when they still count as one wave - 30m by default
181
-    'fleet_bashing_scope'          => 86400,  // Interval on which bashing waves counts - 24h by default
182
-    'fleet_bashing_war_delay'      => 43200,  // Delay before start bashing after declaring war to alliance - 12h by default
183
-    'fleet_bashing_waves'          => 3,      // Max amount of waves per day - 3 by default
179
+    'fleet_bashing_attacks'        => 3, // Max amount of attack per wave - 3 by default
180
+    'fleet_bashing_interval'       => 1800, // Maximum interval between attacks when they still count as one wave - 30m by default
181
+    'fleet_bashing_scope'          => 86400, // Interval on which bashing waves counts - 24h by default
182
+    'fleet_bashing_war_delay'      => 43200, // Delay before start bashing after declaring war to alliance - 12h by default
183
+    'fleet_bashing_waves'          => 3, // Max amount of waves per day - 3 by default
184 184
 
185 185
     'Fleet_Cdr'   => 30,
186 186
     'fleet_speed' => 1,
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
     'fleet_update_interval' => 4,
189 189
     'fleet_update_lock'     => '', // SQL time when lock was acquired
190 190
 
191
-    'game_adminEmail'       => 'root@localhost',    // Admin's email to show to users
192
-    'game_counter'          => 0,  // Does built-in page hit counter is on?
191
+    'game_adminEmail'       => 'root@localhost', // Admin's email to show to users
192
+    'game_counter'          => 0, // Does built-in page hit counter is on?
193 193
     // Defaults
194 194
     'game_default_language' => 'ru',
195 195
     'game_default_skin'     => 'skins/EpicBlue/',
@@ -203,14 +203,14 @@  discard block
 block discarded – undo
203 203
     'game_maxSystem'      => 199,
204 204
     'game_maxPlanet'      => 15,
205 205
     // Game global settings
206
-    'game_mode'           => 0,           // 0 - SuperNova, 1 - oGame
206
+    'game_mode'           => 0, // 0 - SuperNova, 1 - oGame
207 207
     'game_name'           => 'SuperNova', // Server name (would be on banners and on top of left menu)
208 208
 
209 209
     'game_news_actual'        => PERIOD_DAY_3, // How long announcement would be marked as "New". In seconds. Default - 3 days
210
-    'game_news_overview'      => 3,    // How much last news to show in Overview page
211
-    'game_news_overview_show' => PERIOD_WEEK_2,    // How long news will be shown in Overview page in seconds. Default - 2 weeks
210
+    'game_news_overview'      => 3, // How much last news to show in Overview page
211
+    'game_news_overview_show' => PERIOD_WEEK_2, // How long news will be shown in Overview page in seconds. Default - 2 weeks
212 212
     // Noob protection
213
-    'game_noob_factor'        => 5,    // Multiplier to divide "stronger" and "weaker" users
213
+    'game_noob_factor'        => 5, // Multiplier to divide "stronger" and "weaker" users
214 214
     'game_noob_points'        => 5000, // Below this point user threated as noob. 0 to disable
215 215
 
216 216
     'game_multiaccount_enabled' => 0, // 1 - allow interactions for players with same IP (multiaccounts)
@@ -265,12 +265,12 @@  discard block
 block discarded – undo
265 265
     'payment_currency_exchange_wmu' => 30,
266 266
     'payment_currency_exchange_wmz' => 1,
267 267
 
268
-    'payment_lot_price' => 1,     // Lot price in default currency
269
-    'payment_lot_size'  => 2500,  // Lot size. Also service as minimum amount of DM that could be bought with one transaction
268
+    'payment_lot_price' => 1, // Lot price in default currency
269
+    'payment_lot_size'  => 2500, // Lot size. Also service as minimum amount of DM that could be bought with one transaction
270 270
 
271 271
     'planet_capital_cost'          => 25000, // Cost in DM to move Capital to current planet
272
-    'planet_capital_mining_rate'   => 2.0,   // Capital Mining rates
273
-    'planet_capital_building_rate' => 2.0,   // Capital Building rates
272
+    'planet_capital_mining_rate'   => 2.0, // Capital Mining rates
273
+    'planet_capital_building_rate' => 2.0, // Capital Building rates
274 274
     'planet_teleport_cost'         => 50000, // Cost of planet teleportation
275 275
     'planet_teleport_timeout'      => 86400, // Timeout for next teleportation
276 276
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     'resource_multiplier'     => 1,
291 291
 
292 292
     //Roleplay system
293
-    'rpg_bonus_divisor'       => 10,    // Amount of DM referral shoud get for partner have 1 DM bonus
293
+    'rpg_bonus_divisor'       => 10, // Amount of DM referral shoud get for partner have 1 DM bonus
294 294
     'rpg_bonus_minimum'       => 10000, // Minimum DM ammount for starting paying bonuses to affiliate
295 295
 
296 296
     // Black Market - General
Please login to merge, or discard this patch.
galaxy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     ||
126 126
     (!empty($uni_galaxyRowPlanet['destruyed']) && CheckAbandonPlanetState($uni_galaxyRowPlanet))
127 127
   ) {
128
-    $template->assign_block_vars('galaxyrow', ['PLANET_NUM' => $Planet,]);
128
+    $template->assign_block_vars('galaxyrow', ['PLANET_NUM' => $Planet, ]);
129 129
     continue;
130 130
   }
131 131
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     'IS_CAPITAL'      => $uni_galaxyRowUser['id_planet'] == $uni_galaxyRowPlanet['id'],
243 243
 
244 244
     'USER_ID'         => $uni_galaxyRowUser['id'],
245
-    'USER_NAME'       => $renderedNick = player_nick_render_to_html($uni_galaxyRowUser, ['icons' => true,]),
245
+    'USER_NAME'       => $renderedNick = player_nick_render_to_html($uni_galaxyRowUser, ['icons' => true, ]),
246 246
     'USER_NAME_JS'    => js_safe_string($renderedNick),
247 247
     'USER_RANK'       => in_array($uni_galaxyRowUser['id'], $user_skip_list) ? '-' : $uni_galaxyRowUser['total_rank'],
248 248
     'USER_BANNED'     => $uni_galaxyRowUser['banaday'],
Please login to merge, or discard this patch.
includes/constants.php 1 patch
Spacing   +246 added lines, -246 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(defined('__SN_CONSTANTS_DEFINED') && __SN_CONSTANTS_DEFINED === true) {
3
+if (defined('__SN_CONSTANTS_DEFINED') && __SN_CONSTANTS_DEFINED === true) {
4 4
   return;
5 5
 }
6 6
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 define('SN_ROOT_VIRTUAL', 'http' . (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_server_http_host . SN_ROOT_RELATIVE);
36 36
 
37 37
 $_server_server_name = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '';
38
-if(strpos(strtolower($_server_server_name), 'google.') !== false) {
38
+if (strpos(strtolower($_server_server_name), 'google.') !== false) {
39 39
   define('SN_GOOGLE', true);
40 40
 }
41 41
 define('SN_ROOT_VIRTUAL_PARENT', str_replace('//google.', '//', SN_ROOT_VIRTUAL));
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 
57 57
 // Game type constants starts with GAME_
58 58
 define('GAME_SUPERNOVA', 0);
59
-define('GAME_OGAME'    , 1);
60
-define('GAME_BLITZ'    , 2);
59
+define('GAME_OGAME', 1);
60
+define('GAME_BLITZ', 2);
61 61
 
62 62
 // Date & time range constants
63 63
 define('DATE_FOREVER', 2000000000);
@@ -70,16 +70,16 @@  discard block
 block discarded – undo
70 70
 define('PERIOD_YEAR', PERIOD_DAY * 365);
71 71
 define('PERIOD_FOREVER', PERIOD_YEAR * 100);
72 72
 
73
-define('PERIOD_MINUTE_2' , PERIOD_MINUTE * 2);
74
-define('PERIOD_MINUTE_3' , PERIOD_MINUTE * 3);
75
-define('PERIOD_MINUTE_5' , PERIOD_MINUTE * 5);
73
+define('PERIOD_MINUTE_2', PERIOD_MINUTE * 2);
74
+define('PERIOD_MINUTE_3', PERIOD_MINUTE * 3);
75
+define('PERIOD_MINUTE_5', PERIOD_MINUTE * 5);
76 76
 define('PERIOD_MINUTE_10', PERIOD_MINUTE * 10);
77 77
 define('PERIOD_MINUTE_15', PERIOD_MINUTE * 15);
78
-define('PERIOD_DAY_3'    , PERIOD_DAY * 3);
79
-define('PERIOD_WEEK_2'   , PERIOD_WEEK * 2);
80
-define('PERIOD_WEEK_4'   , PERIOD_WEEK * 4);
81
-define('PERIOD_MONTH_2'  , PERIOD_MONTH * 2);
82
-define('PERIOD_MONTH_3'  , PERIOD_MONTH * 3);
78
+define('PERIOD_DAY_3', PERIOD_DAY * 3);
79
+define('PERIOD_WEEK_2', PERIOD_WEEK * 2);
80
+define('PERIOD_WEEK_4', PERIOD_WEEK * 4);
81
+define('PERIOD_MONTH_2', PERIOD_MONTH * 2);
82
+define('PERIOD_MONTH_3', PERIOD_MONTH * 3);
83 83
 
84 84
 define('FONT_SIZE_PERCENT_MIN', 56.25);
85 85
 define('FONT_SIZE_PERCENT_DEFAULT', 68.75);
@@ -134,38 +134,38 @@  discard block
 block discarded – undo
134 134
 
135 135
 // Mot qui sont interdit a la saisie !
136 136
 global $ListCensure;
137
-$ListCensure = array ( '/</', '/>/', '/script/i', '/doquery/i', '/http/i', '/javascript/i');
137
+$ListCensure = array('/</', '/>/', '/script/i', '/doquery/i', '/http/i', '/javascript/i');
138 138
 
139 139
 // Confirmation record types
140
-define('CONFIRM_REGISTRATION'  , 1);
140
+define('CONFIRM_REGISTRATION', 1);
141 141
 define('CONFIRM_PASSWORD_RESET', 2);
142
-define('CONFIRM_DELETE'        , 3);
142
+define('CONFIRM_DELETE', 3);
143 143
 
144 144
 define('AFFILIATE_MM_TO_REFERRAL_DM', 2);
145 145
 
146 146
 // Ally diplomacy statuses
147
-define('ALLY_DIPLOMACY_SELF'         , 'self');
148
-define('ALLY_DIPLOMACY_NEUTRAL'      , 'neutral');
149
-define('ALLY_DIPLOMACY_WAR'          , 'war');
150
-define('ALLY_DIPLOMACY_PEACE'        , 'peace');
147
+define('ALLY_DIPLOMACY_SELF', 'self');
148
+define('ALLY_DIPLOMACY_NEUTRAL', 'neutral');
149
+define('ALLY_DIPLOMACY_WAR', 'war');
150
+define('ALLY_DIPLOMACY_PEACE', 'peace');
151 151
 define('ALLY_DIPLOMACY_CONFEDERATION', 'confederation');
152
-define('ALLY_DIPLOMACY_FEDERATION'   , 'federation');
153
-define('ALLY_DIPLOMACY_UNION'        , 'union');
154
-define('ALLY_DIPLOMACY_MASTER'       , 'master');
155
-define('ALLY_DIPLOMACY_SLAVE'        , 'slave');
152
+define('ALLY_DIPLOMACY_FEDERATION', 'federation');
153
+define('ALLY_DIPLOMACY_UNION', 'union');
154
+define('ALLY_DIPLOMACY_MASTER', 'master');
155
+define('ALLY_DIPLOMACY_SLAVE', 'slave');
156 156
 
157 157
 define('ALLY_PROPOSE_SEND', 0);
158 158
 
159 159
 // Quest types
160
-define('QUEST_TYPE_BUILD'   , 1);
160
+define('QUEST_TYPE_BUILD', 1);
161 161
 define('QUEST_TYPE_RESEARCH', 2);
162
-define('QUEST_TYPE_COMBAT'  , 3);
162
+define('QUEST_TYPE_COMBAT', 3);
163 163
 
164
-define('QUEST_STATUS_EXCEPT_COMPLETE' , -2);
165
-define('QUEST_STATUS_ALL' , -1);
166
-define('QUEST_STATUS_NOT_STARTED' , 0);
167
-define('QUEST_STATUS_STARTED'     , 1);
168
-define('QUEST_STATUS_COMPLETE'    , 2);
164
+define('QUEST_STATUS_EXCEPT_COMPLETE', -2);
165
+define('QUEST_STATUS_ALL', -1);
166
+define('QUEST_STATUS_NOT_STARTED', 0);
167
+define('QUEST_STATUS_STARTED', 1);
168
+define('QUEST_STATUS_COMPLETE', 2);
169 169
 
170 170
 define('TYPE_EMPTY', '');
171 171
 define('TYPE_INTEGER', 'integer');
@@ -178,68 +178,68 @@  discard block
 block discarded – undo
178 178
 
179 179
 // *** Combat-related constants
180 180
 // *** Mission Type constants starts with MT_
181
-define('MT_NONE'     ,  0);
182
-define('MT_ATTACK'   ,  1);
183
-define('MT_AKS'      ,  2);
184
-define('MT_TRANSPORT',  3);
185
-define('MT_RELOCATE' ,  4);
186
-define('MT_HOLD'     ,  5);
187
-define('MT_SPY'      ,  6);
188
-define('MT_COLONIZE' ,  7);
189
-define('MT_RECYCLE'  ,  8);
190
-define('MT_DESTROY'  ,  9);
191
-define('MT_MISSILE'  , 10);
192
-define('MT_EXPLORE'  , 15);
181
+define('MT_NONE', 0);
182
+define('MT_ATTACK', 1);
183
+define('MT_AKS', 2);
184
+define('MT_TRANSPORT', 3);
185
+define('MT_RELOCATE', 4);
186
+define('MT_HOLD', 5);
187
+define('MT_SPY', 6);
188
+define('MT_COLONIZE', 7);
189
+define('MT_RECYCLE', 8);
190
+define('MT_DESTROY', 9);
191
+define('MT_MISSILE', 10);
192
+define('MT_EXPLORE', 15);
193 193
 
194 194
 // *** Planet Target constants starts with PT_
195 195
 define('PT_NONE', 0);
196 196
 define('PT_ALL', 0);
197 197
 define('PT_PLANET', 1);
198 198
 define('PT_DEBRIS', 2);
199
-define('PT_MOON'  , 3);
199
+define('PT_MOON', 3);
200 200
 
201 201
 // *** Unit locations - shows db table where unit belong
202 202
 // Also cache indexes
203 203
 define('LOC_AUTODETECT', -2);
204
-define('LOC_NONE',    -1); // Deprecated
204
+define('LOC_NONE', -1); // Deprecated
205 205
 define('LOC_UNIVERSE', 0);
206
-define('LOC_PLANET',   1);
207
-define('LOC_DEBRIS',   2); // Translates to `planets` table planet_type = 1, `debris_*` fields
208
-define('LOC_MOON',     3); // Translates to `planets` table planet_type = 3
209
-define('LOC_USER',     4);
210
-define('LOC_FLEET',    5);
211
-define('LOC_ALLY',     6);
212
-define('LOC_SERVER',   7); // Located on server
206
+define('LOC_PLANET', 1);
207
+define('LOC_DEBRIS', 2); // Translates to `planets` table planet_type = 1, `debris_*` fields
208
+define('LOC_MOON', 3); // Translates to `planets` table planet_type = 3
209
+define('LOC_USER', 4);
210
+define('LOC_FLEET', 5);
211
+define('LOC_ALLY', 6);
212
+define('LOC_SERVER', 7); // Located on server
213 213
 
214 214
 // ТОЛЬКО ВНУТРЕНЕЕ!!!
215
-define('LOC_UNIT',    'LOC_UNIT');
216
-define('LOC_QUE',     'LOC_QUE');
217
-define('LOC_LOCATION','LOC_LOCATION');
218
-define('LOC_LOCKS','LOC_LOCKS');
215
+define('LOC_UNIT', 'LOC_UNIT');
216
+define('LOC_QUE', 'LOC_QUE');
217
+define('LOC_LOCATION', 'LOC_LOCATION');
218
+define('LOC_LOCKS', 'LOC_LOCKS');
219 219
 
220 220
 // *** Caching masks
221
-define('CACHE_NOTHING'    ,  0);
222
-define('CACHE_FLEET'      ,  1);
223
-define('CACHE_PLANET'     ,  2);
224
-define('CACHE_USER'       ,  4);
225
-define('CACHE_SOURCE'     ,  8);
221
+define('CACHE_NOTHING', 0);
222
+define('CACHE_FLEET', 1);
223
+define('CACHE_PLANET', 2);
224
+define('CACHE_USER', 4);
225
+define('CACHE_SOURCE', 8);
226 226
 define('CACHE_DESTINATION', 16);
227
-define('CACHE_EVENT'      , 32);
227
+define('CACHE_EVENT', 32);
228 228
 
229
-define('CACHE_USER_SRC'  , CACHE_USER | CACHE_SOURCE);
230
-define('CACHE_USER_DST'  , CACHE_USER | CACHE_DESTINATION);
229
+define('CACHE_USER_SRC', CACHE_USER | CACHE_SOURCE);
230
+define('CACHE_USER_DST', CACHE_USER | CACHE_DESTINATION);
231 231
 define('CACHE_PLANET_SRC', CACHE_PLANET | CACHE_SOURCE);
232 232
 define('CACHE_PLANET_DST', CACHE_PLANET | CACHE_DESTINATION);
233
-define('CACHE_COMBAT'    , CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION);
233
+define('CACHE_COMBAT', CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION);
234 234
 
235
-define('CACHE_ALL'       , CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION | CACHE_EVENT);
235
+define('CACHE_ALL', CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION | CACHE_EVENT);
236 236
 
237
-define('CACHE_NONE'      , CACHE_NOTHING); // Alias for me
237
+define('CACHE_NONE', CACHE_NOTHING); // Alias for me
238 238
 
239 239
 // *** Event types
240 240
 define('EVENT_FLEET_NONE', 0);
241 241
 define('EVENT_FLEET_ARRIVE', 1);
242
-define('EVENT_FLEET_STAY'  , 2);
242
+define('EVENT_FLEET_STAY', 2);
243 243
 define('EVENT_FLEET_RETURN', 3);
244 244
 
245 245
 // *** Constants for changing DM
@@ -297,11 +297,11 @@  discard block
 block discarded – undo
297 297
 
298 298
 
299 299
 // Operation error status HARDCODE!
300
-define('ERR_NONE'               , 0); // No error
301
-define('ERR_WARNING'            , 1); // There is warning - something altering normal operation process
302
-define('ERR_ERROR'              , 2); // There is error - something permits operation from process
303
-define('ERR_HACK'               , 4); // Operation is qualified as hack attempt
304
-define('ERR_NOTICE'             , 8); // There is notice - nothing really critical but operator should know
300
+define('ERR_NONE', 0); // No error
301
+define('ERR_WARNING', 1); // There is warning - something altering normal operation process
302
+define('ERR_ERROR', 2); // There is error - something permits operation from process
303
+define('ERR_HACK', 4); // Operation is qualified as hack attempt
304
+define('ERR_NOTICE', 8); // There is notice - nothing really critical but operator should know
305 305
 // New GLOBAL operation results
306 306
 //define('RESULT_DEFAULT' , 0); // Default result - all went OK or result really doesn't matter
307 307
 //define('RESULT_WARNING' , 1);
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 define('SN_PAYMENT_REQUEST_OK', 0);
322 322
 define('SN_PAYMENT_REQUEST_ERROR_UNIT_AMOUNT', 1);
323 323
 define('SN_PAYMENT_REQUEST_ERROR_PAYLINK_UNSUPPORTED', 2);
324
-define('SN_PAYMENT_REQUEST_IP_WRONG', 3);  // Неправильный IP входящей системы - обычно хак
324
+define('SN_PAYMENT_REQUEST_IP_WRONG', 3); // Неправильный IP входящей системы - обычно хак
325 325
 define('SN_PAYMENT_REQUEST_COMMAND_UNSUPPORTED', 4); // Неподдерживаемая команда - обычно хак
326 326
 define('SN_PAYMENT_REQUEST_SIGNATURE_INVALID', 5); // Неправильная подпись или не сошлась контрольная сумма - обычно хак
327 327
 define('SN_MODULE_DISABLED', 6); // Модуль отключен // УНИВЕРСАЛЬНЫЙ ОТВЕТ!
@@ -597,16 +597,16 @@  discard block
 block discarded – undo
597 597
 //define('F_DEVICE_ID',     'F_DEVICE_ID');
598 598
 //define('F_DEVICE_CYPHER', 'F_DEVICE_CYPHER');
599 599
 
600
-define('F_PROVIDER_ID',   'F_PROVIDER_ID');
600
+define('F_PROVIDER_ID', 'F_PROVIDER_ID');
601 601
 // define('F_PROVIDER_LIST', 'F_PROVIDER_LIST');
602 602
 
603 603
 define('F_IMPERSONATE_STATUS', 'F_IMPERSONATE_STATUS');
604 604
 define('F_IMPERSONATE_OPERATOR', 'F_IMPERSONATE_OPERATOR');
605 605
 
606
-define('F_LOGIN_STATUS',  'F_LOGIN_STATUS');
606
+define('F_LOGIN_STATUS', 'F_LOGIN_STATUS');
607 607
 define('F_LOGIN_MESSAGE', 'F_LOGIN_MESSAGE');
608 608
 
609
-define('F_PLAYER_REGISTER_STATUS',  'F_PLAYER_REGISTER_STATUS');
609
+define('F_PLAYER_REGISTER_STATUS', 'F_PLAYER_REGISTER_STATUS');
610 610
 define('F_PLAYER_REGISTER_MESSAGE', 'F_PLAYER_REGISTER_MESSAGE');
611 611
 
612 612
 define('F_USER_ID', 'F_USER_ID');
@@ -650,78 +650,78 @@  discard block
 block discarded – undo
650 650
 
651 651
 
652 652
 // Option groups
653
-define('OPT_ALL',      0);
654
-define('OPT_MESSAGE',  1);
653
+define('OPT_ALL', 0);
654
+define('OPT_MESSAGE', 1);
655 655
 define('OPT_UNIVERSE', 2);
656 656
 define('OPT_INTERFACE', 3);
657 657
 
658 658
 // Message classes
659
-define('MSG_TYPE_OUTBOX'   ,  -1);
660
-define('MSG_TYPE_SPY'      ,   0);
661
-define('MSG_TYPE_PLAYER'   ,   1);
662
-define('MSG_TYPE_ALLIANCE' ,   2);
663
-define('MSG_TYPE_COMBAT'   ,   3);
664
-define('MSG_TYPE_RECYCLE'  ,   4);
665
-define('MSG_TYPE_TRANSPORT',   5);
666
-define('MSG_TYPE_ADMIN'    ,   6);
667
-define('MSG_TYPE_EXPLORE'  ,  15);
668
-define('MSG_TYPE_QUE'      ,  99);
669
-define('MSG_TYPE_NEW'      , 100);
659
+define('MSG_TYPE_OUTBOX', -1);
660
+define('MSG_TYPE_SPY', 0);
661
+define('MSG_TYPE_PLAYER', 1);
662
+define('MSG_TYPE_ALLIANCE', 2);
663
+define('MSG_TYPE_COMBAT', 3);
664
+define('MSG_TYPE_RECYCLE', 4);
665
+define('MSG_TYPE_TRANSPORT', 5);
666
+define('MSG_TYPE_ADMIN', 6);
667
+define('MSG_TYPE_EXPLORE', 15);
668
+define('MSG_TYPE_QUE', 99);
669
+define('MSG_TYPE_NEW', 100);
670 670
 
671 671
 // Attack verification statuses
672
-define('ATTACK_ALLOWED'           ,  0);
673
-define('ATTACK_NO_TARGET'         ,  1);
674
-define('ATTACK_OWN'               ,  2);
675
-define('ATTACK_WRONG_MISSION'     ,  3);
676
-define('ATTACK_NO_ALLY_DEPOSIT'   ,  4);
677
-define('ATTACK_NO_DEBRIS'         ,  5);
678
-define('ATTACK_VACATION'          ,  6);
679
-define('ATTACK_SAME_IP'           ,  7);
680
-define('ATTACK_BUFFING'           ,  8);
681
-define('ATTACK_ADMIN'             ,  9);
682
-define('ATTACK_NOOB'              , 10);
683
-define('ATTACK_OWN_VACATION'      , 11);
684
-define('ATTACK_NO_SILO'           , 12);
685
-define('ATTACK_NO_MISSILE'        , 13);
686
-define('ATTACK_NO_FLEET'          , 14);
687
-define('ATTACK_NO_SLOTS'          , 15);
688
-define('ATTACK_NO_SHIPS'          , 16);
689
-define('ATTACK_NO_RECYCLERS'      , 17);
690
-define('ATTACK_NO_SPIES'          , 18);
691
-define('ATTACK_NO_COLONIZER'      , 19);
692
-define('ATTACK_MISSILE_TOO_FAR'   , 20);
693
-define('ATTACK_WRONG_STRUCTURE'   , 21);
694
-define('ATTACK_NO_FUEL'           , 22);
695
-define('ATTACK_NO_RESOURCES'      , 23);
696
-define('ATTACK_NO_ACS'            , 24);
697
-define('ATTACK_ACS_MISSTARGET'    , 25);
698
-define('ATTACK_WRONG_SPEED'       , 26);
699
-define('ATTACK_ACS_TOO_LATE'      , 27);
700
-define('ATTACK_BASHING'           , 28);
701
-define('ATTACK_BASHING_WAR_DELAY' , 29);
702
-define('ATTACK_ACS_WRONG_TARGET'  , 30);
703
-define('ATTACK_SAME'              , 31);
672
+define('ATTACK_ALLOWED', 0);
673
+define('ATTACK_NO_TARGET', 1);
674
+define('ATTACK_OWN', 2);
675
+define('ATTACK_WRONG_MISSION', 3);
676
+define('ATTACK_NO_ALLY_DEPOSIT', 4);
677
+define('ATTACK_NO_DEBRIS', 5);
678
+define('ATTACK_VACATION', 6);
679
+define('ATTACK_SAME_IP', 7);
680
+define('ATTACK_BUFFING', 8);
681
+define('ATTACK_ADMIN', 9);
682
+define('ATTACK_NOOB', 10);
683
+define('ATTACK_OWN_VACATION', 11);
684
+define('ATTACK_NO_SILO', 12);
685
+define('ATTACK_NO_MISSILE', 13);
686
+define('ATTACK_NO_FLEET', 14);
687
+define('ATTACK_NO_SLOTS', 15);
688
+define('ATTACK_NO_SHIPS', 16);
689
+define('ATTACK_NO_RECYCLERS', 17);
690
+define('ATTACK_NO_SPIES', 18);
691
+define('ATTACK_NO_COLONIZER', 19);
692
+define('ATTACK_MISSILE_TOO_FAR', 20);
693
+define('ATTACK_WRONG_STRUCTURE', 21);
694
+define('ATTACK_NO_FUEL', 22);
695
+define('ATTACK_NO_RESOURCES', 23);
696
+define('ATTACK_NO_ACS', 24);
697
+define('ATTACK_ACS_MISSTARGET', 25);
698
+define('ATTACK_WRONG_SPEED', 26);
699
+define('ATTACK_ACS_TOO_LATE', 27);
700
+define('ATTACK_BASHING', 28);
701
+define('ATTACK_BASHING_WAR_DELAY', 29);
702
+define('ATTACK_ACS_WRONG_TARGET', 30);
703
+define('ATTACK_SAME', 31);
704 704
 define('ATTACK_RESOURCE_FORBIDDEN', 32);
705
-define('ATTACK_TRANSPORT_EMPTY'   , 33);
706
-define('ATTACK_SPIES_LONLY'       , 34);
707
-define('ATTACK_TOO_FAR'           , 35);
708
-define('ATTACK_OVERLOADED'        , 36);
709
-define('ATTACK_MISSION_ABSENT'    , 37);
710
-define('ATTACK_WRONG_UNIT'        , 38);
711
-define('ATTACK_ZERO_SPEED'        , 39);
712
-define('ATTACK_SHIP_COUNT_WRONG'  , 40);
705
+define('ATTACK_TRANSPORT_EMPTY', 33);
706
+define('ATTACK_SPIES_LONLY', 34);
707
+define('ATTACK_TOO_FAR', 35);
708
+define('ATTACK_OVERLOADED', 36);
709
+define('ATTACK_MISSION_ABSENT', 37);
710
+define('ATTACK_WRONG_UNIT', 38);
711
+define('ATTACK_ZERO_SPEED', 39);
712
+define('ATTACK_SHIP_COUNT_WRONG', 40);
713 713
 define('ATTACK_RESOURCE_COUNT_WRONG', 41);
714 714
 define('ATTACK_MORATORIUM', 42);
715 715
 define('ATTACK_CHILD_PROTECTION', 43);
716 716
 
717 717
 
718 718
 // *** Races - Homeworlds
719
-define('RACE_NONE'    , 0);
720
-define('RACE_EARTH'   , 1);
721
-define('RACE_MOON'    , 2);
722
-define('RACE_MERCURY' , 3);
723
-define('RACE_VENUS'   , 4);
724
-define('RACE_MARS'    , 5);
719
+define('RACE_NONE', 0);
720
+define('RACE_EARTH', 1);
721
+define('RACE_MOON', 2);
722
+define('RACE_MERCURY', 3);
723
+define('RACE_VENUS', 4);
724
+define('RACE_MARS', 5);
725 725
 define('RACE_ASTEROID', 6);
726 726
 // define('MARKET_INFO'         , 7);
727 727
 
@@ -729,115 +729,115 @@  discard block
 block discarded – undo
729 729
 
730 730
 // *** Market variables
731 731
 // === Market blocks
732
-define('MARKET_ENTRY'        , 0);
733
-define('MARKET_RESOURCES'    , 1);
734
-define('MARKET_SCRAPPER'     , 2);
735
-define('MARKET_STOCKMAN'     , 3);
736
-define('MARKET_EXCHANGE'     , 4);
737
-define('MARKET_BANKER'       , 5);
738
-define('MARKET_PAWNSHOP'     , 6);
739
-define('MARKET_INFO'         , 7);
732
+define('MARKET_ENTRY', 0);
733
+define('MARKET_RESOURCES', 1);
734
+define('MARKET_SCRAPPER', 2);
735
+define('MARKET_STOCKMAN', 3);
736
+define('MARKET_EXCHANGE', 4);
737
+define('MARKET_BANKER', 5);
738
+define('MARKET_PAWNSHOP', 6);
739
+define('MARKET_INFO', 7);
740 740
 
741 741
 // === Market error statuses
742
-define('MARKET_NOTHING'              ,  0);
743
-define('MARKET_DEAL'                 ,  1);
744
-define('MARKET_DEAL_TRADE'           ,  2);
745
-define('MARKET_NO_DM'                ,  3);
746
-define('MARKET_NO_RESOURCES'         ,  4);
747
-define('MARKET_ZERO_DEAL'            ,  5);
748
-define('MARKET_NO_SHIPS'             ,  6);
749
-define('MARKET_NOT_A_SHIP'           ,  7);
750
-define('MARKET_NO_STOCK'             ,  8);
751
-define('MARKET_ZERO_RES_STOCK'       ,  9);
752
-define('MARKET_NEGATIVE_SHIPS'       , 10);
753
-
754
-define('MARKET_INFO_PLAYER'          , 12);
755
-define('MARKET_INFO_WRONG'           , 11);
742
+define('MARKET_NOTHING', 0);
743
+define('MARKET_DEAL', 1);
744
+define('MARKET_DEAL_TRADE', 2);
745
+define('MARKET_NO_DM', 3);
746
+define('MARKET_NO_RESOURCES', 4);
747
+define('MARKET_ZERO_DEAL', 5);
748
+define('MARKET_NO_SHIPS', 6);
749
+define('MARKET_NOT_A_SHIP', 7);
750
+define('MARKET_NO_STOCK', 8);
751
+define('MARKET_ZERO_RES_STOCK', 9);
752
+define('MARKET_NEGATIVE_SHIPS', 10);
753
+
754
+define('MARKET_INFO_PLAYER', 12);
755
+define('MARKET_INFO_WRONG', 11);
756 756
 define('MARKET_INFO_PLAYER_NOT_FOUND', 13);
757
-define('MARKET_INFO_PLAYER_WRONG'    , 14);
758
-define('MARKET_INFO_PLAYER_SAME'     , 15);
757
+define('MARKET_INFO_PLAYER_WRONG', 14);
758
+define('MARKET_INFO_PLAYER_SAME', 15);
759 759
 
760 760
 
761 761
 
762 762
 
763 763
 // *** Mercenary/talent bonus types
764
-define('BONUS_NONE'    ,            0);  // No bonus
765
-define('BONUS_PERCENT' ,            1);  // Percent on base value
766
-define('BONUS_ADD'     ,            2);  // Add
767
-define('BONUS_ABILITY' ,            3);  // Some ability
768
-define('BONUS_MULTIPLY',            4);  // Multiply by value
764
+define('BONUS_NONE', 0); // No bonus
765
+define('BONUS_PERCENT', 1); // Percent on base value
766
+define('BONUS_ADD', 2); // Add
767
+define('BONUS_ABILITY', 3); // Some ability
768
+define('BONUS_MULTIPLY', 4); // Multiply by value
769 769
 //define('BONUS_PERCENT_CUMULATIVE' , 5);  // Cumulative percent on base value
770 770
 //define('BONUS_PERCENT_DEGRADED' ,   6);  // Bonus amount degraded with increase as pow(bonus, level) (?)
771 771
 //define('BONUS_SPEED',               7);  // Speed bonus
772 772
 
773 773
 // *** Action constant (build should be replaced with ACTION)
774
-define('BUILD_CREATE' ,  1);
774
+define('BUILD_CREATE', 1);
775 775
 define('BUILD_DESTROY', -1);
776 776
 define('BUILD_AUTOCONVERT', 2);
777 777
 
778
-define('ACTION_SELL'       , -1);
779
-define('ACTION_NOTHING'    ,  0);
780
-define('ACTION_BUY'        ,  1);
781
-define('ACTION_USE'        ,  2);
782
-define('ACTION_DELETE'     ,  3);
778
+define('ACTION_SELL', -1);
779
+define('ACTION_NOTHING', 0);
780
+define('ACTION_BUY', 1);
781
+define('ACTION_USE', 2);
782
+define('ACTION_DELETE', 3);
783 783
 
784 784
 // *** Check unit availability codes
785
-define('BUILD_ALLOWED'         , 0); // HARDCODED! DO NOT CHANGE!
785
+define('BUILD_ALLOWED', 0); // HARDCODED! DO NOT CHANGE!
786 786
 define('BUILD_REQUIRE_NOT_MEET', 1);
787
-define('BUILD_AMOUNT_WRONG'    , 2);
788
-define('BUILD_QUE_WRONG'       , 3);
789
-define('BUILD_QUE_UNIT_WRONG'  , 4);
790
-define('BUILD_INDESTRUCTABLE'  , 5);
791
-define('BUILD_NO_RESOURCES'    , 6);
792
-define('BUILD_NO_UNITS'        , 7);
793
-define('BUILD_UNIT_BUSY'       , 8);
794
-define('BUILD_QUE_FULL'        , 9);
795
-define('BUILD_SILO_FULL'       ,10);
796
-define('BUILD_MAX_REACHED'     ,11);
797
-define('BUILD_SECTORS_NONE'    ,12);
787
+define('BUILD_AMOUNT_WRONG', 2);
788
+define('BUILD_QUE_WRONG', 3);
789
+define('BUILD_QUE_UNIT_WRONG', 4);
790
+define('BUILD_INDESTRUCTABLE', 5);
791
+define('BUILD_NO_RESOURCES', 6);
792
+define('BUILD_NO_UNITS', 7);
793
+define('BUILD_UNIT_BUSY', 8);
794
+define('BUILD_QUE_FULL', 9);
795
+define('BUILD_SILO_FULL', 10);
796
+define('BUILD_MAX_REACHED', 11);
797
+define('BUILD_SECTORS_NONE', 12);
798 798
 define('BUILD_AUTOCONVERT_AVAILABLE', 13);
799 799
 
800 800
 
801 801
 // *** Que types
802 802
 define('QUE_STRUCTURES', 1);
803
-define('QUE_HANGAR'    , 4);
804
-define('QUE_RESEARCH'  , 7);
805
-define('QUE_MERCENARY' , 600); // UNIT_MERCENARIES
803
+define('QUE_HANGAR', 4);
804
+define('QUE_RESEARCH', 7);
805
+define('QUE_MERCENARY', 600); // UNIT_MERCENARIES
806 806
 // *** Subque types
807
-define('SUBQUE_PLANET'  , 1);
808
-define('SUBQUE_MOON'    , 3);
809
-define('SUBQUE_FLEET'   , 4);
810
-define('SUBQUE_DEFENSE' , 6);
807
+define('SUBQUE_PLANET', 1);
808
+define('SUBQUE_MOON', 3);
809
+define('SUBQUE_FLEET', 4);
810
+define('SUBQUE_DEFENSE', 6);
811 811
 define('SUBQUE_RESEARCH', 7);
812 812
 
813 813
 // *** Que items
814
-define('QI_UNIT_ID'   , 0);
815
-define('QI_AMOUNT'    , 1);
816
-define('QI_TIME'      , 2);
817
-define('QI_MODE'      , 3);
818
-define('QI_QUE_ID'    , 4);
819
-define('QI_QUE_TYPE'  , 4);
820
-define('QI_PLANET_ID' , 5);
814
+define('QI_UNIT_ID', 0);
815
+define('QI_AMOUNT', 1);
816
+define('QI_TIME', 2);
817
+define('QI_MODE', 3);
818
+define('QI_QUE_ID', 4);
819
+define('QI_QUE_TYPE', 4);
820
+define('QI_PLANET_ID', 5);
821 821
 
822 822
 
823 823
 // *** Units
824 824
 
825 825
 // *** Sort options
826
-define('SORT_ASCENDING' , 0);
826
+define('SORT_ASCENDING', 0);
827 827
 define('SORT_DESCENDING', 1);
828 828
 
829
-define('SORT_ID'             , 0);
830
-define('SORT_LOCATION'       , 1);
831
-define('SORT_NAME'           , 2);
832
-define('SORT_SIZE'           , 3);
833
-define('SORT_EMAIL'          , 4);
834
-define('SORT_IP'             , 5);
829
+define('SORT_ID', 0);
830
+define('SORT_LOCATION', 1);
831
+define('SORT_NAME', 2);
832
+define('SORT_SIZE', 3);
833
+define('SORT_EMAIL', 4);
834
+define('SORT_IP', 5);
835 835
 define('SORT_TIME_REGISTERED', 6);
836 836
 define('SORT_TIME_LAST_VISIT', 7);
837
-define('SORT_TIME_BAN_UNTIL' , 8);
838
-define('SORT_REFERRAL_COUNT' , 9);
839
-define('SORT_REFERRAL_DM'    , 10);
840
-define('SORT_VACATION'       , 11);
837
+define('SORT_TIME_BAN_UNTIL', 8);
838
+define('SORT_REFERRAL_COUNT', 9);
839
+define('SORT_REFERRAL_DM', 10);
840
+define('SORT_VACATION', 11);
841 841
 
842 842
 
843 843
 define('HULL_SIZE_TINY', 1);
@@ -991,10 +991,10 @@  discard block
 block discarded – undo
991 991
 
992 992
 // === Artifacts
993 993
 define('UNIT_ARTIFACTS', 1000);
994
-define('ART_LHC', 1001);      // Additional moon chance
995
-define('ART_RCD_SMALL', 1002);   // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
996
-define('ART_RCD_MEDIUM', 1003);  // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
997
-define('ART_RCD_LARGE', 1004);   // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
994
+define('ART_LHC', 1001); // Additional moon chance
995
+define('ART_RCD_SMALL', 1002); // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
996
+define('ART_RCD_MEDIUM', 1003); // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
997
+define('ART_RCD_LARGE', 1004); // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
998 998
 define('ART_HEURISTIC_CHIP', 1005); // Speed up research
999 999
 define('ART_NANO_BUILDER', 1006); // Speed up building
1000 1000
 define('ART_NANO_CONSTRUCTOR', 1007); // RESERVED Speed up hangar constructions
@@ -1068,21 +1068,21 @@  discard block
 block discarded – undo
1068 1068
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE1', 2201); // Блиц-сервер, участник 0-го раунда, 1-е место
1069 1069
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE2', 2202); // Блиц-сервер, участник 0-го раунда, 2-е место
1070 1070
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE3', 2203); // Блиц-сервер, участник 0-го раунда, 3-е место
1071
-define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204);  // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1072
-define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_BEST', 2205);  // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2017 года
1073
-define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_QUEEN', 2206);  // Медаль Королевы Весны за максимум полученной ММ/максимум полученных подарков от Мужчины во время ивента 8 марта 2017 года
1071
+define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1072
+define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_BEST', 2205); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2017 года
1073
+define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_QUEEN', 2206); // Медаль Королевы Весны за максимум полученной ММ/максимум полученных подарков от Мужчины во время ивента 8 марта 2017 года
1074 1074
 
1075 1075
 define('UNIT_AWARD_MEMORY', 2300); // Памятные знаки за существование и участие - например "4 года в игре". "Был онлайн в новогоднюю ночь 2013". итд
1076
-define('UNIT_AWARD_MEMORY_IMMORTAL', 2301);  // Бессмертный
1077
-define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1076
+define('UNIT_AWARD_MEMORY_IMMORTAL', 2301); // Бессмертный
1077
+define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1078 1078
 define('UNIT_AWARD_MEMORY_BLITZ_R0', 2303); // Блиц-сервер, участник 0-го раунда
1079 1079
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SIMPLE', 2304); // День Рождения СН
1080 1080
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_BRONZE', 2305); // День Рождения СН
1081 1081
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SILVER', 2306); // День Рождения СН
1082 1082
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_GOLD', 2307); // День Рождения СН
1083 1083
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_PLATINUM', 2308); // День Рождения СН
1084
-define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1085
-define('UNIT_AWARD_MEMORY_2017_WOMEN_DAY', 2310);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2017 года
1084
+define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1085
+define('UNIT_AWARD_MEMORY_2017_WOMEN_DAY', 2310); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2017 года
1086 1086
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_SIMPLE', 2311); // День Рождения СН - 2017
1087 1087
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_BRONZE', 2312); // День Рождения СН - 2017
1088 1088
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_SILVER', 2313); // День Рождения СН - 2017
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
 define('UNIT_AWARD_MEMORY_NEW_YEAR_2018_SIMPLE', 2326); // СуперНовый Год - 2018
1105 1105
 define('UNIT_AWARD_MEMORY_NEW_YEAR_2018_BRONZE', 2327); // СуперНовый Год - 2018
1106 1106
 define('UNIT_AWARD_MEMORY_NEW_YEAR_2018_SILVER', 2328); // СуперНовый Год - 2018
1107
-define('UNIT_AWARD_MEMORY_NEW_YEAR_2018_GOLD',   2329); // СуперНовый Год - 2018
1107
+define('UNIT_AWARD_MEMORY_NEW_YEAR_2018_GOLD', 2329); // СуперНовый Год - 2018
1108 1108
 define('UNIT_AWARD_MEMORY_NEW_YEAR_2018_PLATINUM', 2330); // СуперНовый Год - 2018
1109 1109
 define('UNIT_AWARD_MEMORY_NEW_YEAR_2018_DIAMOND', 2331); // СуперНовый Год - 2018
1110 1110
 
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
 define('UNIT_FLEET_PLANET_SPY', 'UNIT_FLEET_PLANET_SPY');
1239 1239
 
1240 1240
 
1241
-define('GROUP_PART',         800000);
1241
+define('GROUP_PART', 800000);
1242 1242
 // Зарезервировано для запчастей: 800.001 - 899.999
1243 1243
 // define('GROUP_PART_HULL',    801000); // Корпуса - 1000 штук
1244 1244
 // define('GROUP_PART_ARMOR',   802000); // Броня - 1000 штук
@@ -1566,35 +1566,35 @@  discard block
 block discarded – undo
1566 1566
 
1567 1567
 
1568 1568
 // define('NICK_ID',               -1);
1569
-define('NICK_HTML',              0);
1570
-
1571
-define('NICK_FIRST',             1);
1572
-define('NICK_RACE',           1000);
1573
-define('NICK_GENDER',         2000);
1574
-define('NICK_AWARD',          3000);
1575
-define('NICK_VACATION',       3500);
1576
-define('NICK_BIRTHDAY',       4000);
1577
-define('NICK_RANK',           4500);
1578
-define('NICK_RANK_NO_TEXT',   4750);
1579
-define('NICK_PREMIUM',        5000);
1580
-define('NICK_AUTH_LEVEL',     6000);
1581
-
1582
-define('NICK_HIGHLIGHT',      6300);
1583
-define('NICK_CLASS',          6450);
1584
-
1585
-define('NICK_NICK_CLASS',     6600);
1586
-define('NICK_NICK',           7000);
1569
+define('NICK_HTML', 0);
1570
+
1571
+define('NICK_FIRST', 1);
1572
+define('NICK_RACE', 1000);
1573
+define('NICK_GENDER', 2000);
1574
+define('NICK_AWARD', 3000);
1575
+define('NICK_VACATION', 3500);
1576
+define('NICK_BIRTHDAY', 4000);
1577
+define('NICK_RANK', 4500);
1578
+define('NICK_RANK_NO_TEXT', 4750);
1579
+define('NICK_PREMIUM', 5000);
1580
+define('NICK_AUTH_LEVEL', 6000);
1581
+
1582
+define('NICK_HIGHLIGHT', 6300);
1583
+define('NICK_CLASS', 6450);
1584
+
1585
+define('NICK_NICK_CLASS', 6600);
1586
+define('NICK_NICK', 7000);
1587 1587
 define('NICK_NICK_CLASS_END', 7300);
1588 1588
 
1589
-define('NICK_ALLY_CLASS',     7600);
1590
-define('NICK_ALLY',           8000);
1589
+define('NICK_ALLY_CLASS', 7600);
1590
+define('NICK_ALLY', 8000);
1591 1591
 define('NICK_ALLY_CLASS_END', 8300);
1592 1592
 
1593
-define('NICK_CLASS_END',      8450);
1594
-define('NICK_HIGHLIGHT_END',  8600);
1593
+define('NICK_CLASS_END', 8450);
1594
+define('NICK_HIGHLIGHT_END', 8600);
1595 1595
 
1596
-define('NICK_LAST',           9999);
1597
-define('NICK_SORT',          10000);
1596
+define('NICK_LAST', 9999);
1597
+define('NICK_SORT', 10000);
1598 1598
 
1599 1599
 // Настройки игрока
1600 1600
 define('PLAYER_OPTION_MENU_SORT', 1);
@@ -1696,8 +1696,8 @@  discard block
 block discarded – undo
1696 1696
 define('LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10', 1);
1697 1697
 
1698 1698
 define('BLITZ_REGISTER_DISABLED', 0);
1699
-define('BLITZ_REGISTER_OPEN'    , 1);
1700
-define('BLITZ_REGISTER_CLOSED'  , 2);
1699
+define('BLITZ_REGISTER_OPEN', 1);
1700
+define('BLITZ_REGISTER_CLOSED', 2);
1701 1701
 define('BLITZ_REGISTER_SHOW_LOGIN', 3);
1702 1702
 define('BLITZ_REGISTER_DISCLOSURE_NAMES', 4);
1703 1703
 
Please login to merge, or discard this patch.
includes/general/nickRender.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
 
273 273
   if (($options === true || isset($options['icons']) || isset($options['birthday'])) && (date('Y', SN_TIME_NOW) . date('-m-d', strtotime($render_user['user_birthday'])) == date('Y-m-d', SN_TIME_NOW))) {
274
-    if(!empty($render_user['user_birthday'])) {
274
+    if (!empty($render_user['user_birthday'])) {
275 275
       $result[NICK_BIRTHDAY] = '';
276 276
     }
277 277
   }
@@ -283,13 +283,13 @@  discard block
 block discarded – undo
283 283
   }
284 284
 
285 285
   if (($options === true || (isset($options['icons']) && $options['icons']) || (isset($options['vacancy']) && $options['vacancy'])) && $render_user['vacation']) {
286
-    if(isset($render_user['vacation'])) {
286
+    if (isset($render_user['vacation'])) {
287 287
       $result[NICK_VACATION] = $render_user['vacation'];
288 288
     }
289 289
   }
290 290
 
291 291
   if ($options === true || !empty($options['icons']) || !empty($options['player_rank'])) {
292
-    if(isset($render_user['total_points'])) {
292
+    if (isset($render_user['total_points'])) {
293 293
       $result[NICK_RANK] = classSupernova::$gc->playerLevelHelper->getPointLevel($render_user['total_points'], $render_user['authlevel']);
294 294
     }
295 295
   }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
   }
314 314
 
315 315
   if ($render_user['ally_tag'] && ($options === true || (isset($options['ally']) && $options['ally']))) {
316
-    if(isset($render_user['ally_tag'])) {
316
+    if (isset($render_user['ally_tag'])) {
317 317
       $result[NICK_ALLY] = $render_user['ally_tag'];
318 318
     }
319 319
   }
Please login to merge, or discard this patch.
classes/Player/PlayerLevelHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
     $levelPoints = $this->valueStorage->getValue(UNIT_SERVER_FLEET_NOOB_POINTS);
140 140
     !$levelPoints ? $levelPoints = 5000 * $this->valueStorage->getValue(UNIT_SERVER_SPEED_MINING) : false;
141 141
 
142
-    for($level = 0; $level <= PLAYER_RANK_MAX; $level++) {
142
+    for ($level = 0; $level <= PLAYER_RANK_MAX; $level++) {
143 143
       $this->playerLevels[$level] = $levelPoints;
144 144
       $levelPoints *= $multiplier;
145 145
     }
Please login to merge, or discard this patch.
classes/userOptions.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 
135 135
     $update_cache = false;
136 136
 
137
-    if(!empty($this->to_write)) {
138
-      foreach($this->to_write as $key => $cork) {
137
+    if (!empty($this->to_write)) {
138
+      foreach ($this->to_write as $key => $cork) {
139 139
         $value = is_array($this->data[$key]) ? serialize($this->data[$key]) : $this->data[$key]; // Сериализация для массивов при сохранении в БД
140 140
         $this->to_write[$key] = "({$this->user_id}, '" . db_escape($key) . "', '" . db_escape($value) . "')";
141 141
       }
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
       $update_cache = true;
147 147
     }
148 148
 
149
-    if(!empty($this->to_delete)) {
150
-      foreach($this->to_delete as $key => &$value) {
151
-        $value = is_string($key) ? "'". db_escape($key) . "'" : $key;
149
+    if (!empty($this->to_delete)) {
150
+      foreach ($this->to_delete as $key => &$value) {
151
+        $value = is_string($key) ? "'" . db_escape($key) . "'" : $key;
152 152
       }
153 153
 
154
-      doquery("DELETE FROM `{{player_options}}` WHERE `player_id` = {$this->user_id} AND `option_id` IN (". implode(',', $this->to_delete) . ") ");
154
+      doquery("DELETE FROM `{{player_options}}` WHERE `player_id` = {$this->user_id} AND `option_id` IN (" . implode(',', $this->to_delete) . ") ");
155 155
 
156 156
       $this->to_delete = array();
157 157
       $update_cache = true;
158 158
     }
159 159
 
160
-    if($update_cache) {
160
+    if ($update_cache) {
161 161
       global $sn_cache;
162 162
 
163 163
       $field_name = $this->cached_name();
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
   protected function load($forceLoad = false) {
185 185
     global $sn_cache;
186 186
 
187
-    if($this->loaded) {
187
+    if ($this->loaded) {
188 188
       return;
189 189
     }
190 190
 
@@ -192,23 +192,23 @@  discard block
 block discarded – undo
192 192
     $this->to_write = array();
193 193
     $this->to_delete = array();
194 194
 
195
-    if(!$this->user_id) {
195
+    if (!$this->user_id) {
196 196
       $this->loaded = true;
197 197
       return;
198 198
     }
199 199
 
200 200
     $field_name = $this->cached_name();
201
-    if(!$forceLoad) {
201
+    if (!$forceLoad) {
202 202
       $a_data = $sn_cache->$field_name;
203 203
 
204
-      if(!empty($a_data)) {
204
+      if (!empty($a_data)) {
205 205
         $this->data = array_replace_recursive($this->data, $a_data);
206 206
         return;
207 207
       }
208 208
     }
209 209
 
210 210
     $query = doquery("SELECT * FROM `{{player_options}}` WHERE `player_id` = {$this->user_id} FOR UPDATE");
211
-    while($row = db_fetch($query)) {
211
+    while ($row = db_fetch($query)) {
212 212
       // $this->data[$row['option_id']] = $row['value'];
213 213
       $this->data[$row['option_id']] = is_string($row['value']) && ($temp = unserialize($row['value'])) !== false ? $temp : $row['value']; // Десериализация
214 214
     }
Please login to merge, or discard this patch.
language/ru/buildings.mo.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@
 block discarded – undo
24 24
 * DO NOT CHANGE
25 25
 */
26 26
 
27
-if (!defined('INSIDE')) die();
27
+if (!defined('INSIDE')) {
28
+  die();
29
+}
28 30
 
29 31
 $a_lang_array = array(
30 32
   'built' => 'Построено',
Please login to merge, or discard this patch.
language/en/buildings.mo.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@
 block discarded – undo
26 26
 * DO NOT CHANGE
27 27
 */
28 28
 
29
-if (!defined('INSIDE')) die();
29
+if (!defined('INSIDE')) {
30
+  die();
31
+}
30 32
 
31 33
 
32 34
 $a_lang_array = array(
Please login to merge, or discard this patch.