Completed
Push — work-fleets ( ab257a...4117d7 )
by SuperNova.WS
05:11
created
galaxy.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 $uni_system = sys_get_param_int('system', $planetrow['system']);
17 17
 $planet = sys_get_param_int('planet', $planetrow['planet']);
18 18
 
19
-if($mode == 'name') {
19
+if ($mode == 'name') {
20 20
   require_once('includes/includes/uni_rename.php');
21 21
 }
22 22
 
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 
38 38
 $flying_fleet_count = FleetList::fleet_count_flying($user['id']);
39 39
 
40
-if($mode == 1) {
41
-} elseif($mode == 2 || $mode == 3) {
40
+if ($mode == 1) {
41
+} elseif ($mode == 2 || $mode == 3) {
42 42
   $planet = $planetrow['planet'];
43 43
 } else {
44 44
   $uni_galaxy = $planetrow['galaxy'];
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
   $planet = $planetrow['planet'];
47 47
 }
48 48
 
49
-$uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > Vector::$knownGalaxies? Vector::$knownGalaxies: $uni_galaxy);
49
+$uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > Vector::$knownGalaxies ? Vector::$knownGalaxies : $uni_galaxy);
50 50
 $uni_system = $uni_system < 1 ? 1 : ($uni_system > Vector::$knownSystems ? Vector::$knownSystems : $uni_system);
51 51
 $planet = $planet < 1 ? 1 : ($planet > Vector::$knownPlanets + 1 ? Vector::$knownPlanets + 1 : $planet);
52 52
 
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 $PhalanxRange = GetPhalanxRange($HavePhalanx);
65 65
 
66 66
 $planet_precache_query = db_planet_list_in_system($uni_galaxy, $uni_system);
67
-if(!empty($planet_precache_query)) {
68
-  foreach($planet_precache_query as $planet_row) {
67
+if (!empty($planet_precache_query)) {
68
+  foreach ($planet_precache_query as $planet_row) {
69 69
     $planet_list[$planet_row['planet']][$planet_row['planet_type']] = $planet_row;
70 70
   }
71 71
 }
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
  * @var Fleet[][][] $fleet_list
84 84
  */
85 85
 $fleet_list = array();
86
-foreach($system_fleet_list->_container as $objFleetSystem) {
87
-  if(!$objFleetSystem->isReturning()) {
86
+foreach ($system_fleet_list->_container as $objFleetSystem) {
87
+  if (!$objFleetSystem->isReturning()) {
88 88
     $fleet_planet = $objFleetSystem->fleet_end_planet;
89 89
     $fleet_type = $objFleetSystem->fleet_end_type;
90 90
   } else {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 $recycler_info = array();
100 100
 $planet_recyclers_orbiting = 0;
101 101
 $recyclers_fleet = array();
102
-foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
102
+foreach (sn_get_groups('flt_recyclers') as $recycler_id) {
103 103
   $recycler_info[$recycler_id] = get_ship_data($recycler_id, $user);
104 104
   $recyclers_fleet[$recycler_id] = mrc_get_level($user, $planetrow, $recycler_id);
105 105
   $planet_recyclers_orbiting += $recyclers_fleet[$recycler_id];
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 $fleet_id = 1;
110 110
 $fleets = array();
111 111
 $config_game_max_planet = Vector::$knownPlanets + 1;
112
-for($Planet = 1; $Planet < $config_game_max_planet; $Planet++) {
112
+for ($Planet = 1; $Planet < $config_game_max_planet; $Planet++) {
113 113
   unset($uni_galaxyRowPlanet);
114 114
   unset($uni_galaxyRowMoon);
115 115
   unset($uni_galaxyRowUser);
@@ -119,27 +119,27 @@  discard block
 block discarded – undo
119 119
   $uni_galaxyRowPlanet = $planet_list[$Planet][PT_PLANET];
120 120
 
121 121
   $planet_fleet_id = 0;
122
-  if($uni_galaxyRowPlanet['destruyed']) {
122
+  if ($uni_galaxyRowPlanet['destruyed']) {
123 123
     CheckAbandonPlanetState($uni_galaxyRowPlanet);
124
-  } elseif($uni_galaxyRowPlanet['id']) {
125
-    if($cached['users'][$uni_galaxyRowPlanet['id_owner']]) {
124
+  } elseif ($uni_galaxyRowPlanet['id']) {
125
+    if ($cached['users'][$uni_galaxyRowPlanet['id_owner']]) {
126 126
       $uni_galaxyRowUser = $cached['users'][$uni_galaxyRowPlanet['id_owner']];
127 127
     } else {
128 128
       $uni_galaxyRowUser = db_user_by_id($uni_galaxyRowPlanet['id_owner']);
129 129
       $cached['users'][$uni_galaxyRowUser['id']] = $uni_galaxyRowUser;
130 130
     }
131 131
 
132
-    if(!$uni_galaxyRowUser['id']) {
132
+    if (!$uni_galaxyRowUser['id']) {
133 133
       $debug->warning("Planet '{$uni_galaxyRowPlanet['name']}' [{$uni_galaxy}:{$uni_system}:{$Planet}] has no owner!", 'Userless planet', 503);
134 134
       $uni_galaxyRowPlanet['destruyed'] = SN_TIME_NOW + 60 * 60 * 24;
135 135
       $uni_galaxyRowPlanet['id_owner'] = 0;
136 136
       db_planet_set_by_id($uni_galaxyRowPlanet['id'], "id_owner = 0, destruyed = {$uni_galaxyRowPlanet['destruyed']}");
137 137
     }
138 138
 
139
-    if($uni_galaxyRowUser['id']) {
139
+    if ($uni_galaxyRowUser['id']) {
140 140
       $planetcount++;
141
-      if($uni_galaxyRowUser['ally_id']) {
142
-        if($cached['allies'][$uni_galaxyRowUser['ally_id']]) {
141
+      if ($uni_galaxyRowUser['ally_id']) {
142
+        if ($cached['allies'][$uni_galaxyRowUser['ally_id']]) {
143 143
           $allyquery = $cached['allies'][$uni_galaxyRowUser['ally_id']];
144 144
         } else {
145 145
           $allyquery = db_ally_get_by_id($uni_galaxyRowUser['ally_id']);
@@ -148,19 +148,19 @@  discard block
 block discarded – undo
148 148
       }
149 149
 
150 150
       $fleets_to_planet = flt_get_fleets_to_planet_by_array_of_Fleet($fleet_list[$Planet][PT_PLANET]);
151
-      if(!empty($fleets_to_planet['own']['count'])) {
151
+      if (!empty($fleets_to_planet['own']['count'])) {
152 152
         $planet_fleet_id = $fleet_id;
153 153
         $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id);
154 154
         $fleet_id++;
155 155
       }
156 156
 
157 157
       $uni_galaxyRowMoon = $planet_list[$Planet][PT_MOON];
158
-      if($uni_galaxyRowMoon['destruyed']) {
158
+      if ($uni_galaxyRowMoon['destruyed']) {
159 159
         CheckAbandonPlanetState($uni_galaxyRowMoon);
160 160
       } else {
161 161
         $moon_fleet_id = 0;
162 162
         $fleets_to_planet = flt_get_fleets_to_planet_by_array_of_Fleet($fleet_list[$Planet][PT_MOON]);
163
-        if(!empty($fleets_to_planet['own']['count'])) {
163
+        if (!empty($fleets_to_planet['own']['count'])) {
164 164
           $moon_fleet_id = $fleet_id;
165 165
           $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id);
166 166
           $fleet_id++;
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 
172 172
   $recyclers_incoming_capacity = 0;
173 173
   $uni_galaxyRowPlanet['debris'] = $uni_galaxyRowPlanet['debris_metal'] + $uni_galaxyRowPlanet['debris_crystal'];
174
-  if($uni_galaxyRowPlanet['debris']) {
175
-    if(!empty($fleet_list[$Planet][PT_DEBRIS])) {
176
-      foreach($fleet_list[$Planet][PT_DEBRIS] as $objFleetToDebris) {
177
-        if($objFleetToDebris->playerOwnerId == $user['id']) {
174
+  if ($uni_galaxyRowPlanet['debris']) {
175
+    if (!empty($fleet_list[$Planet][PT_DEBRIS])) {
176
+      foreach ($fleet_list[$Planet][PT_DEBRIS] as $objFleetToDebris) {
177
+        if ($objFleetToDebris->playerOwnerId == $user['id']) {
178 178
           $recyclers_incoming_capacity += $objFleetToDebris->shipsGetCapacityRecyclers($recycler_info);
179 179
         }
180 180
       }
@@ -251,21 +251,21 @@  discard block
 block discarded – undo
251 251
 
252 252
 tpl_assign_fleet($template, $fleets);
253 253
 
254
-foreach(sn_get_groups('defense_active') as $unit_id) {
254
+foreach (sn_get_groups('defense_active') as $unit_id) {
255 255
   $template->assign_block_vars('defense_active', array(
256 256
     'ID'   => $unit_id,
257 257
     'NAME' => classLocale::$lang['tech'][$unit_id],
258 258
   ));
259 259
 }
260 260
 
261
-foreach($cached['users'] as $PlanetUser) {
262
-  if(!$PlanetUser) {
261
+foreach ($cached['users'] as $PlanetUser) {
262
+  if (!$PlanetUser) {
263 263
     continue;
264 264
   }
265 265
 
266 266
   $user_ally = $cached['allies'][$PlanetUser['ally_id']];
267
-  if(isset($user_ally)) {
268
-    if($PlanetUser['id'] == $user_ally['ally_owner']) {
267
+  if (isset($user_ally)) {
268
+    if ($PlanetUser['id'] == $user_ally['ally_owner']) {
269 269
       $user_rank_title = $user_ally['ally_owner_range'];
270 270
     } else {
271 271
       $ally_ranks = explode(';', $user_ally['ranklist']);
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
   ));
289 289
 }
290 290
 
291
-foreach($cached['allies'] as $PlanetAlly) {
292
-  if($PlanetAlly) {
291
+foreach ($cached['allies'] as $PlanetAlly) {
292
+  if ($PlanetAlly) {
293 293
     $template->assign_block_vars('alliances', array(
294 294
       'ID'      => $PlanetAlly['id'],
295 295
       'NAME_JS' => js_safe_string($PlanetAlly['ally_name']),
Please login to merge, or discard this patch.
includes/includes/uni_rename.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
     $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']);
12 12
     $uni_system = sys_get_param_int('system');
13 13
 
14
-    if($uni_galaxy < 1 || $uni_galaxy > Vector::$knownGalaxies)
14
+    if ($uni_galaxy < 1 || $uni_galaxy > Vector::$knownGalaxies)
15 15
     {
16 16
       throw new exception(classLocale::$lang['uni_msg_error_wrong_galaxy'], ERR_ERROR);
17 17
     }
18 18
 
19
-    if($uni_system < 0 || $uni_system > Vector::$knownSystems)
19
+    if ($uni_system < 0 || $uni_system > Vector::$knownSystems)
20 20
     {
21 21
       throw new exception(classLocale::$lang['uni_msg_error_wrong_system'], ERR_ERROR);
22 22
     }
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
     $uni_row['universe_price'] += $uni_system ? classSupernova::$config->uni_price_system : classSupernova::$config->uni_price_galaxy;
26 26
     $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$classLocale['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$classLocale['sys_galaxy']} {$uni_galaxy}"));
27 27
 
28
-    if(sys_get_param_str('uni_name_submit'))
28
+    if (sys_get_param_str('uni_name_submit'))
29 29
     {
30 30
       $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name'));
31 31
 
32 32
       $uni_price = sys_get_param_float('uni_price');
33
-      if($uni_price < $uni_row['universe_price'])
33
+      if ($uni_price < $uni_row['universe_price'])
34 34
       {
35 35
         throw new exception(classLocale::$lang['uni_msg_error_low_price'], ERR_ERROR);
36 36
       }
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
       sn_db_transaction_start();
40 40
       $user = db_user_by_id($user['id'], true);
41 41
       // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price)
42
-      if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price)
42
+      if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price)
43 43
       {
44 44
         throw new exception(classLocale::$lang['uni_msg_error_no_dm'], ERR_ERROR);
45 45
       }
46 46
 
47
-      if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name')))
47
+      if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name')))
48 48
       {
49 49
         throw new exception(classLocale::$lang['sys_msg_err_update_dm'], ERR_ERROR);
50 50
       }
Please login to merge, or discard this patch.
includes/includes/flt_page5.inc 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 *
13 13
 **/
14 14
 
15
-if(SN_IN_FLEET !== true) {
15
+if (SN_IN_FLEET !== true) {
16 16
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
17 17
 }
18 18
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
   $planet_list = array();
27 27
 
28
-  if(is_array($resources_taken))
28
+  if (is_array($resources_taken))
29 29
   {
30 30
     $query = implode(',', array_keys($resources_taken));
31 31
     $query = " AND `destruyed` = 0 AND `id` IN ({$query})";
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
     $query = '';
34 34
   }
35 35
 
36
-  foreach(sn_get_groups('flt_transports') as $transport_id) {
36
+  foreach (sn_get_groups('flt_transports') as $transport_id) {
37 37
     $transports[$transport_id] = get_unit_param($transport_id, P_CAPACITY);
38 38
   }
39 39
   arsort($transports);
40 40
 
41 41
   $planets_db_list = db_planet_list_sorted($user, $planetrow['id'], '*', $query);
42 42
   !is_array($planets_db_list) ? $planets_db_list = array() : false;
43
-  foreach($planets_db_list as $planet_db_data) {
43
+  foreach ($planets_db_list as $planet_db_data) {
44 44
   // begin planet loop
45
-    if(!$query) {
45
+    if (!$query) {
46 46
       $resources_taken[$planet_db_data['id']] = 1;
47 47
     }
48 48
     sn_db_transaction_start();
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     $planet_id = $planet_db_data['id'];
55 55
 
56 56
     $planet_resources = 0;
57
-    foreach(sn_get_groups('resources_loot') as $resource_id) {
58
-      if($resources_taken[$planet_id] == 1 || $resources_taken[$planet_id][$resource_id]) {
57
+    foreach (sn_get_groups('resources_loot') as $resource_id) {
58
+      if ($resources_taken[$planet_id] == 1 || $resources_taken[$planet_id][$resource_id]) {
59 59
         $planet_resources += floor(mrc_get_level($user, $planet_db_data, $resource_id, true, true)); // $planet_db_data[get_unit_param($resource_id, P_NAME)]);
60 60
       }
61 61
     }
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
     $fleet_capacity = 0;
87 87
     $ship_loadout = array();
88 88
     $fleet = array();
89
-    foreach($transports as $ship_id => $ship_capacity) {
90
-      if($ship_count = mrc_get_level($user, $planet_db_data, $ship_id, true, true)) {
89
+    foreach ($transports as $ship_id => $ship_capacity) {
90
+      if ($ship_count = mrc_get_level($user, $planet_db_data, $ship_id, true, true)) {
91 91
         $ship_loadout[$ship_id]['capacity'] = $ship_count * $ship_capacity;
92 92
         $ship_loadout[$ship_id]['taken'] = 0;
93 93
         $fleet_capacity += $ship_loadout[$ship_id]['capacity'];
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
     $will_take = min($planet_resources, $fleet_capacity);
100 100
 
101
-    foreach($ship_loadout as $ship_id => &$planet_ship) {
101
+    foreach ($ship_loadout as $ship_id => &$planet_ship) {
102 102
       $can_take = min($will_take, $planet_ship['capacity']);
103
-      if($can_take <= 0) {
103
+      if ($can_take <= 0) {
104 104
         continue;
105 105
       }
106 106
       $planet_ship['capacity'] -= $can_take;
@@ -108,23 +108,23 @@  discard block
 block discarded – undo
108 108
       $fleet[$ship_id] = ceil($planet_ship['taken'] / $transports[$ship_id]);
109 109
 
110 110
       $will_take -= $can_take;
111
-      if($will_take <= 0) {
111
+      if ($will_take <= 0) {
112 112
         break;
113 113
       }
114 114
     }
115 115
 
116
-    if(!empty($fleet)) {
116
+    if (!empty($fleet)) {
117 117
       $travel_data = flt_travel_data($user, $planetrow, $planet_db_data, $fleet, 10);
118 118
       $planet_data['FLEET_SPEED'] = $travel_data['fleet_speed'];
119 119
       $planet_data['DISTANCE']    = $travel_data['distance'];
120 120
       $planet_data['DURATION']    = $travel_data['duration'];
121 121
       $planet_data['CONSUMPTION'] = $travel_data['consumption'];
122 122
 
123
-      if(floor(mrc_get_level($user, $planet_db_data, RES_DEUTERIUM, true)) >= $planet_data['CONSUMPTION']) {
123
+      if (floor(mrc_get_level($user, $planet_db_data, RES_DEUTERIUM, true)) >= $planet_data['CONSUMPTION']) {
124 124
         $will_take = min($planet_resources, $fleet_capacity) - $planet_data['CONSUMPTION'];
125 125
 
126
-        foreach(sn_get_groups('resources_loot') as $resource_id) {
127
-          if($resources_taken[$planet_id] != 1 && !$resources_taken[$planet_id][$resource_id]) {
126
+        foreach (sn_get_groups('resources_loot') as $resource_id) {
127
+          if ($resources_taken[$planet_id] != 1 && !$resources_taken[$planet_id][$resource_id]) {
128 128
             continue;
129 129
           }
130 130
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
           $fleet[$resource_id] = min($will_take, $resource_amount);
134 134
           $will_take -= $resource_amount;
135 135
 
136
-          if($will_take <= 0) {
136
+          if ($will_take <= 0) {
137 137
             break;
138 138
           }
139 139
         }
@@ -157,19 +157,19 @@  discard block
 block discarded – undo
157 157
 
158 158
 $resources_taken = sys_get_param('resources');
159 159
 
160
-if(!empty($resources_taken))  { // begin processing parameters
160
+if (!empty($resources_taken)) { // begin processing parameters
161 161
   $planet_list = flt_build_gathering($resources_taken);
162 162
 
163
-  foreach($planet_list as $planet_id => $planet_data) {
164
-    if($planet_data['RESULT'] == FLIGHT_ALLOWED) {
163
+  foreach ($planet_list as $planet_id => $planet_data) {
164
+    if ($planet_data['RESULT'] == FLIGHT_ALLOWED) {
165 165
       $planet_data['RESULT'] = flt_t_send_fleet($user, $planet_data['PLANET_DB_DATA'], $planetrow, $planet_data['FLEET'], MT_TRANSPORT);
166 166
     }
167 167
 
168 168
     $planet_data['MESSAGE'] = classLocale::$lang['fl_attack_error'][$planet_data['RESULT']];
169 169
 
170 170
     $template->assign_block_vars('results', $planet_data);
171
-    if(!empty($planet_data['FLEET']) && $planet_data['RESULT'] == FLIGHT_ALLOWED) {
172
-      foreach($planet_data['FLEET'] as $unit_id => $amount) {
171
+    if (!empty($planet_data['FLEET']) && $planet_data['RESULT'] == FLIGHT_ALLOWED) {
172
+      foreach ($planet_data['FLEET'] as $unit_id => $amount) {
173 173
         $template->assign_block_vars('results.units', array(
174 174
           'ID'     => $unit_id,
175 175
           'NAME'   => classLocale::$lang['tech'][$unit_id],
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 // Building list of own planets & moons
184 184
 $planet_list = flt_build_gathering();
185
-foreach($planet_list as $planet_data) {
185
+foreach ($planet_list as $planet_data) {
186 186
   $planet_data['DURATION'] = $planet_data['DURATION'] ? pretty_time($planet_data['DURATION']) : classLocale::$lang['flt_no_fuel'];
187 187
   $template->assign_block_vars('colonies', $planet_data);
188 188
 }
Please login to merge, or discard this patch.
includes/includes/flt_functions.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 function flt_fleet_speed($user, $fleet) {
4
-  if(!is_array($fleet)) {
4
+  if (!is_array($fleet)) {
5 5
     $fleet = array($fleet => 1);
6 6
   }
7 7
 
8 8
   $speeds = array();
9
-  if(!empty($fleet)) {
10
-    foreach($fleet as $ship_id => $amount) {
11
-      if($amount && in_array($ship_id, sn_get_groups(array('fleet', 'missile')))) {
9
+  if (!empty($fleet)) {
10
+    foreach ($fleet as $ship_id => $amount) {
11
+      if ($amount && in_array($ship_id, sn_get_groups(array('fleet', 'missile')))) {
12 12
         $single_ship_data = get_ship_data($ship_id, $user);
13 13
         $speeds[] = $single_ship_data['speed'];
14 14
       }
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 
52 52
   $game_fleet_speed = flt_server_flight_speed_multiplier();
53 53
   $fleet_speed = flt_fleet_speed($user_row, $fleet_array);
54
-  if(!empty($fleet_array) && $fleet_speed && $game_fleet_speed) {
54
+  if (!empty($fleet_array) && $fleet_speed && $game_fleet_speed) {
55 55
     $speed_percent = $speed_percent ? max(min($speed_percent, 10), 1) : 10;
56 56
     $real_speed = $speed_percent * sqrt($fleet_speed);
57 57
 
58 58
     $duration = max(1, round((35000 / $speed_percent * sqrt($distance * 10 / $fleet_speed) + 10) / $game_fleet_speed));
59 59
 
60
-    foreach($fleet_array as $ship_id => $ship_count) {
61
-      if(!$ship_id || !$ship_count) {
60
+    foreach ($fleet_array as $ship_id => $ship_count) {
61
+      if (!$ship_id || !$ship_count) {
62 62
         continue;
63 63
       }
64 64
 
@@ -86,19 +86,19 @@  discard block
 block discarded – undo
86 86
 function flt_bashing_check($user, $enemy, $planet_dst, $mission, $flight_duration, $fleet_group = 0) {
87 87
   $config_bashing_attacks = classSupernova::$config->fleet_bashing_attacks;
88 88
   $config_bashing_interval = classSupernova::$config->fleet_bashing_interval;
89
-  if(!$config_bashing_attacks) {
89
+  if (!$config_bashing_attacks) {
90 90
     // Bashing allowed - protection disabled
91 91
     return FLIGHT_ALLOWED;
92 92
   }
93 93
 
94 94
   $bashing_result = FLIGHT_MISSION_ATTACK_BASHING;
95
-  if($user['ally_id'] && $enemy['ally_id']) {
95
+  if ($user['ally_id'] && $enemy['ally_id']) {
96 96
     $relations = ali_relations($user['ally_id'], $enemy['ally_id']);
97
-    if(!empty($relations)) {
97
+    if (!empty($relations)) {
98 98
       $relations = $relations[$enemy['ally_id']];
99
-      switch($relations['alliance_diplomacy_relation']) {
99
+      switch ($relations['alliance_diplomacy_relation']) {
100 100
         case ALLY_DIPLOMACY_WAR:
101
-          if(SN_TIME_NOW - $relations['alliance_diplomacy_time'] <= classSupernova::$config->fleet_bashing_war_delay) {
101
+          if (SN_TIME_NOW - $relations['alliance_diplomacy_time'] <= classSupernova::$config->fleet_bashing_war_delay) {
102 102
             $bashing_result = FLIGHT_MISSION_ATTACK_BASHING_WAR_DELAY;
103 103
           } else {
104 104
             return FLIGHT_ALLOWED;
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 
121 121
   // Retrieving flying fleets
122 122
   $objFleetsBashing = FleetList::dbGetFleetListBashing($user['id'], $planet_dst);
123
-  foreach($objFleetsBashing->_container as $fleetBashing) {
123
+  foreach ($objFleetsBashing->_container as $fleetBashing) {
124 124
     // Checking for ACS - each ACS count only once
125
-    if($fleetBashing->group_id) {
125
+    if ($fleetBashing->group_id) {
126 126
       $bashing_list["{$user['id']}_{$fleetBashing->group_id}"] = $fleetBashing->time_arrive_to_target;
127 127
     } else {
128 128
       $bashing_list[] = $fleetBashing->time_arrive_to_target;
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
   }
131 131
 
132 132
   // Check for joining to ACS - if there are already fleets in ACS no checks should be done
133
-  if($mission == MT_ACS && $bashing_list["{$user['id']}_{$fleet_group}"]) {
133
+  if ($mission == MT_ACS && $bashing_list["{$user['id']}_{$fleet_group}"]) {
134 134
     return FLIGHT_ALLOWED;
135 135
   }
136 136
 
137 137
   $query = db_bashing_list_get($user, $planet_dst, $time_limit);
138
-  while($bashing_row = db_fetch($query)) {
138
+  while ($bashing_row = db_fetch($query)) {
139 139
     $bashing_list[] = $bashing_row['bashing_time'];
140 140
   }
141 141
 
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
   $last_attack = 0;
145 145
   $wave = 0;
146 146
   $attack = 1;
147
-  foreach($bashing_list as &$bash_time) {
147
+  foreach ($bashing_list as &$bash_time) {
148 148
     $attack++;
149
-    if($bash_time - $last_attack > $config_bashing_interval || $attack > $config_bashing_attacks) {
149
+    if ($bash_time - $last_attack > $config_bashing_interval || $attack > $config_bashing_attacks) {
150 150
       $attack = 1;
151 151
       $wave++;
152 152
     }
@@ -163,16 +163,16 @@  discard block
 block discarded – undo
163 163
   //TODO: try..catch
164 164
   global $user;
165 165
 
166
-  if($user['vacation']) {
166
+  if ($user['vacation']) {
167 167
     return $result = FLIGHT_PLAYER_VACATION_OWN;
168 168
   }
169 169
 
170
-  if(empty($fleet) || !is_array($fleet)) {
170
+  if (empty($fleet) || !is_array($fleet)) {
171 171
     return $result = FLIGHT_SHIPS_NO_SHIPS;
172 172
   }
173 173
 
174 174
   $sn_groups_mission = sn_get_groups('missions');
175
-  if(!isset($sn_groups_mission[$mission])) {
175
+  if (!isset($sn_groups_mission[$mission])) {
176 176
     return $result = FLIGHT_MISSION_UNKNOWN;
177 177
   }
178 178
   $sn_data_mission = $sn_groups_mission[$mission];
@@ -191,32 +191,32 @@  discard block
 block discarded – undo
191 191
   $resources = 0;
192 192
   $ship_ids = sn_get_groups('fleet');
193 193
   $resource_ids = sn_get_groups('resources_loot');
194
-  foreach($fleet as $ship_id => $ship_count) {
194
+  foreach ($fleet as $ship_id => $ship_count) {
195 195
     $is_ship = in_array($ship_id, $ship_ids);
196 196
     $is_resource = in_array($ship_id, $resource_ids);
197
-    if(!$is_ship && !$is_resource) {
197
+    if (!$is_ship && !$is_resource) {
198 198
       // TODO Спецобработчик для Капитана и модулей
199 199
 //      return FLIGHT_SHIPS_UNIT_WRONG;
200 200
     }
201 201
 
202
-    if($ship_count < 0) {
202
+    if ($ship_count < 0) {
203 203
       return $result = $is_ship ? FLIGHT_SHIPS_NEGATIVE : FLIGHT_RESOURCES_NEGATIVE;
204 204
     }
205 205
 
206
-    if($ship_count > mrc_get_level($user, $planet_src, $ship_id)) {
206
+    if ($ship_count > mrc_get_level($user, $planet_src, $ship_id)) {
207 207
       // TODO FLIGHT_MISSION_MISSILE_NO_MISSILES
208 208
       return $result = $is_ship ? FLIGHT_SHIPS_NOT_ENOUGH_OR_RESOURCES : FLIGHT_RESOURCES_NOT_ENOUGH;
209 209
     }
210 210
 
211
-    if($is_ship) {
211
+    if ($is_ship) {
212 212
       $single_ship_data = get_ship_data($ship_id, $user);
213
-      if($single_ship_data[P_SPEED] <= 0) {
213
+      if ($single_ship_data[P_SPEED] <= 0) {
214 214
         return $result = FLIGHT_SHIPS_UNMOVABLE;
215 215
       }
216 216
       $ships += $ship_count;
217 217
       $recyclers += in_array($ship_id, sn_get_groups('flt_recyclers')) ? $ship_count : 0;
218 218
       $spies += $ship_id == SHIP_SPY ? $ship_count : 0;
219
-    } elseif($is_resource) {
219
+    } elseif ($is_resource) {
220 220
       $resources += $ship_count;
221 221
     }
222 222
   }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     }
228 228
   */
229 229
 
230
-  if(isset($options['resources']) && $options['resources'] > 0 && !(isset($sn_data_mission['transport']) && $sn_data_mission['transport'])) {
230
+  if (isset($options['resources']) && $options['resources'] > 0 && !(isset($sn_data_mission['transport']) && $sn_data_mission['transport'])) {
231 231
     return $result = FLIGHT_RESOURCES_FORBIDDEN;
232 232
   }
233 233
 
@@ -239,78 +239,78 @@  discard block
 block discarded – undo
239 239
   */
240 240
 
241 241
   $speed = $options['fleet_speed_percent'];
242
-  if($speed && ($speed != intval($speed) || $speed < 1 || $speed > 10)) {
242
+  if ($speed && ($speed != intval($speed) || $speed < 1 || $speed > 10)) {
243 243
     return $result = FLIGHT_FLEET_SPEED_WRONG;
244 244
   }
245 245
 
246 246
   $travel_data = flt_travel_data($user, $planet_src, $planet_dst, $fleet, $options['fleet_speed_percent']);
247 247
 
248 248
 
249
-  if(mrc_get_level($user, $planet_src, RES_DEUTERIUM) < $fleet[RES_DEUTERIUM] + $travel_data['consumption']) {
249
+  if (mrc_get_level($user, $planet_src, RES_DEUTERIUM) < $fleet[RES_DEUTERIUM] + $travel_data['consumption']) {
250 250
     return $result = FLIGHT_RESOURCES_FUEL_NOT_ENOUGH;
251 251
   }
252 252
 
253
-  if($travel_data['consumption'] > $travel_data['capacity']) {
253
+  if ($travel_data['consumption'] > $travel_data['capacity']) {
254 254
     return $result = FLIGHT_FLEET_TOO_FAR;
255 255
   }
256 256
 
257
-  if($travel_data['hold'] < $resources) {
257
+  if ($travel_data['hold'] < $resources) {
258 258
     return $result = FLIGHT_FLEET_OVERLOAD;
259 259
   }
260 260
 
261 261
   $fleet_start_time = SN_TIME_NOW + $travel_data['duration'];
262 262
 
263 263
   $fleet_group = $options['fleet_group'];
264
-  if($fleet_group) {
265
-    if($mission != MT_ACS) {
264
+  if ($fleet_group) {
265
+    if ($mission != MT_ACS) {
266 266
       return $result = FLIGHT_MISSION_IMPOSSIBLE;
267 267
     };
268 268
 
269 269
     $acs = db_acs_get_by_group_id($fleet_group);
270
-    if(!$acs['id']) {
270
+    if (!$acs['id']) {
271 271
       return $result = FLIGHT_MISSION_ACS_NOT_EXISTS;
272 272
     }
273 273
 
274
-    if($planet_dst['galaxy'] != $acs['galaxy'] || $planet_dst['system'] != $acs['system'] || $planet_dst['planet'] != $acs['planet'] || $planet_dst['planet_type'] != $acs['planet_type']) {
274
+    if ($planet_dst['galaxy'] != $acs['galaxy'] || $planet_dst['system'] != $acs['system'] || $planet_dst['planet'] != $acs['planet'] || $planet_dst['planet_type'] != $acs['planet_type']) {
275 275
       return $result = FLIGHT_MISSION_ACS_WRONG_TARGET;
276 276
     }
277 277
 
278
-    if($fleet_start_time > $acs['ankunft']) {
278
+    if ($fleet_start_time > $acs['ankunft']) {
279 279
       return $result = FLIGHT_MISSION_ACS_TOO_LATE;
280 280
     }
281 281
   }
282 282
 
283 283
   $flying_fleets = $options['flying_fleets'];
284
-  if(!$flying_fleets) {
284
+  if (!$flying_fleets) {
285 285
     $flying_fleets = FleetList::fleet_count_flying($user['id']);
286 286
   }
287
-  if(GetMaxFleets($user) <= $flying_fleets && $mission != MT_MISSILE) {
287
+  if (GetMaxFleets($user) <= $flying_fleets && $mission != MT_MISSILE) {
288 288
     return $result = FLIGHT_FLEET_NO_SLOTS;
289 289
   }
290 290
 
291 291
   // В одиночку шпионские зонды могут летать только в миссии Шпионаж, Передислокация и Транспорт
292
-  if($ships && $spies && $spies == $ships && !($mission == MT_SPY || $mission == MT_RELOCATE || $mission == MT_TRANSPORT)) {
292
+  if ($ships && $spies && $spies == $ships && !($mission == MT_SPY || $mission == MT_RELOCATE || $mission == MT_TRANSPORT)) {
293 293
     return $result = FLIGHT_SHIPS_NOT_ONLY_SPIES;
294 294
   }
295 295
 
296 296
   // Checking for no planet
297
-  if(!$planet_dst['id_owner']) {
298
-    if($mission == MT_COLONIZE && !$fleet[SHIP_COLONIZER]) {
297
+  if (!$planet_dst['id_owner']) {
298
+    if ($mission == MT_COLONIZE && !$fleet[SHIP_COLONIZER]) {
299 299
       return $result = FLIGHT_SHIPS_NO_COLONIZER;
300 300
     }
301 301
 
302
-    if($mission == MT_EXPLORE || $mission == MT_COLONIZE) {
302
+    if ($mission == MT_EXPLORE || $mission == MT_COLONIZE) {
303 303
       return $result = FLIGHT_ALLOWED;
304 304
     }
305 305
 
306 306
     return $result = FLIGHT_VECTOR_NO_TARGET;
307 307
   }
308 308
 
309
-  if($mission == MT_RECYCLE) {
310
-    if($planet_dst['debris_metal'] + $planet_dst['debris_crystal'] <= 0) {
309
+  if ($mission == MT_RECYCLE) {
310
+    if ($planet_dst['debris_metal'] + $planet_dst['debris_crystal'] <= 0) {
311 311
       return $result = FLIGHT_MISSION_RECYCLE_NO_DEBRIS;
312 312
     }
313
-    if($recyclers <= 0) {
313
+    if ($recyclers <= 0) {
314 314
       return $result = FLIGHT_SHIPS_NO_RECYCLERS;
315 315
     }
316 316
 
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
   }
319 319
 
320 320
   // Got planet. Checking if it is ours
321
-  if($planet_dst['id_owner'] == $user['id']) {
322
-    if($mission == MT_TRANSPORT || $mission == MT_RELOCATE) {
321
+  if ($planet_dst['id_owner'] == $user['id']) {
322
+    if ($mission == MT_TRANSPORT || $mission == MT_RELOCATE) {
323 323
       return $result = FLIGHT_ALLOWED;
324 324
     }
325 325
 
@@ -327,19 +327,19 @@  discard block
 block discarded – undo
327 327
   }
328 328
 
329 329
   // No, planet not ours. Cutting mission that can't be send to not-ours planet
330
-  if($mission == MT_RELOCATE || $mission == MT_COLONIZE || $mission == MT_EXPLORE) {
330
+  if ($mission == MT_RELOCATE || $mission == MT_COLONIZE || $mission == MT_EXPLORE) {
331 331
     return $result = FLIGHT_MISSION_IMPOSSIBLE;
332 332
   }
333 333
 
334 334
   $enemy = db_user_by_id($planet_dst['id_owner']);
335 335
   // We cannot attack or send resource to users in VACATION mode
336
-  if($enemy['vacation'] && $mission != MT_RECYCLE) {
336
+  if ($enemy['vacation'] && $mission != MT_RECYCLE) {
337 337
     return $result = FLIGHT_PLAYER_VACATION;
338 338
   }
339 339
 
340 340
   // Multi IP protection
341 341
   // TODO: Here we need a procedure to check proxies
342
-  if(sys_is_multiaccount($user, $enemy)) {
342
+  if (sys_is_multiaccount($user, $enemy)) {
343 343
     return $result = FLIGHT_PLAYER_SAME_IP;
344 344
   }
345 345
 
@@ -347,8 +347,8 @@  discard block
 block discarded – undo
347 347
   $enemy_points = $enemy['total_points'];
348 348
 
349 349
   // Is it transport? If yes - checking for buffing to prevent mega-alliance destroyer
350
-  if($mission == MT_TRANSPORT) {
351
-    if($user_points >= $enemy_points || classSupernova::$config->allow_buffing) {
350
+  if ($mission == MT_TRANSPORT) {
351
+    if ($user_points >= $enemy_points || classSupernova::$config->allow_buffing) {
352 352
       return $result = FLIGHT_ALLOWED;
353 353
     } else {
354 354
       return $result = FLIGHT_PLAYER_BUFFING;
@@ -358,66 +358,66 @@  discard block
 block discarded – undo
358 358
   // Only aggresive missions passed to this point. HOLD counts as passive but aggresive
359 359
 
360 360
   // Is it admin with planet protection?
361
-  if($planet_dst['id_level'] > $user['authlevel']) {
361
+  if ($planet_dst['id_level'] > $user['authlevel']) {
362 362
     return $result = FLIGHT_PLAYER_ADMIN;
363 363
   }
364 364
 
365 365
   // Okay. Now skipping protection checks for inactive longer then 1 week
366
-  if(!$enemy['onlinetime'] || $enemy['onlinetime'] >= (SN_TIME_NOW - 60 * 60 * 24 * 7)) {
367
-    if(
366
+  if (!$enemy['onlinetime'] || $enemy['onlinetime'] >= (SN_TIME_NOW - 60 * 60 * 24 * 7)) {
367
+    if (
368 368
       ($enemy_points <= classSupernova::$config->game_noob_points && $user_points > classSupernova::$config->game_noob_points)
369 369
       ||
370 370
       (classSupernova::$config->game_noob_factor && $user_points > $enemy_points * classSupernova::$config->game_noob_factor)
371 371
     ) {
372
-      if($mission != MT_HOLD) {
372
+      if ($mission != MT_HOLD) {
373 373
         return $result = FLIGHT_PLAYER_NOOB;
374 374
       }
375
-      if($mission == MT_HOLD && !($user['ally_id'] && $user['ally_id'] == $enemy['ally_id'] && classSupernova::$config->ally_help_weak)) {
375
+      if ($mission == MT_HOLD && !($user['ally_id'] && $user['ally_id'] == $enemy['ally_id'] && classSupernova::$config->ally_help_weak)) {
376 376
         return $result = FLIGHT_PLAYER_NOOB;
377 377
       }
378 378
     }
379 379
   }
380 380
 
381 381
   // Is it HOLD mission? If yes - there should be ally deposit
382
-  if($mission == MT_HOLD) {
383
-    if(mrc_get_level($user, $planet_dst, STRUC_ALLY_DEPOSIT)) {
382
+  if ($mission == MT_HOLD) {
383
+    if (mrc_get_level($user, $planet_dst, STRUC_ALLY_DEPOSIT)) {
384 384
       return $result = FLIGHT_ALLOWED;
385 385
     }
386 386
 
387 387
     return $result = FLIGHT_MISSION_HOLD_NO_ALLY_DEPOSIT;
388 388
   }
389 389
 
390
-  if($mission == MT_SPY) {
390
+  if ($mission == MT_SPY) {
391 391
     return $result = $spies >= 1 ? FLIGHT_ALLOWED : FLIGHT_MISSION_SPY_NO_SPIES;
392 392
   }
393 393
 
394 394
   // Is it MISSILE mission?
395
-  if($mission == MT_MISSILE) {
395
+  if ($mission == MT_MISSILE) {
396 396
     $sn_data_mip = get_unit_param(UNIT_DEF_MISSILE_INTERPLANET);
397
-    if(mrc_get_level($user, $planet_src, STRUC_SILO) < $sn_data_mip[P_REQUIRE][STRUC_SILO]) {
397
+    if (mrc_get_level($user, $planet_src, STRUC_SILO) < $sn_data_mip[P_REQUIRE][STRUC_SILO]) {
398 398
       return $result = FLIGHT_MISSION_MISSILE_NO_SILO;
399 399
     }
400 400
 
401
-    if(!$fleet[UNIT_DEF_MISSILE_INTERPLANET]) {
401
+    if (!$fleet[UNIT_DEF_MISSILE_INTERPLANET]) {
402 402
       return $result = FLIGHT_MISSION_MISSILE_NO_MISSILES;
403 403
     }
404 404
 
405 405
     $distance = abs($planet_dst['system'] - $planet_src['system']);
406 406
     $mip_range = flt_get_missile_range($user);
407
-    if($distance > $mip_range || $planet_dst['galaxy'] != $planet_src['galaxy']) {
407
+    if ($distance > $mip_range || $planet_dst['galaxy'] != $planet_src['galaxy']) {
408 408
       return $result = FLIGHT_MISSION_MISSILE_TOO_FAR;
409 409
     }
410 410
 
411
-    if(isset($options['target_structure']) && $options['target_structure'] && !in_array($options['target_structure'], sn_get_groups('defense_active'))) {
411
+    if (isset($options['target_structure']) && $options['target_structure'] && !in_array($options['target_structure'], sn_get_groups('defense_active'))) {
412 412
       return $result = FLIGHT_MISSION_MISSILE_WRONG_STRUCTURE;
413 413
     }
414 414
   }
415 415
 
416
-  if($mission == MT_DESTROY && $planet_dst['planet_type'] != PT_MOON) {
416
+  if ($mission == MT_DESTROY && $planet_dst['planet_type'] != PT_MOON) {
417 417
     return $result = FLIGHT_MISSION_IMPOSSIBLE;
418 418
   }
419 419
 
420
-  if($mission == MT_ATTACK || $mission == MT_ACS || $mission == MT_DESTROY) {
420
+  if ($mission == MT_ATTACK || $mission == MT_ACS || $mission == MT_DESTROY) {
421 421
     return $result = flt_bashing_check($user, $enemy, $planet_dst, $mission, $travel_data['duration'], $fleet_group);
422 422
   }
423 423
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
   $from = $from['planet'];
445 445
 
446 446
   $can_attack = flt_can_attack($from, $to, $fleet_REAL_array, $mission, $options);
447
-  if($can_attack != FLIGHT_ALLOWED) {
447
+  if ($can_attack != FLIGHT_ALLOWED) {
448 448
     $internal_transaction ? sn_db_transaction_rollback() : false;
449 449
 
450 450
     return $can_attack;
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
   $travel_data = flt_travel_data($user, $from, $to, $fleet_REAL_array, $options['fleet_speed_percent']);
456 456
 
457 457
   $time_on_mission = 0;
458
-  if($mission == MT_EXPLORE || $mission == MT_HOLD) {
458
+  if ($mission == MT_EXPLORE || $mission == MT_HOLD) {
459 459
     // TODO - include some checks about maximum and minumum stay_duration
460 460
     $time_on_mission = $options['stay_time'] * 3600;
461 461
   }
@@ -478,14 +478,14 @@  discard block
 block discarded – undo
478 478
   $sn_group_resources_loot = sn_get_groups('resources_loot');
479 479
   $db_changeset = array();
480 480
   $planet_row_changed_fields = array();
481
-  foreach($fleet_REAL_array as $unit_id => $amount) {
482
-    if(!$amount || !$unit_id) {
481
+  foreach ($fleet_REAL_array as $unit_id => $amount) {
482
+    if (!$amount || !$unit_id) {
483 483
       continue;
484 484
     }
485 485
 
486
-    if(in_array($unit_id, $sn_group_fleet)) {
486
+    if (in_array($unit_id, $sn_group_fleet)) {
487 487
       $db_changeset['unit'][] = sn_db_unit_changeset_prepare($unit_id, -$amount, $user, $from['id']);
488
-    } elseif(in_array($unit_id, $sn_group_resources_loot)) {
488
+    } elseif (in_array($unit_id, $sn_group_resources_loot)) {
489 489
       $planet_row_changed_fields[pname_resource_name($unit_id)]['delta'] -= $amount;
490 490
     }
491 491
   }
@@ -524,16 +524,16 @@  discard block
 block discarded – undo
524 524
 
525 525
   $ship_data = array();
526 526
   $fleet_array = array();
527
-  foreach($ship_list as $transport_id => $cork) {
527
+  foreach ($ship_list as $transport_id => $cork) {
528 528
     $ship_data[$transport_id] = flt_travel_data($user, $from, $to, array($transport_id => 1), 10);
529 529
   }
530 530
   uasort($ship_data, 'flt_calculate_ship_to_transport_sort');
531 531
 
532 532
   $fleet_capacity = 0;
533 533
   $fuel_total = $fuel_left = mrc_get_level($user, $from, RES_DEUTERIUM);
534
-  foreach($ship_data as $transport_id => &$ship_info) {
534
+  foreach ($ship_data as $transport_id => &$ship_info) {
535 535
     $ship_loaded = min($ship_list[$transport_id], ceil($resource_amount / $ship_info['hold']), floor($fuel_left / $ship_info['consumption']));
536
-    if($ship_loaded) {
536
+    if ($ship_loaded) {
537 537
       $fleet_array[$transport_id] = $ship_loaded;
538 538
       $resource_amount -= min($resource_amount, $ship_info['hold'] * $ship_loaded);
539 539
       $fuel_left -= $ship_info['consumption'] * $ship_loaded;
Please login to merge, or discard this patch.
includes/functions/tpl_helpers.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 // Compare function to sort fleet in time order
4 4
 function tpl_assign_fleet_compare($a, $b) {
5
-  if($a['fleet']['OV_THIS_PLANET'] == $b['fleet']['OV_THIS_PLANET']) {
6
-    if($a['fleet']['OV_LEFT'] == $b['fleet']['OV_LEFT']) {
5
+  if ($a['fleet']['OV_THIS_PLANET'] == $b['fleet']['OV_THIS_PLANET']) {
6
+    if ($a['fleet']['OV_LEFT'] == $b['fleet']['OV_LEFT']) {
7 7
       return 0;
8 8
     }
9 9
 
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
  * @param string   $js_name
20 20
  */
21 21
 function tpl_assign_fleet(&$template, $fleets, $js_name = 'fleets') {
22
-  if(!$fleets) {
22
+  if (!$fleets) {
23 23
     return;
24 24
   }
25 25
 
26 26
   usort($fleets, 'tpl_assign_fleet_compare');
27 27
 
28
-  foreach($fleets as $fleet_data) {
28
+  foreach ($fleets as $fleet_data) {
29 29
     $template->assign_block_vars($js_name, $fleet_data['fleet']);
30 30
 
31
-    if($fleet_data['ships']) {
32
-      foreach($fleet_data['ships'] as $ship_data) {
31
+    if ($fleet_data['ships']) {
32
+      foreach ($fleet_data['ships'] as $ship_data) {
33 33
         $template->assign_block_vars("{$js_name}.ships", $ship_data);
34 34
       }
35 35
     }
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
     'DEUTERIUM' => $fleet[RES_DEUTERIUM],
51 51
   );
52 52
 
53
-  foreach($fleet as $ship_id => $ship_amount) {
54
-    if(in_array($ship_id, sn_get_groups('fleet'))) {
53
+  foreach ($fleet as $ship_id => $ship_amount) {
54
+    if (in_array($ship_id, sn_get_groups('fleet'))) {
55 55
       $single_ship_data = get_ship_data($ship_id, $user_data);
56 56
       $return['ships'][$ship_id] = array(
57 57
         'ID'          => $ship_id,
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 
91 91
   $result = array();
92 92
 
93
-  if(!$user_data) {
93
+  if (!$user_data) {
94 94
     $user_data = $user;
95 95
   }
96 96
 
97
-  if(!$objFleet->isReturning() && $objFleet->mission_type == MT_ACS) {
97
+  if (!$objFleet->isReturning() && $objFleet->mission_type == MT_ACS) {
98 98
     $aks = db_acs_get_by_group_id($objFleet->group_id);
99 99
   }
100 100
 
@@ -135,14 +135,14 @@  discard block
 block discarded – undo
135 135
     'STAY_LEFT' => floor($objFleet->time_mission_job_complete + 1 - SN_TIME_NOW),
136 136
   );
137 137
 
138
-  if(property_exists($objFleet, 'fleet_start_name')) {
138
+  if (property_exists($objFleet, 'fleet_start_name')) {
139 139
     $result['START_NAME'] = $objFleet->fleet_start_name;
140 140
   }
141
-  if(property_exists($objFleet, 'fleet_end_name')) {
141
+  if (property_exists($objFleet, 'fleet_end_name')) {
142 142
     $result['END_NAME'] = $objFleet->fleet_end_name;
143 143
   }
144 144
 
145
-  if(property_exists($objFleet, 'event_time')) {
145
+  if (property_exists($objFleet, 'event_time')) {
146 146
     $result['fleet'] = array_merge($result['fleet'], array(
147 147
       'OV_LABEL'        => $objFleet->ov_label,
148 148
       'EVENT_TIME_TEXT' => property_exists($objFleet, 'event_time') ? date(FMT_DATE_TIME, $objFleet->event_time + SN_CLIENT_TIME_DIFF) : '',
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 
156 156
   $ship_id = 0;
157 157
   $result['ships'] = array();
158
-  if($spy_level >= 6) {
159
-    foreach($ship_list_fully_parsed as $ship_sn_id => $ship_amount) {
160
-      if($spy_level >= 10) {
158
+  if ($spy_level >= 6) {
159
+    foreach ($ship_list_fully_parsed as $ship_sn_id => $ship_amount) {
160
+      if ($spy_level >= 10) {
161 161
         $single_ship_data = get_ship_data($ship_sn_id, $user_data);
162 162
         $result['ships'][$ship_sn_id] = array(
163 163
           'ID'          => $ship_sn_id,
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
 function tpl_parse_planet_que($que, $planet, $que_id) {
191 191
   $hangar_que = array();
192 192
   $que_hangar = $que['ques'][$que_id][$planet['id_owner']][$planet['id']];
193
-  if(!empty($que_hangar)) {
194
-    foreach($que_hangar as $que_item) {
193
+  if (!empty($que_hangar)) {
194
+    foreach ($que_hangar as $que_item) {
195 195
       $hangar_que['que'][] = array('id' => $que_item['que_unit_id'], 'count' => $que_item['que_unit_amount']);
196 196
       $hangar_que[$que_item['que_unit_id']] += $que_item['que_unit_amount'];
197 197
     }
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
     'PLANET_GOVERNOR_LEVEL_MAX' => get_unit_param($planet['PLANET_GOVERNOR_ID'], P_MAX_STACK),
252 252
   );
253 253
 
254
-  if(!empty($que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']])) {
254
+  if (!empty($que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']])) {
255 255
     $result['building_que'] = array();
256 256
     $building_que = &$que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']];
257
-    foreach($building_que as $que_element) {
257
+    foreach ($building_que as $que_element) {
258 258
       $result['building_que'][] = que_tpl_parse_element($que_element);
259 259
     }
260 260
   }
@@ -270,19 +270,19 @@  discard block
 block discarded – undo
270 270
 function flt_get_fleets_to_planet_by_array_of_Fleet($array_of_Fleet) {
271 271
   global $user;
272 272
 
273
-  if(empty($array_of_Fleet)) {
273
+  if (empty($array_of_Fleet)) {
274 274
     return false;
275 275
   }
276 276
 
277 277
   $fleet_list = array();
278
-  foreach($array_of_Fleet as $fleet) {
279
-    if($fleet->playerOwnerId == $user['id']) {
280
-      if($fleet->mission_type == MT_MISSILE) {
278
+  foreach ($array_of_Fleet as $fleet) {
279
+    if ($fleet->playerOwnerId == $user['id']) {
280
+      if ($fleet->mission_type == MT_MISSILE) {
281 281
         continue;
282 282
       }
283 283
       $fleet_ownage = 'own';
284 284
     } else {
285
-      switch($fleet->mission_type) {
285
+      switch ($fleet->mission_type) {
286 286
         case MT_ATTACK:
287 287
         case MT_ACS:
288 288
         case MT_DESTROY:
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
 
300 300
     $fleet_list[$fleet_ownage]['fleets'][$fleet->dbId] = $fleet;
301 301
 
302
-    if($fleet->isReturning() || (!$fleet->isReturning() && $fleet->mission_type == MT_RELOCATE) || ($fleet->target_owner_id != $user['id'])) {
302
+    if ($fleet->isReturning() || (!$fleet->isReturning() && $fleet->mission_type == MT_RELOCATE) || ($fleet->target_owner_id != $user['id'])) {
303 303
       $fleet_sn = $fleet->shipsGetArray();
304
-      foreach($fleet_sn as $ship_id => $ship_amount) {
305
-        if(in_array($ship_id, sn_get_groups('fleet'))) {
304
+      foreach ($fleet_sn as $ship_id => $ship_amount) {
305
+        if (in_array($ship_id, sn_get_groups('fleet'))) {
306 306
           $fleet_list[$fleet_ownage]['total'][$ship_id] += $ship_amount;
307 307
         }
308 308
       }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
   return $fleet_list;
320 320
 }
321 321
 
322
-function tpl_set_resource_info(template &$template, $planet_row, $fleets_to_planet = array(), $round = 0) {
322
+function tpl_set_resource_info(template & $template, $planet_row, $fleets_to_planet = array(), $round = 0) {
323 323
   $template->assign_vars(array(
324 324
     'RESOURCE_ROUNDING' => $round,
325 325
 
Please login to merge, or discard this patch.
includes/functions/int_fleet_events.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@  discard block
 block discarded – undo
6 6
   $fleet_events = array();
7 7
   $fleet_number = 0;
8 8
 
9
-  if($objFleetList->count() <= 0) {
9
+  if ($objFleetList->count() <= 0) {
10 10
     return;
11 11
   }
12 12
 
13
-  foreach($objFleetList->_container as $objFleet) {
13
+  foreach ($objFleetList->_container as $objFleet) {
14 14
     $planet_start_type = $objFleet->fleet_start_type == PT_MOON ? PT_MOON : PT_PLANET;
15 15
     $planet_start = db_planet_by_gspt($objFleet->fleet_start_galaxy, $objFleet->fleet_start_system, $objFleet->fleet_start_planet, $planet_start_type, false, 'name');
16 16
     $objFleet->fleet_start_name = $planet_start['name'];
17 17
 
18 18
     $planet_end_type = $objFleet->fleet_end_type == PT_MOON ? PT_MOON : PT_PLANET;
19
-    if($objFleet->fleet_end_planet > Vector::$knownPlanets) {
19
+    if ($objFleet->fleet_end_planet > Vector::$knownPlanets) {
20 20
       $objFleet->fleet_end_name = classLocale::$lang['ov_fleet_exploration'];
21
-    } elseif($objFleet->mission_type == MT_COLONIZE) {
21
+    } elseif ($objFleet->mission_type == MT_COLONIZE) {
22 22
       $objFleet->fleet_end_name = classLocale::$lang['ov_fleet_colonization'];
23 23
     } else {
24 24
       $planet_end = db_planet_by_gspt($objFleet->fleet_end_galaxy, $objFleet->fleet_end_system, $objFleet->fleet_end_planet, $planet_end_type, false, 'name');
25 25
       $objFleet->fleet_end_name = $planet_end['name'];
26 26
     }
27 27
 
28
-    if($objFleet->time_arrive_to_target > SN_TIME_NOW && !$objFleet->isReturning() && $objFleet->mission_type != MT_MISSILE &&
28
+    if ($objFleet->time_arrive_to_target > SN_TIME_NOW && !$objFleet->isReturning() && $objFleet->mission_type != MT_MISSILE &&
29 29
       ($planet_scanned === false
30 30
         ||
31 31
         (
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
       $fleet_events[] = flt_register_event_objFleet($objFleet, 0, $planet_end_type);
40 40
     }
41 41
 
42
-    if($objFleet->time_mission_job_complete > SN_TIME_NOW && !$objFleet->isReturning() && $planet_scanned === false && $objFleet->mission_type != MT_MISSILE) {
42
+    if ($objFleet->time_mission_job_complete > SN_TIME_NOW && !$objFleet->isReturning() && $planet_scanned === false && $objFleet->mission_type != MT_MISSILE) {
43 43
       $fleet_events[] = flt_register_event_objFleet($objFleet, 1, $planet_end_type);
44 44
     }
45 45
 
46
-    if(
46
+    if (
47 47
       $objFleet->time_return_to_source > SN_TIME_NOW && $objFleet->mission_type != MT_MISSILE && ($objFleet->isReturning() || ($objFleet->mission_type != MT_RELOCATE && $objFleet->mission_type != MT_COLONIZE)) &&
48 48
       (
49 49
         ($planet_scanned === false && $objFleet->playerOwnerId == $user['id'])
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
       $fleet_events[] = flt_register_event_objFleet($objFleet, 2, $planet_end_type);
60 60
     }
61 61
 
62
-    if($objFleet->mission_type == MT_MISSILE) {
62
+    if ($objFleet->mission_type == MT_MISSILE) {
63 63
       $fleet_events[] = flt_register_event_objFleet($objFleet, 3, $planet_end_type);
64 64
     }
65 65
   }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
   $is_this_planet = false;
81 81
 
82
-  switch($objFleet->ov_label = $ov_label) {
82
+  switch ($objFleet->ov_label = $ov_label) {
83 83
     case 0:
84 84
       $objFleet->event_time = $objFleet->time_arrive_to_target;
85 85
       $is_this_planet = (
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 
111 111
   }
112 112
 
113
-  $objFleet->ov_this_planet = $is_this_planet;// || $planet_scanned != false;
113
+  $objFleet->ov_this_planet = $is_this_planet; // || $planet_scanned != false;
114 114
 
115
-  if($objFleet->playerOwnerId == $user['id']) {
115
+  if ($objFleet->playerOwnerId == $user['id']) {
116 116
     $user_data = $user;
117 117
   } else {
118 118
     $user_data = db_user_by_id($objFleet->playerOwnerId);
Please login to merge, or discard this patch.
includes/functions/uni_functions.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@  discard block
 block discarded – undo
7 7
 
8 8
   $possible_cores = array();
9 9
   $probability = 0;
10
-  foreach($density_list as $possible_core_id => $core_data) {
11
-    if(!$core_data[UNIT_PLANET_DENSITY_RARITY]) {
10
+  foreach ($density_list as $possible_core_id => $core_data) {
11
+    if (!$core_data[UNIT_PLANET_DENSITY_RARITY]) {
12 12
       continue;
13 13
     }
14 14
 
15
-    if(
15
+    if (
16 16
       // Core type exists
17 17
       in_array($possible_core_id, $position_data['core_types'])
18 18
       // Limit core type with planet sector count
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 
34 34
   $random = mt_rand(1, $probability);
35 35
   $selected_core = null;
36
-  foreach($possible_cores as $core_type => $core_info) {
37
-    if($random <= $core_info[UNIT_PLANET_DENSITY_RARITY]) {
36
+  foreach ($possible_cores as $core_type => $core_info) {
37
+    if ($random <= $core_info[UNIT_PLANET_DENSITY_RARITY]) {
38 38
       $selected_core = $core_info;
39 39
       break;
40 40
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 function uni_create_planet($Galaxy, $System, $Position, $PlanetOwnerID, $planet_name_unsafe = '', $HomeWorld = false, $options = array()) {
58 58
   $Position = intval($Position);
59 59
 
60
-  if(!isset($options['skip_check']) && db_planet_by_gspt($Galaxy, $System, $Position, PT_PLANET, true, '`id`')) {
60
+  if (!isset($options['skip_check']) && db_planet_by_gspt($Galaxy, $System, $Position, PT_PLANET, true, '`id`')) {
61 61
     return false;
62 62
   }
63 63
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 
67 67
   $planet_generator = sn_get_groups('planet_generator');
68 68
 
69
-  if($HomeWorld) {
69
+  if ($HomeWorld) {
70 70
     $position_data = $planet_generator[0];
71 71
   } else {
72 72
     $position_data = $planet_generator[$Position >= UNIVERSE_RANDOM_PLANET_START || $Position < 1 ? UNIVERSE_RANDOM_PLANET_START : $Position];
73
-    if($Position >= UNIVERSE_RANDOM_PLANET_START) {
73
+    if ($Position >= UNIVERSE_RANDOM_PLANET_START) {
74 74
       // Корректируем температуру для планеты-странника
75 75
       $position_data['t_max_max'] -= UNIVERSE_RANDOM_PLANET_TEMPERATURE_DECREASE * ($Position - UNIVERSE_RANDOM_PLANET_START);
76 76
     }
@@ -170,15 +170,15 @@  discard block
 block discarded – undo
170 170
   $moon_name = '';
171 171
   $moon_row = array();
172 172
   $moon = db_planet_by_gspt($pos_galaxy, $pos_system, $pos_planet, PT_MOON, false, 'id');
173
-  if(!$moon['id']) {
173
+  if (!$moon['id']) {
174 174
     $moon_planet = db_planet_by_gspt($pos_galaxy, $pos_system, $pos_planet, PT_PLANET, true, '`id`, `temp_min`, `temp_max`, `name`, `debris_metal`, `debris_crystal`');
175 175
 
176
-    if($moon_planet['id']) {
176
+    if ($moon_planet['id']) {
177 177
       $base_storage_size = BASE_STORAGE_SIZE;
178 178
 
179
-      if(!$moon_chance) {
179
+      if (!$moon_chance) {
180 180
         $size = mt_rand(1100, 8999);
181
-      } elseif($moon_chance <= 100) {
181
+      } elseif ($moon_chance <= 100) {
182 182
         $size = mt_rand($moon_chance * 100 + 1000, $moon_chance * 200 + 2999);
183 183
       } else {
184 184
         $size = $moon_chance;
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
       $field_max = ceil($size / 1000);
196 196
 
197
-      if(isset($options['image']) && $options['image']) {
197
+      if (isset($options['image']) && $options['image']) {
198 198
         $moon_image = $options['image'];
199 199
       } else {
200 200
         $moon_image = 'mond';
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
           `deuterium` = '0', `deuterium_perhour` = '0', `deuterium_max` = '{$base_storage_size}'"
210 210
       );
211 211
 
212
-      if($update_debris) {
212
+      if ($update_debris) {
213 213
         $debris_spent = $moon_chance * 1000000;
214 214
         $metal_spent = round(min($moon_planet['debris_metal'], $debris_spent * mt_rand(50, 75) / 100));
215 215
         $crystal_spent = min($moon_planet['debris_crystal'], $debris_spent - $metal_spent);
@@ -244,21 +244,21 @@  discard block
 block discarded – undo
244 244
   $planet_row['id'] = $user['current_planet'];
245 245
 
246 246
   // Пытаемся переключить на новую планету
247
-  if(($selected_planet = sys_get_param_id('cp')) && $selected_planet != $user['current_planet']) {
247
+  if (($selected_planet = sys_get_param_id('cp')) && $selected_planet != $user['current_planet']) {
248 248
     $planet_row = db_planet_by_id_and_owner($selected_planet, $user['id'], false, 'id');
249 249
   } else {
250 250
     $planet_row = db_planet_by_id($planet_row['id']);
251 251
   }
252 252
 
253 253
   // Если новая планета не найдена или было переключения - проверяем текущую выбранную планету
254
-  if(!isset($planet_row['id'])) // || $planet_row['id'] != $user['current_planet']
254
+  if (!isset($planet_row['id'])) // || $planet_row['id'] != $user['current_planet']
255 255
   {
256 256
     $planet_row = db_planet_by_id_and_owner($user['current_planet'], $user['id'], false, 'id');
257 257
     // Если текущей планеты не существует - выставляем Столицу
258
-    if(!isset($planet_row['id'])) {
258
+    if (!isset($planet_row['id'])) {
259 259
       $planet_row = db_planet_by_id_and_owner($user['id_planet'], $user['id'], false, 'id');
260 260
       // Если и столицы не существует - значит что-то очень не так с записью пользователя
261
-      if(!isset($planet_row['id'])) {
261
+      if (!isset($planet_row['id'])) {
262 262
         global $debug;
263 263
         $debug->error("User ID {$user['id']} has Capital planet {$user['id_planet']} but this planet does not exists", 'User record error', 502);
264 264
       }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
   }
267 267
 
268 268
   // Если производилось переключение планеты - делаем запись в юзере
269
-  if($user['current_planet'] != $planet_row['id']) {
269
+  if ($user['current_planet'] != $planet_row['id']) {
270 270
     db_user_set_by_id($user['id'], "`current_planet` = '{$planet_row['id']}'");
271 271
     $user['current_planet'] = $planet_row['id'];
272 272
   }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 }
285 285
 
286 286
 function uni_render_planet_full($from, $prefix = '', $html_safe = true, $include_id = false) {
287
-  if(!$from['id']) {
287
+  if (!$from['id']) {
288 288
     $result = classLocale::$lang['sys_planet_expedition'];
289 289
   } else {
290 290
     $from_planet_id = $include_id ? (
@@ -334,30 +334,30 @@  discard block
 block discarded – undo
334 334
   $coordinates["{$prefix}planet"] = intval($coordinates["{$prefix}planet"]);
335 335
 
336 336
   return
337
-    isset($coordinates["{$prefix}galaxy"]) && $coordinates["{$prefix}galaxy"] > 0 && $coordinates["{$prefix}galaxy"] <= Vector::$knownGalaxies&&
338
-    isset($coordinates["{$prefix}system"]) && $coordinates["{$prefix}system"] > 0 && $coordinates["{$prefix}system"] <= Vector::$knownSystems&&
337
+    isset($coordinates["{$prefix}galaxy"]) && $coordinates["{$prefix}galaxy"] > 0 && $coordinates["{$prefix}galaxy"] <= Vector::$knownGalaxies &&
338
+    isset($coordinates["{$prefix}system"]) && $coordinates["{$prefix}system"] > 0 && $coordinates["{$prefix}system"] <= Vector::$knownSystems &&
339 339
     isset($coordinates["{$prefix}planet"]) && $coordinates["{$prefix}planet"] > 0 && $coordinates["{$prefix}planet"] <= Vector::$knownPlanets;
340 340
 }
341 341
 
342 342
 function uni_planet_teleport_check($user, $planetrow, $new_coordinates = null) {
343 343
   try {
344
-    if($planetrow['planet_teleport_next'] && $planetrow['planet_teleport_next'] > SN_TIME_NOW) {
344
+    if ($planetrow['planet_teleport_next'] && $planetrow['planet_teleport_next'] > SN_TIME_NOW) {
345 345
       throw new exception(classLocale::$lang['ov_teleport_err_cooldown'], ERR_ERROR);
346 346
     }
347 347
 
348
-    if(mrc_get_level($user, null, RES_DARK_MATTER) < classSupernova::$config->planet_teleport_cost) {
348
+    if (mrc_get_level($user, null, RES_DARK_MATTER) < classSupernova::$config->planet_teleport_cost) {
349 349
       throw new exception(classLocale::$lang['ov_teleport_err_no_dark_matter'], ERR_ERROR);
350 350
     }
351 351
 
352 352
     // TODO: Replace quick-check with using gathered flying fleet data
353
-    if(FleetList::fleet_count_incoming($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'])) {
353
+    if (FleetList::fleet_count_incoming($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'])) {
354 354
       throw new exception(classLocale::$lang['ov_teleport_err_fleet'], ERR_ERROR);
355 355
     }
356 356
 
357
-    if(is_array($new_coordinates)) {
357
+    if (is_array($new_coordinates)) {
358 358
       $new_coordinates['planet_type'] = PT_PLANET;
359 359
       $incoming = db_planet_by_vector($new_coordinates, '', true, 'id');
360
-      if($incoming['id']) {
360
+      if ($incoming['id']) {
361 361
         throw new exception(classLocale::$lang['ov_teleport_err_destination_busy'], ERR_ERROR);
362 362
       }
363 363
     }
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
       'result'  => ERR_NONE,
367 367
       'message' => '',
368 368
     );
369
-  } catch(exception $e) {
369
+  } catch (exception $e) {
370 370
     $response = array(
371 371
       'result'  => $e->getCode(),
372 372
       'message' => $e->getMessage(),
Please login to merge, or discard this patch.
includes/functions/sys_user.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 function sys_user_vacation($user) {
10
-  if(sys_get_param_str('vacation') == 'leave') {
10
+  if (sys_get_param_str('vacation') == 'leave') {
11 11
     if ($user['vacation'] < SN_TIME_NOW) {
12 12
       $user['vacation'] = 0;
13 13
       $user['vacation_next'] = SN_TIME_NOW + classSupernova::$config->player_vacation_timeout;
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     }
16 16
   }
17 17
 
18
-  if($user['vacation']) {
18
+  if ($user['vacation']) {
19 19
     // sn_sys_logout(false, true);
20 20
     // core_auth::logout(false, true);
21 21
 
@@ -45,33 +45,33 @@  discard block
 block discarded – undo
45 45
   // TODO: Full rewrite
46 46
   sn_db_transaction_start();
47 47
   $TheUser = db_user_by_id($UserID);
48
-  if ( $TheUser['ally_id'] != 0 ) {
49
-    $TheAlly = doquery ( "SELECT * FROM `{{alliance}}` WHERE `id` = '" . $TheUser['ally_id'] . "';", '', true );
48
+  if ($TheUser['ally_id'] != 0) {
49
+    $TheAlly = doquery("SELECT * FROM `{{alliance}}` WHERE `id` = '" . $TheUser['ally_id'] . "';", '', true);
50 50
     $TheAlly['ally_members'] -= 1;
51
-    if ( $TheAlly['ally_members'] > 0 ) {
52
-      doquery ( "UPDATE `{{alliance}}` SET `ally_members` = '" . $TheAlly['ally_members'] . "' WHERE `id` = '" . $TheAlly['id'] . "';");
51
+    if ($TheAlly['ally_members'] > 0) {
52
+      doquery("UPDATE `{{alliance}}` SET `ally_members` = '" . $TheAlly['ally_members'] . "' WHERE `id` = '" . $TheAlly['id'] . "';");
53 53
     } else {
54
-      doquery ( "DELETE FROM `{{alliance}}` WHERE `id` = '" . $TheAlly['id'] . "';");
55
-      doquery ( "DELETE FROM `{{statpoints}}` WHERE `stat_type` = '2' AND `id_owner` = '" . $TheAlly['id'] . "';");
54
+      doquery("DELETE FROM `{{alliance}}` WHERE `id` = '" . $TheAlly['id'] . "';");
55
+      doquery("DELETE FROM `{{statpoints}}` WHERE `stat_type` = '2' AND `id_owner` = '" . $TheAlly['id'] . "';");
56 56
     }
57 57
   }
58
-  doquery ( "DELETE FROM `{{statpoints}}` WHERE `stat_type` = '1' AND `id_owner` = '" . $UserID . "';");
58
+  doquery("DELETE FROM `{{statpoints}}` WHERE `stat_type` = '1' AND `id_owner` = '" . $UserID . "';");
59 59
 
60 60
   db_planet_list_delete_by_owner($UserID);
61 61
 
62
-  doquery ( "DELETE FROM `{{messages}}` WHERE `message_sender` = '" . $UserID . "';");
63
-  doquery ( "DELETE FROM `{{messages}}` WHERE `message_owner` = '" . $UserID . "';");
64
-  doquery ( "DELETE FROM `{{notes}}` WHERE `owner` = '" . $UserID . "';");
62
+  doquery("DELETE FROM `{{messages}}` WHERE `message_sender` = '" . $UserID . "';");
63
+  doquery("DELETE FROM `{{messages}}` WHERE `message_owner` = '" . $UserID . "';");
64
+  doquery("DELETE FROM `{{notes}}` WHERE `owner` = '" . $UserID . "';");
65 65
   FleetList::db_fleet_list_delete_by_owner($UserID);
66 66
 //  doquery ( "DELETE FROM `{{rw}}` WHERE `id_owner1` = '" . $UserID . "';");
67 67
 //  doquery ( "DELETE FROM `{{rw}}` WHERE `id_owner2` = '" . $UserID . "';");
68
-  doquery ( "DELETE FROM `{{buddy}}` WHERE `BUDDY_SENDER_ID` = '" . $UserID . "';");
69
-  doquery ( "DELETE FROM `{{buddy}}` WHERE `BUDDY_OWNER_ID` = '" . $UserID . "';");
70
-  doquery ( "DELETE FROM `{{annonce}}` WHERE `user` = '" . $UserID . "';");
68
+  doquery("DELETE FROM `{{buddy}}` WHERE `BUDDY_SENDER_ID` = '" . $UserID . "';");
69
+  doquery("DELETE FROM `{{buddy}}` WHERE `BUDDY_OWNER_ID` = '" . $UserID . "';");
70
+  doquery("DELETE FROM `{{annonce}}` WHERE `user` = '" . $UserID . "';");
71 71
 
72 72
 
73 73
   classSupernova::db_del_record_by_id(LOC_USER, $UserID);
74
-  doquery ( "DELETE FROM `{{referrals}}` WHERE (`id` = '{$UserID}') OR (`id_partner` = '{$UserID}');");
74
+  doquery("DELETE FROM `{{referrals}}` WHERE (`id` = '{$UserID}') OR (`id_partner` = '{$UserID}');");
75 75
   classSupernova::$config->db_saveItem('users_amount', classSupernova::$config->db_loadItem('users_amount') - 1);
76 76
   sn_db_transaction_commit();
77 77
 }
@@ -145,28 +145,28 @@  discard block
 block discarded – undo
145 145
   !empty($options['password_encoded_unsafe']) ? $field_set['password'] = $options['password_encoded_unsafe'] : false;
146 146
 
147 147
   $user_new = classSupernova::db_ins_field_set(LOC_USER, $field_set);
148
-  if(!($options['galaxy'] && $options['system'] && $options['planet'])) {
148
+  if (!($options['galaxy'] && $options['system'] && $options['planet'])) {
149 149
     $options['galaxy'] = classSupernova::$config->LastSettedGalaxyPos;
150 150
     $options['system'] = classSupernova::$config->LastSettedSystemPos;
151
-    $segment_size = floor(Vector::$knownPlanets/ 3);
151
+    $segment_size = floor(Vector::$knownPlanets / 3);
152 152
     $segment = floor(classSupernova::$config->LastSettedPlanetPos / $segment_size);
153 153
     $segment++;
154 154
     $options['planet'] = mt_rand(1 + $segment * $segment_size, ($segment + 1) * $segment_size);
155 155
 
156 156
     // $new_planet_id = 0;
157
-    while(true) {
158
-      if($options['planet'] > Vector::$knownPlanets) {
157
+    while (true) {
158
+      if ($options['planet'] > Vector::$knownPlanets) {
159 159
         $options['planet'] = mt_rand(0, $segment_size - 1) + 1;
160 160
         $options['system']++;
161 161
       }
162
-      if($options['system'] > Vector::$knownSystems) {
162
+      if ($options['system'] > Vector::$knownSystems) {
163 163
         $options['system'] = 1;
164 164
         $options['galaxy']++;
165 165
       }
166
-      $options['galaxy'] > Vector::$knownGalaxies? $options['galaxy'] = 1 : false;
166
+      $options['galaxy'] > Vector::$knownGalaxies ? $options['galaxy'] = 1 : false;
167 167
 
168 168
       $galaxy_row = db_planet_by_gspt($options['galaxy'], $options['system'], $options['planet'], PT_PLANET, true, 'id');
169
-      if(!$galaxy_row['id']) {
169
+      if (!$galaxy_row['id']) {
170 170
         classSupernova::$config->db_saveItem(array(
171 171
           'LastSettedGalaxyPos' => $options['galaxy'],
172 172
           'LastSettedSystemPos' => $options['system'],
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
   $username_safe = db_escape($username_unsafe);
190 190
   db_player_name_history_replace($user_new, $username_safe);
191 191
 
192
-  if(!empty($options['partner_id']) && ($referral_row = db_user_by_id($options['partner_id'], true))) {
192
+  if (!empty($options['partner_id']) && ($referral_row = db_user_by_id($options['partner_id'], true))) {
193 193
     db_referral_insert($options, $user_new);
194 194
   }
195 195
 
Please login to merge, or discard this patch.
includes/constants.php 1 patch
Spacing   +236 added lines, -236 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Game type constants starts with GAME_
40 40
 define('GAME_SUPERNOVA', 0);
41
-define('GAME_OGAME'    , 1);
42
-define('GAME_BLITZ'    , 2);
41
+define('GAME_OGAME', 1);
42
+define('GAME_BLITZ', 2);
43 43
 
44 44
 // Date & time range constants
45 45
 define('DATE_FOREVER', 2000000000);
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 define('PERIOD_YEAR', PERIOD_DAY * 365);
53 53
 define('PERIOD_FOREVER', PERIOD_YEAR * 100);
54 54
 
55
-define('PERIOD_MINUTE_2' , PERIOD_MINUTE * 2);
56
-define('PERIOD_MINUTE_3' , PERIOD_MINUTE * 3);
57
-define('PERIOD_MINUTE_5' , PERIOD_MINUTE * 5);
55
+define('PERIOD_MINUTE_2', PERIOD_MINUTE * 2);
56
+define('PERIOD_MINUTE_3', PERIOD_MINUTE * 3);
57
+define('PERIOD_MINUTE_5', PERIOD_MINUTE * 5);
58 58
 define('PERIOD_MINUTE_10', PERIOD_MINUTE * 10);
59
-define('PERIOD_DAY_3'    , PERIOD_DAY * 3);
60
-define('PERIOD_WEEK_2'   , PERIOD_WEEK * 2);
61
-define('PERIOD_MONTH_2'  , PERIOD_MONTH * 2);
62
-define('PERIOD_MONTH_3'  , PERIOD_MONTH * 3);
59
+define('PERIOD_DAY_3', PERIOD_DAY * 3);
60
+define('PERIOD_WEEK_2', PERIOD_WEEK * 2);
61
+define('PERIOD_MONTH_2', PERIOD_MONTH * 2);
62
+define('PERIOD_MONTH_3', PERIOD_MONTH * 3);
63 63
 
64 64
 define('FONT_SIZE_PERCENT_MIN', 56.25);
65 65
 define('FONT_SIZE_PERCENT_DEFAULT', 68.75);
@@ -112,100 +112,100 @@  discard block
 block discarded – undo
112 112
 define('SN_SYS_SEC_CHARS_ALLOWED', 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghkmnpqrstuvwxyz0123456789');
113 113
 
114 114
 // Mot qui sont interdit a la saisie !
115
-$ListCensure = array ( '/</', '/>/', '/script/i', '/doquery/i', '/http/i', '/javascript/i');
115
+$ListCensure = array('/</', '/>/', '/script/i', '/doquery/i', '/http/i', '/javascript/i');
116 116
 
117 117
 // Confirmation record types
118
-define('CONFIRM_REGISTRATION'  , 1);
118
+define('CONFIRM_REGISTRATION', 1);
119 119
 define('CONFIRM_PASSWORD_RESET', 2);
120
-define('CONFIRM_DELETE'        , 3);
120
+define('CONFIRM_DELETE', 3);
121 121
 
122 122
 define('AFFILIATE_MM_TO_REFERRAL_DM', 2);
123 123
 
124 124
 // Ally diplomacy statuses
125
-define('ALLY_DIPLOMACY_SELF'         , 'self');
126
-define('ALLY_DIPLOMACY_NEUTRAL'      , 'neutral');
127
-define('ALLY_DIPLOMACY_WAR'          , 'war');
128
-define('ALLY_DIPLOMACY_PEACE'        , 'peace');
125
+define('ALLY_DIPLOMACY_SELF', 'self');
126
+define('ALLY_DIPLOMACY_NEUTRAL', 'neutral');
127
+define('ALLY_DIPLOMACY_WAR', 'war');
128
+define('ALLY_DIPLOMACY_PEACE', 'peace');
129 129
 define('ALLY_DIPLOMACY_CONFEDERATION', 'confederation');
130
-define('ALLY_DIPLOMACY_FEDERATION'   , 'federation');
131
-define('ALLY_DIPLOMACY_UNION'        , 'union');
132
-define('ALLY_DIPLOMACY_MASTER'       , 'master');
133
-define('ALLY_DIPLOMACY_SLAVE'        , 'slave');
130
+define('ALLY_DIPLOMACY_FEDERATION', 'federation');
131
+define('ALLY_DIPLOMACY_UNION', 'union');
132
+define('ALLY_DIPLOMACY_MASTER', 'master');
133
+define('ALLY_DIPLOMACY_SLAVE', 'slave');
134 134
 
135 135
 define('ALLY_PROPOSE_SEND', 0);
136 136
 
137 137
 // Quest types
138
-define('QUEST_TYPE_BUILD'   , 1);
138
+define('QUEST_TYPE_BUILD', 1);
139 139
 define('QUEST_TYPE_RESEARCH', 2);
140
-define('QUEST_TYPE_COMBAT'  , 3);
140
+define('QUEST_TYPE_COMBAT', 3);
141 141
 
142
-define('QUEST_STATUS_NOT_STARTED' , 0);
143
-define('QUEST_STATUS_STARTED'     , 1);
144
-define('QUEST_STATUS_COMPLETE'    , 2);
142
+define('QUEST_STATUS_NOT_STARTED', 0);
143
+define('QUEST_STATUS_STARTED', 1);
144
+define('QUEST_STATUS_COMPLETE', 2);
145 145
 
146 146
 // *** Combat-related constants
147 147
 // *** Mission Type constants starts with MT_
148
-define('MT_NONE'     ,  0);
149
-define('MT_ATTACK'   ,  1);
150
-define('MT_ACS'      ,  2);
151
-define('MT_TRANSPORT',  3);
152
-define('MT_RELOCATE' ,  4);
153
-define('MT_HOLD'     ,  5);
154
-define('MT_SPY'      ,  6);
155
-define('MT_COLONIZE' ,  7);
156
-define('MT_RECYCLE'  ,  8);
157
-define('MT_DESTROY'  ,  9);
158
-define('MT_MISSILE'  , 10);
159
-define('MT_EXPLORE'  , 15);
148
+define('MT_NONE', 0);
149
+define('MT_ATTACK', 1);
150
+define('MT_ACS', 2);
151
+define('MT_TRANSPORT', 3);
152
+define('MT_RELOCATE', 4);
153
+define('MT_HOLD', 5);
154
+define('MT_SPY', 6);
155
+define('MT_COLONIZE', 7);
156
+define('MT_RECYCLE', 8);
157
+define('MT_DESTROY', 9);
158
+define('MT_MISSILE', 10);
159
+define('MT_EXPLORE', 15);
160 160
 
161 161
 // *** Planet Target constants starts with PT_
162 162
 define('PT_NONE', 0);
163 163
 define('PT_ALL', 0);
164 164
 define('PT_PLANET', 1);
165 165
 define('PT_DEBRIS', 2);
166
-define('PT_MOON'  , 3);
166
+define('PT_MOON', 3);
167 167
 
168 168
 // *** Unit locations - shows db table where unit belong
169 169
 // Also cache indexes
170
-define('LOC_NONE',    -1);
170
+define('LOC_NONE', -1);
171 171
 define('LOC_UNIVERSE', 0);
172
-define('LOC_PLANET',   1);
173
-define('LOC_DEBRIS',   2); // Translates to `planets` table planet_type = 1, `debris_*` fields
174
-define('LOC_MOON',     3); // Translates to `planets` table planet_type = 3
175
-define('LOC_USER',     4);
176
-define('LOC_FLEET',    5);
177
-define('LOC_ALLY',     6);
178
-define('LOC_UNIT_NUMERIC',     7);
179
-define('LOC_UNIT_LIST',     8);
172
+define('LOC_PLANET', 1);
173
+define('LOC_DEBRIS', 2); // Translates to `planets` table planet_type = 1, `debris_*` fields
174
+define('LOC_MOON', 3); // Translates to `planets` table planet_type = 3
175
+define('LOC_USER', 4);
176
+define('LOC_FLEET', 5);
177
+define('LOC_ALLY', 6);
178
+define('LOC_UNIT_NUMERIC', 7);
179
+define('LOC_UNIT_LIST', 8);
180 180
 
181 181
 // ТОЛЬКО ВНУТРЕНЕЕ!!!
182
-define('LOC_UNIT',    'LOC_UNIT');
183
-define('LOC_QUE',     'LOC_QUE');
184
-define('LOC_LOCATION','LOC_LOCATION');
185
-define('LOC_LOCKS','LOC_LOCKS');
182
+define('LOC_UNIT', 'LOC_UNIT');
183
+define('LOC_QUE', 'LOC_QUE');
184
+define('LOC_LOCATION', 'LOC_LOCATION');
185
+define('LOC_LOCKS', 'LOC_LOCKS');
186 186
 
187 187
 // *** Caching masks
188
-define('CACHE_NOTHING'    ,  0);
189
-define('CACHE_FLEET'      ,  1);
190
-define('CACHE_PLANET'     ,  2);
191
-define('CACHE_USER'       ,  4);
192
-define('CACHE_SOURCE'     ,  8);
188
+define('CACHE_NOTHING', 0);
189
+define('CACHE_FLEET', 1);
190
+define('CACHE_PLANET', 2);
191
+define('CACHE_USER', 4);
192
+define('CACHE_SOURCE', 8);
193 193
 define('CACHE_DESTINATION', 16);
194
-define('CACHE_EVENT'      , 32);
194
+define('CACHE_EVENT', 32);
195 195
 
196
-define('CACHE_USER_SRC'  , CACHE_USER | CACHE_SOURCE);
197
-define('CACHE_USER_DST'  , CACHE_USER | CACHE_DESTINATION);
196
+define('CACHE_USER_SRC', CACHE_USER | CACHE_SOURCE);
197
+define('CACHE_USER_DST', CACHE_USER | CACHE_DESTINATION);
198 198
 define('CACHE_PLANET_SRC', CACHE_PLANET | CACHE_SOURCE);
199 199
 define('CACHE_PLANET_DST', CACHE_PLANET | CACHE_DESTINATION);
200
-define('CACHE_COMBAT'    , CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION);
200
+define('CACHE_COMBAT', CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION);
201 201
 
202
-define('CACHE_ALL'       , CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION | CACHE_EVENT);
202
+define('CACHE_ALL', CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION | CACHE_EVENT);
203 203
 
204
-define('CACHE_NONE'      , CACHE_NOTHING); // Alias for me
204
+define('CACHE_NONE', CACHE_NOTHING); // Alias for me
205 205
 
206 206
 // *** Event types
207 207
 define('EVENT_FLEET_ARRIVE', 1);
208
-define('EVENT_FLEET_STAY'  , 2);
208
+define('EVENT_FLEET_STAY', 2);
209 209
 define('EVENT_FLEET_RETURN', 3);
210 210
 
211 211
 // *** Constants for changing DM
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 
259 259
 
260 260
 // Operation error status HARDCODE!
261
-define('ERR_NONE'               , 0); // No error
262
-define('ERR_WARNING'            , 1); // There is warning - something altering normal operation process
263
-define('ERR_ERROR'              , 2); // There is error - something permits operation from process
264
-define('ERR_HACK'               , 4); // Operation is qualified as hack attempt
261
+define('ERR_NONE', 0); // No error
262
+define('ERR_WARNING', 1); // There is warning - something altering normal operation process
263
+define('ERR_ERROR', 2); // There is error - something permits operation from process
264
+define('ERR_HACK', 4); // Operation is qualified as hack attempt
265 265
 // New GLOBAL operation results
266 266
 //define('RESULT_DEFAULT' , 0); // Default result - all went OK or result really doesn't matter
267 267
 //define('RESULT_WARNING' , 1);
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 define('SN_PAYMENT_REQUEST_OK', 0);
282 282
 define('SN_PAYMENT_REQUEST_ERROR_UNIT_AMOUNT', 1);
283 283
 define('SN_PAYMENT_REQUEST_ERROR_PAYLINK_UNSUPPORTED', 2);
284
-define('SN_PAYMENT_REQUEST_IP_WRONG', 3);  // Неправильный IP входящей системы - обычно хак
284
+define('SN_PAYMENT_REQUEST_IP_WRONG', 3); // Неправильный IP входящей системы - обычно хак
285 285
 define('SN_PAYMENT_REQUEST_COMMAND_UNSUPPORTED', 4); // Неподдерживаемая команда - обычно хак
286 286
 define('SN_PAYMENT_REQUEST_SIGNATURE_INVALID', 5); // Неправильная подпись или не сошлась контрольная сумма - обычно хак
287 287
 define('SN_MODULE_DISABLED', 6); // Модуль отключен // УНИВЕРСАЛЬНЫЙ ОТВЕТ!
@@ -554,16 +554,16 @@  discard block
 block discarded – undo
554 554
 //define('F_DEVICE_ID',     'F_DEVICE_ID');
555 555
 //define('F_DEVICE_CYPHER', 'F_DEVICE_CYPHER');
556 556
 
557
-define('F_PROVIDER_ID',   'F_PROVIDER_ID');
557
+define('F_PROVIDER_ID', 'F_PROVIDER_ID');
558 558
 // define('F_PROVIDER_LIST', 'F_PROVIDER_LIST');
559 559
 
560 560
 define('F_IMPERSONATE_STATUS', 'F_IMPERSONATE_STATUS');
561 561
 define('F_IMPERSONATE_OPERATOR', 'F_IMPERSONATE_OPERATOR');
562 562
 
563
-define('F_LOGIN_STATUS',  'F_LOGIN_STATUS');
563
+define('F_LOGIN_STATUS', 'F_LOGIN_STATUS');
564 564
 define('F_LOGIN_MESSAGE', 'F_LOGIN_MESSAGE');
565 565
 
566
-define('F_PLAYER_REGISTER_STATUS',  'F_PLAYER_REGISTER_STATUS');
566
+define('F_PLAYER_REGISTER_STATUS', 'F_PLAYER_REGISTER_STATUS');
567 567
 define('F_PLAYER_REGISTER_MESSAGE', 'F_PLAYER_REGISTER_MESSAGE');
568 568
 
569 569
 define('F_USER_ID', 'F_USER_ID');
@@ -607,66 +607,66 @@  discard block
 block discarded – undo
607 607
 
608 608
 
609 609
 // Option groups
610
-define('OPT_ALL',      0);
611
-define('OPT_MESSAGE',  1);
610
+define('OPT_ALL', 0);
611
+define('OPT_MESSAGE', 1);
612 612
 define('OPT_UNIVERSE', 2);
613 613
 define('OPT_INTERFACE', 3);
614 614
 
615 615
 // Message classes
616
-define('MSG_TYPE_OUTBOX'   ,  -1);
617
-define('MSG_TYPE_SPY'      ,   0);
618
-define('MSG_TYPE_PLAYER'   ,   1);
619
-define('MSG_TYPE_ALLIANCE' ,   2);
620
-define('MSG_TYPE_COMBAT'   ,   3);
621
-define('MSG_TYPE_RECYCLE'  ,   4);
622
-define('MSG_TYPE_TRANSPORT',   5);
623
-define('MSG_TYPE_ADMIN'    ,   6);
624
-define('MSG_TYPE_EXPLORE'  ,  15);
625
-define('MSG_TYPE_QUE'      ,  99);
626
-define('MSG_TYPE_NEW'      , 100);
616
+define('MSG_TYPE_OUTBOX', -1);
617
+define('MSG_TYPE_SPY', 0);
618
+define('MSG_TYPE_PLAYER', 1);
619
+define('MSG_TYPE_ALLIANCE', 2);
620
+define('MSG_TYPE_COMBAT', 3);
621
+define('MSG_TYPE_RECYCLE', 4);
622
+define('MSG_TYPE_TRANSPORT', 5);
623
+define('MSG_TYPE_ADMIN', 6);
624
+define('MSG_TYPE_EXPLORE', 15);
625
+define('MSG_TYPE_QUE', 99);
626
+define('MSG_TYPE_NEW', 100);
627 627
 
628 628
 // Attack verification statuses
629
-define('FLIGHT_ALLOWED'           ,  0);
630
-define('FLIGHT_VECTOR_NO_TARGET'         ,  1);
631
-define('FLIGHT_PLAYER_OWN'               ,  2);
632
-define('FLIGHT_MISSION_IMPOSSIBLE'     ,  3);
633
-define('FLIGHT_MISSION_HOLD_NO_ALLY_DEPOSIT'   ,  4);
634
-define('FLIGHT_MISSION_RECYCLE_NO_DEBRIS'         ,  5);
635
-define('FLIGHT_PLAYER_VACATION'          ,  6);
636
-define('FLIGHT_PLAYER_SAME_IP'           ,  7);
637
-define('FLIGHT_PLAYER_BUFFING'           ,  8);
638
-define('FLIGHT_PLAYER_ADMIN'             ,  9);
639
-define('FLIGHT_PLAYER_NOOB'              , 10);
640
-define('FLIGHT_PLAYER_VACATION_OWN'      , 11);
641
-define('FLIGHT_MISSION_MISSILE_NO_SILO'           , 12);
642
-define('FLIGHT_MISSION_MISSILE_NO_MISSILES'        , 13);
643
-define('FLIGHT_SHIPS_NO_SHIPS'          , 14);
644
-define('FLIGHT_FLEET_NO_SLOTS'          , 15);
645
-define('FLIGHT_SHIPS_NOT_ENOUGH_OR_RESOURCES'          , 16);
646
-define('FLIGHT_SHIPS_NO_RECYCLERS'      , 17);
647
-define('FLIGHT_MISSION_SPY_NO_SPIES'          , 18);
648
-define('FLIGHT_SHIPS_NO_COLONIZER'      , 19);
649
-define('FLIGHT_MISSION_MISSILE_TOO_FAR'   , 20);
650
-define('FLIGHT_MISSION_MISSILE_WRONG_STRUCTURE'   , 21);
651
-define('FLIGHT_RESOURCES_FUEL_NOT_ENOUGH'           , 22);
652
-define('FLIGHT_RESOURCES_NOT_ENOUGH'      , 23);
653
-define('FLIGHT_MISSION_ACS_NOT_EXISTS'            , 24);
654
-define('FLIGHT_MISSION_ACS_MISSTARGET'    , 25);
655
-define('FLIGHT_FLEET_SPEED_WRONG'       , 26);
656
-define('FLIGHT_MISSION_ACS_TOO_LATE'      , 27);
657
-define('FLIGHT_MISSION_ATTACK_BASHING'           , 28);
658
-define('FLIGHT_MISSION_ATTACK_BASHING_WAR_DELAY' , 29);
659
-define('FLIGHT_MISSION_ACS_WRONG_TARGET'  , 30);
660
-define('FLIGHT_VECTOR_SAME_SOURCE'              , 31);
629
+define('FLIGHT_ALLOWED', 0);
630
+define('FLIGHT_VECTOR_NO_TARGET', 1);
631
+define('FLIGHT_PLAYER_OWN', 2);
632
+define('FLIGHT_MISSION_IMPOSSIBLE', 3);
633
+define('FLIGHT_MISSION_HOLD_NO_ALLY_DEPOSIT', 4);
634
+define('FLIGHT_MISSION_RECYCLE_NO_DEBRIS', 5);
635
+define('FLIGHT_PLAYER_VACATION', 6);
636
+define('FLIGHT_PLAYER_SAME_IP', 7);
637
+define('FLIGHT_PLAYER_BUFFING', 8);
638
+define('FLIGHT_PLAYER_ADMIN', 9);
639
+define('FLIGHT_PLAYER_NOOB', 10);
640
+define('FLIGHT_PLAYER_VACATION_OWN', 11);
641
+define('FLIGHT_MISSION_MISSILE_NO_SILO', 12);
642
+define('FLIGHT_MISSION_MISSILE_NO_MISSILES', 13);
643
+define('FLIGHT_SHIPS_NO_SHIPS', 14);
644
+define('FLIGHT_FLEET_NO_SLOTS', 15);
645
+define('FLIGHT_SHIPS_NOT_ENOUGH_OR_RESOURCES', 16);
646
+define('FLIGHT_SHIPS_NO_RECYCLERS', 17);
647
+define('FLIGHT_MISSION_SPY_NO_SPIES', 18);
648
+define('FLIGHT_SHIPS_NO_COLONIZER', 19);
649
+define('FLIGHT_MISSION_MISSILE_TOO_FAR', 20);
650
+define('FLIGHT_MISSION_MISSILE_WRONG_STRUCTURE', 21);
651
+define('FLIGHT_RESOURCES_FUEL_NOT_ENOUGH', 22);
652
+define('FLIGHT_RESOURCES_NOT_ENOUGH', 23);
653
+define('FLIGHT_MISSION_ACS_NOT_EXISTS', 24);
654
+define('FLIGHT_MISSION_ACS_MISSTARGET', 25);
655
+define('FLIGHT_FLEET_SPEED_WRONG', 26);
656
+define('FLIGHT_MISSION_ACS_TOO_LATE', 27);
657
+define('FLIGHT_MISSION_ATTACK_BASHING', 28);
658
+define('FLIGHT_MISSION_ATTACK_BASHING_WAR_DELAY', 29);
659
+define('FLIGHT_MISSION_ACS_WRONG_TARGET', 30);
660
+define('FLIGHT_VECTOR_SAME_SOURCE', 31);
661 661
 define('FLIGHT_RESOURCES_FORBIDDEN', 32);
662
-define('FLIGHT_RESOURCES_EMPTY'   , 33);
663
-define('FLIGHT_SHIPS_NOT_ONLY_SPIES'       , 34);
664
-define('FLIGHT_FLEET_TOO_FAR'           , 35);
665
-define('FLIGHT_FLEET_OVERLOAD'        , 36);
666
-define('FLIGHT_MISSION_UNKNOWN'    , 37);
667
-define('FLIGHT_SHIPS_UNIT_WRONG'        , 38);
668
-define('FLIGHT_SHIPS_UNMOVABLE'        , 39);
669
-define('FLIGHT_SHIPS_NEGATIVE'  , 40);
662
+define('FLIGHT_RESOURCES_EMPTY', 33);
663
+define('FLIGHT_SHIPS_NOT_ONLY_SPIES', 34);
664
+define('FLIGHT_FLEET_TOO_FAR', 35);
665
+define('FLIGHT_FLEET_OVERLOAD', 36);
666
+define('FLIGHT_MISSION_UNKNOWN', 37);
667
+define('FLIGHT_SHIPS_UNIT_WRONG', 38);
668
+define('FLIGHT_SHIPS_UNMOVABLE', 39);
669
+define('FLIGHT_SHIPS_NEGATIVE', 40);
670 670
 define('FLIGHT_RESOURCES_NEGATIVE', 41);
671 671
 define('FLIGHT_MISSION_MORATORIUM', 42);
672 672
 define('FLIGHT_PLAYER_CHILD_PROTECTION', 43);
@@ -681,12 +681,12 @@  discard block
 block discarded – undo
681 681
 
682 682
 
683 683
 // *** Races - Homeworlds
684
-define('RACE_NONE'    , 0);
685
-define('RACE_EARTH'   , 1);
686
-define('RACE_MOON'    , 2);
687
-define('RACE_MERCURY' , 3);
688
-define('RACE_VENUS'   , 4);
689
-define('RACE_MARS'    , 5);
684
+define('RACE_NONE', 0);
685
+define('RACE_EARTH', 1);
686
+define('RACE_MOON', 2);
687
+define('RACE_MERCURY', 3);
688
+define('RACE_VENUS', 4);
689
+define('RACE_MARS', 5);
690 690
 define('RACE_ASTEROID', 6);
691 691
 // define('MARKET_INFO'         , 7);
692 692
 
@@ -694,114 +694,114 @@  discard block
 block discarded – undo
694 694
 
695 695
 // *** Market variables
696 696
 // === Market blocks
697
-define('MARKET_ENTRY'        , 0);
698
-define('MARKET_RESOURCES'    , 1);
699
-define('MARKET_SCRAPPER'     , 2);
700
-define('MARKET_STOCKMAN'     , 3);
701
-define('MARKET_EXCHANGE'     , 4);
702
-define('MARKET_BANKER'       , 5);
703
-define('MARKET_PAWNSHOP'     , 6);
704
-define('MARKET_INFO'         , 7);
697
+define('MARKET_ENTRY', 0);
698
+define('MARKET_RESOURCES', 1);
699
+define('MARKET_SCRAPPER', 2);
700
+define('MARKET_STOCKMAN', 3);
701
+define('MARKET_EXCHANGE', 4);
702
+define('MARKET_BANKER', 5);
703
+define('MARKET_PAWNSHOP', 6);
704
+define('MARKET_INFO', 7);
705 705
 
706 706
 // === Market error statuses
707
-define('MARKET_NOTHING'              ,  0);
708
-define('MARKET_DEAL'                 ,  1);
709
-define('MARKET_DEAL_TRADE'           ,  2);
710
-define('MARKET_NO_DM'                ,  3);
711
-define('MARKET_NO_RESOURCES'         ,  4);
712
-define('MARKET_ZERO_DEAL'            ,  5);
713
-define('MARKET_NO_SHIPS'             ,  6);
714
-define('MARKET_NOT_A_SHIP'           ,  7);
715
-define('MARKET_NO_STOCK'             ,  8);
716
-define('MARKET_ZERO_RES_STOCK'       ,  9);
717
-define('MARKET_NEGATIVE_SHIPS'       , 10);
718
-
719
-define('MARKET_INFO_PLAYER'          , 12);
720
-define('MARKET_INFO_WRONG'           , 11);
707
+define('MARKET_NOTHING', 0);
708
+define('MARKET_DEAL', 1);
709
+define('MARKET_DEAL_TRADE', 2);
710
+define('MARKET_NO_DM', 3);
711
+define('MARKET_NO_RESOURCES', 4);
712
+define('MARKET_ZERO_DEAL', 5);
713
+define('MARKET_NO_SHIPS', 6);
714
+define('MARKET_NOT_A_SHIP', 7);
715
+define('MARKET_NO_STOCK', 8);
716
+define('MARKET_ZERO_RES_STOCK', 9);
717
+define('MARKET_NEGATIVE_SHIPS', 10);
718
+
719
+define('MARKET_INFO_PLAYER', 12);
720
+define('MARKET_INFO_WRONG', 11);
721 721
 define('MARKET_INFO_PLAYER_NOT_FOUND', 13);
722
-define('MARKET_INFO_PLAYER_WRONG'    , 14);
723
-define('MARKET_INFO_PLAYER_SAME'     , 15);
722
+define('MARKET_INFO_PLAYER_WRONG', 14);
723
+define('MARKET_INFO_PLAYER_SAME', 15);
724 724
 
725 725
 
726 726
 
727 727
 
728 728
 // *** Mercenary/talent bonus types
729
-define('BONUS_NONE'    ,            0);  // No bonus
730
-define('BONUS_PERCENT' ,            1);  // Percent on base value
731
-define('BONUS_ADD'     ,            2);  // Add
732
-define('BONUS_ABILITY' ,            3);  // Some ability
733
-define('BONUS_MULTIPLY',            4);  // Multiply by value
734
-define('BONUS_PERCENT_CUMULATIVE' , 5);  // Cumulative percent on base value
735
-define('BONUS_PERCENT_DEGRADED' ,   6);  // Bonus amount degraded with increase as pow(bonus, level) (?)
736
-define('BONUS_SPEED',               7);  // Speed bonus
729
+define('BONUS_NONE', 0); // No bonus
730
+define('BONUS_PERCENT', 1); // Percent on base value
731
+define('BONUS_ADD', 2); // Add
732
+define('BONUS_ABILITY', 3); // Some ability
733
+define('BONUS_MULTIPLY', 4); // Multiply by value
734
+define('BONUS_PERCENT_CUMULATIVE', 5); // Cumulative percent on base value
735
+define('BONUS_PERCENT_DEGRADED', 6); // Bonus amount degraded with increase as pow(bonus, level) (?)
736
+define('BONUS_SPEED', 7); // Speed bonus
737 737
 
738 738
 // *** Action constant (build should be replaced with ACTION)
739
-define('BUILD_CREATE' ,  1);
739
+define('BUILD_CREATE', 1);
740 740
 define('BUILD_DESTROY', -1);
741 741
 define('BUILD_AUTOCONVERT', 2);
742 742
 
743
-define('ACTION_SELL'       , -1);
744
-define('ACTION_NOTHING'    ,  0);
745
-define('ACTION_BUY'        ,  1);
746
-define('ACTION_USE'        ,  2);
747
-define('ACTION_DELETE'     ,  3);
743
+define('ACTION_SELL', -1);
744
+define('ACTION_NOTHING', 0);
745
+define('ACTION_BUY', 1);
746
+define('ACTION_USE', 2);
747
+define('ACTION_DELETE', 3);
748 748
 
749 749
 // *** Check unit availability codes
750
-define('BUILD_ALLOWED'         , 0); // HARDCODED! DO NOT CHANGE!
750
+define('BUILD_ALLOWED', 0); // HARDCODED! DO NOT CHANGE!
751 751
 define('BUILD_REQUIRE_NOT_MEET', 1);
752
-define('BUILD_AMOUNT_WRONG'    , 2);
753
-define('BUILD_QUE_WRONG'       , 3);
754
-define('BUILD_QUE_UNIT_WRONG'  , 4);
755
-define('BUILD_INDESTRUCTABLE'  , 5);
756
-define('BUILD_NO_RESOURCES'    , 6);
757
-define('BUILD_NO_UNITS'        , 7);
758
-define('BUILD_UNIT_BUSY'       , 8);
759
-define('BUILD_QUE_FULL'        , 9);
760
-define('BUILD_SILO_FULL'       ,10);
761
-define('BUILD_MAX_REACHED'     ,11);
762
-define('BUILD_SECTORS_NONE'    ,12);
752
+define('BUILD_AMOUNT_WRONG', 2);
753
+define('BUILD_QUE_WRONG', 3);
754
+define('BUILD_QUE_UNIT_WRONG', 4);
755
+define('BUILD_INDESTRUCTABLE', 5);
756
+define('BUILD_NO_RESOURCES', 6);
757
+define('BUILD_NO_UNITS', 7);
758
+define('BUILD_UNIT_BUSY', 8);
759
+define('BUILD_QUE_FULL', 9);
760
+define('BUILD_SILO_FULL', 10);
761
+define('BUILD_MAX_REACHED', 11);
762
+define('BUILD_SECTORS_NONE', 12);
763 763
 define('BUILD_AUTOCONVERT_AVAILABLE', 13);
764 764
 
765 765
 
766 766
 // *** Que types
767 767
 define('QUE_STRUCTURES', 1);
768
-define('QUE_HANGAR'    , 4);
769
-define('QUE_RESEARCH'  , 7);
770
-define('QUE_MERCENARY' , 600); // UNIT_MERCENARIES
768
+define('QUE_HANGAR', 4);
769
+define('QUE_RESEARCH', 7);
770
+define('QUE_MERCENARY', 600); // UNIT_MERCENARIES
771 771
 // *** Subque types
772
-define('SUBQUE_PLANET'  , 1);
773
-define('SUBQUE_MOON'    , 3);
774
-define('SUBQUE_FLEET'   , 4);
775
-define('SUBQUE_DEFENSE' , 6);
772
+define('SUBQUE_PLANET', 1);
773
+define('SUBQUE_MOON', 3);
774
+define('SUBQUE_FLEET', 4);
775
+define('SUBQUE_DEFENSE', 6);
776 776
 define('SUBQUE_RESEARCH', 7);
777 777
 
778 778
 // *** Que items
779
-define('QI_UNIT_ID'   , 0);
780
-define('QI_AMOUNT'    , 1);
781
-define('QI_TIME'      , 2);
782
-define('QI_MODE'      , 3);
783
-define('QI_QUE_ID'    , 4);
784
-define('QI_QUE_TYPE'  , 4);
785
-define('QI_PLANET_ID' , 5);
779
+define('QI_UNIT_ID', 0);
780
+define('QI_AMOUNT', 1);
781
+define('QI_TIME', 2);
782
+define('QI_MODE', 3);
783
+define('QI_QUE_ID', 4);
784
+define('QI_QUE_TYPE', 4);
785
+define('QI_PLANET_ID', 5);
786 786
 
787 787
 
788 788
 // *** Units
789 789
 
790 790
 // *** Sort options
791
-define('SORT_ASCENDING' , 0);
791
+define('SORT_ASCENDING', 0);
792 792
 define('SORT_DESCENDING', 1);
793 793
 
794
-define('SORT_ID'             , 0);
795
-define('SORT_LOCATION'       , 1);
796
-define('SORT_NAME'           , 2);
797
-define('SORT_SIZE'           , 3);
798
-define('SORT_EMAIL'          , 4);
799
-define('SORT_IP'             , 5);
794
+define('SORT_ID', 0);
795
+define('SORT_LOCATION', 1);
796
+define('SORT_NAME', 2);
797
+define('SORT_SIZE', 3);
798
+define('SORT_EMAIL', 4);
799
+define('SORT_IP', 5);
800 800
 define('SORT_TIME_REGISTERED', 6);
801 801
 define('SORT_TIME_LAST_VISIT', 7);
802
-define('SORT_TIME_BAN_UNTIL' , 8);
803
-define('SORT_REFERRAL_COUNT' , 9);
804
-define('SORT_REFERRAL_DM'    , 10);
802
+define('SORT_TIME_BAN_UNTIL', 8);
803
+define('SORT_REFERRAL_COUNT', 9);
804
+define('SORT_REFERRAL_DM', 10);
805 805
 
806 806
 
807 807
 define('HULL_SIZE_TINY', 1);
@@ -944,10 +944,10 @@  discard block
 block discarded – undo
944 944
 
945 945
 // === Artifacts
946 946
 define('UNIT_ARTIFACTS', 1000);
947
-define('ART_LHC', 1001);      // Additional moon chance
948
-define('ART_RCD_SMALL', 1002);   // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
949
-define('ART_RCD_MEDIUM', 1003);  // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
950
-define('ART_RCD_LARGE', 1004);   // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
947
+define('ART_LHC', 1001); // Additional moon chance
948
+define('ART_RCD_SMALL', 1002); // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
949
+define('ART_RCD_MEDIUM', 1003); // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
950
+define('ART_RCD_LARGE', 1004); // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
951 951
 define('ART_HEURISTIC_CHIP', 1005); // Speed up research
952 952
 define('ART_NANO_BUILDER', 1006); // Speed up building
953 953
 define('ART_NANO_CONSTRUCTOR', 1007); // RESERVED Speed up hangar constructions
@@ -1018,18 +1018,18 @@  discard block
 block discarded – undo
1018 1018
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE1', 2201); // Блиц-сервер, участник 0-го раунда, 1-е место
1019 1019
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE2', 2202); // Блиц-сервер, участник 0-го раунда, 2-е место
1020 1020
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE3', 2203); // Блиц-сервер, участник 0-го раунда, 3-е место
1021
-define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204);  // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1021
+define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1022 1022
 
1023 1023
 define('UNIT_AWARD_MEMORY', 2300); // Памятные знаки за существование и участие - например "4 года в игре". "Был онлайн в новогоднюю ночь 2013". итд
1024
-define('UNIT_AWARD_MEMORY_IMMORTAL', 2301);  // Бессмертный
1025
-define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1024
+define('UNIT_AWARD_MEMORY_IMMORTAL', 2301); // Бессмертный
1025
+define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1026 1026
 define('UNIT_AWARD_MEMORY_BLITZ_R0', 2303); // Блиц-сервер, участник 0-го раунда
1027 1027
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SIMPLE', 2304); // День Рождения СН
1028 1028
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_BRONZE', 2305); // День Рождения СН
1029 1029
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SILVER', 2306); // День Рождения СН
1030 1030
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_GOLD', 2307); // День Рождения СН
1031 1031
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_PLATINUM', 2308); // День Рождения СН
1032
-define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1032
+define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1033 1033
 
1034 1034
 define('UNIT_AWARD_PENNANT', 2400); // Переходящий вымпел - индикация статуса на сервере: "Топ-1", "Топ", "Сабтоп", "Самый большой флот" итд
1035 1035
 define('UNIT_AWARD_BADGE', 2600); // Бейджики/значки за ачивки - например, "Построил 1000 кораблей"
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 
1127 1127
 define('UNIT_NEXT', 4000); // !!! Next unit start on 4000 !!!
1128 1128
 
1129
-define('GROUP_PART',         800000);
1129
+define('GROUP_PART', 800000);
1130 1130
 // Зарезервировано для запчастей: 800.001 - 899.999
1131 1131
 // define('GROUP_PART_HULL',    801000); // Корпуса - 1000 штук
1132 1132
 // define('GROUP_PART_ARMOR',   802000); // Броня - 1000 штук
@@ -1383,32 +1383,32 @@  discard block
 block discarded – undo
1383 1383
 
1384 1384
 
1385 1385
 // define('NICK_ID',               -1);
1386
-define('NICK_HTML',              0);
1387
-
1388
-define('NICK_FIRST',             1);
1389
-define('NICK_RACE',           1000);
1390
-define('NICK_GENDER',         2000);
1391
-define('NICK_AWARD',          3000);
1392
-define('NICK_VACATION',       3500);
1393
-define('NICK_BIRTHSDAY',      4000);
1394
-define('NICK_PREMIUM',        5000);
1395
-define('NICK_AUTH_LEVEL',     6000);
1396
-
1397
-define('NICK_HIGHLIGHT',      6300);
1398
-define('NICK_CLASS',          6450);
1399
-
1400
-define('NICK_NICK_CLASS',     6600);
1401
-define('NICK_NICK',           7000);
1386
+define('NICK_HTML', 0);
1387
+
1388
+define('NICK_FIRST', 1);
1389
+define('NICK_RACE', 1000);
1390
+define('NICK_GENDER', 2000);
1391
+define('NICK_AWARD', 3000);
1392
+define('NICK_VACATION', 3500);
1393
+define('NICK_BIRTHSDAY', 4000);
1394
+define('NICK_PREMIUM', 5000);
1395
+define('NICK_AUTH_LEVEL', 6000);
1396
+
1397
+define('NICK_HIGHLIGHT', 6300);
1398
+define('NICK_CLASS', 6450);
1399
+
1400
+define('NICK_NICK_CLASS', 6600);
1401
+define('NICK_NICK', 7000);
1402 1402
 define('NICK_NICK_CLASS_END', 7300);
1403 1403
 
1404
-define('NICK_ALLY_CLASS',     7600);
1405
-define('NICK_ALLY',           8000);
1404
+define('NICK_ALLY_CLASS', 7600);
1405
+define('NICK_ALLY', 8000);
1406 1406
 define('NICK_ALLY_CLASS_END', 8300);
1407 1407
 
1408
-define('NICK_CLASS_END',      8450);
1409
-define('NICK_HIGHLIGHT_END',  8600);
1408
+define('NICK_CLASS_END', 8450);
1409
+define('NICK_HIGHLIGHT_END', 8600);
1410 1410
 
1411
-define('NICK_LAST',           9999);
1411
+define('NICK_LAST', 9999);
1412 1412
 
1413 1413
 // Настройки игрока
1414 1414
 define('PLAYER_OPTION_MENU_SORT', 1);
@@ -1501,8 +1501,8 @@  discard block
 block discarded – undo
1501 1501
 define('LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10', 1);
1502 1502
 
1503 1503
 define('BLITZ_REGISTER_DISABLED', 0);
1504
-define('BLITZ_REGISTER_OPEN'    , 1);
1505
-define('BLITZ_REGISTER_CLOSED'  , 2);
1504
+define('BLITZ_REGISTER_OPEN', 1);
1505
+define('BLITZ_REGISTER_CLOSED', 2);
1506 1506
 define('BLITZ_REGISTER_SHOW_LOGIN', 3);
1507 1507
 define('BLITZ_REGISTER_DISCLOSURE_NAMES', 4);
1508 1508
 
Please login to merge, or discard this patch.