@@ -9,19 +9,19 @@ discard block |
||
9 | 9 | $ts_var_stat_update = strtotime(classSupernova::$config->db_loadItem('var_stat_update')); |
10 | 10 | $ts_scheduled_update = sys_schedule_get_prev_run(classSupernova::$config->db_loadItem('stats_schedule'), classSupernova::$config->var_stat_update); |
11 | 11 | |
12 | - if(sys_get_param_int('admin_update')) { |
|
12 | + if (sys_get_param_int('admin_update')) { |
|
13 | 13 | define('USER_LEVEL', isset($user['authlevel']) ? $user['authlevel'] : -1); |
14 | - if(USER_LEVEL > 0) { |
|
14 | + if (USER_LEVEL > 0) { |
|
15 | 15 | $is_admin_request = true; |
16 | 16 | $ts_scheduled_update = SN_TIME_NOW; |
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | - if($ts_scheduled_update > $ts_var_stat_update) { |
|
20 | + if ($ts_scheduled_update > $ts_var_stat_update) { |
|
21 | 21 | lng_include('admin'); |
22 | 22 | sn_db_transaction_start(); |
23 | 23 | $ts_var_stat_update_end = strtotime(classSupernova::$config->db_loadItem('var_stat_update_end')); |
24 | - if(SN_TIME_NOW > $ts_var_stat_update_end) { |
|
24 | + if (SN_TIME_NOW > $ts_var_stat_update_end) { |
|
25 | 25 | $old_server_status = classSupernova::$config->db_loadItem('game_disable'); |
26 | 26 | classSupernova::$config->db_saveItem('game_disable', GAME_DISABLE_STAT); |
27 | 27 | |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | |
32 | 32 | $msg = $is_admin_request ? 'admin request' : 'scheduler'; |
33 | 33 | $next_run = date(FMT_DATE_TIME_SQL, sys_schedule_get_prev_run(classSupernova::$config->stats_schedule, classSupernova::$config->var_stat_update, true)); |
34 | - $msg = "Running stat updates: {$msg}. Config->var_stat_update = " . classSupernova::$config->var_stat_update . |
|
35 | - ', $ts_scheduled_update = ' . date(FMT_DATE_TIME_SQL, $ts_scheduled_update) . |
|
36 | - ', next_stat_update = ' . $next_run; |
|
34 | + $msg = "Running stat updates: {$msg}. Config->var_stat_update = ".classSupernova::$config->var_stat_update. |
|
35 | + ', $ts_scheduled_update = '.date(FMT_DATE_TIME_SQL, $ts_scheduled_update). |
|
36 | + ', next_stat_update = '.$next_run; |
|
37 | 37 | classSupernova::$debug->warning($msg, 'Stat update', LOG_INFO_STAT_PROCESS); |
38 | 38 | $total_time = microtime(true); |
39 | 39 | |
40 | 40 | // require_once('../includes/sys_stat.php'); |
41 | - require_once(SN_ROOT_PHYSICAL . 'includes/includes/sys_stat.php'); |
|
41 | + require_once(SN_ROOT_PHYSICAL.'includes/includes/sys_stat.php'); |
|
42 | 42 | sys_stat_calculate(); |
43 | 43 | |
44 | 44 | $total_time = microtime(true) - $total_time; |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | classSupernova::$config->db_saveItem('var_stat_update_admin_forced', SN_TIME_SQL); |
57 | 57 | classSupernova::$config->db_saveItem('var_stat_update_end', SN_TIME_SQL); |
58 | 58 | |
59 | - if($old_server_status == GAME_DISABLE_STAT) { |
|
59 | + if ($old_server_status == GAME_DISABLE_STAT) { |
|
60 | 60 | $old_server_status = GAME_DISABLE_NONE; |
61 | 61 | } |
62 | 62 | classSupernova::$config->db_saveItem('game_disable', $old_server_status); |
63 | - } elseif($ts_scheduled_update > $ts_var_stat_update) { |
|
63 | + } elseif ($ts_scheduled_update > $ts_var_stat_update) { |
|
64 | 64 | $timeout = strtotime(classSupernova::$config->db_loadItem('var_stat_update_end')) - SN_TIME_NOW; |
65 | 65 | $msg = classSupernova::$config->db_loadItem('var_stat_update_msg'); |
66 | 66 | $msg = "{$msg} ETA {$timeout} seconds. Please wait..."; |
67 | 67 | } |
68 | 68 | sn_db_transaction_rollback(); |
69 | - } elseif($is_admin_request) { |
|
69 | + } elseif ($is_admin_request) { |
|
70 | 70 | $msg = 'Stat is up to date'; |
71 | 71 | } |
72 | 72 |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | * @return static |
134 | 134 | */ |
135 | 135 | public function convertToVectorDynamic($coordinates, $prefix = '') { |
136 | - $this->galaxy = isset($coordinates[$prefix . 'galaxy']) ? intval($coordinates[$prefix . 'galaxy']) : 0; |
|
137 | - $this->system = isset($coordinates[$prefix . 'system']) ? intval($coordinates[$prefix . 'system']) : 0; |
|
138 | - $this->planet = isset($coordinates[$prefix . 'planet']) ? intval($coordinates[$prefix . 'planet']) : 0; |
|
139 | - $this->type = isset($coordinates[$prefix . 'type']) |
|
140 | - ? isset($coordinates[$prefix . 'type']) |
|
141 | - : (isset($coordinates[$prefix . 'planet_type']) ? intval($coordinates[$prefix . 'planet_type']) : 0); |
|
136 | + $this->galaxy = isset($coordinates[$prefix.'galaxy']) ? intval($coordinates[$prefix.'galaxy']) : 0; |
|
137 | + $this->system = isset($coordinates[$prefix.'system']) ? intval($coordinates[$prefix.'system']) : 0; |
|
138 | + $this->planet = isset($coordinates[$prefix.'planet']) ? intval($coordinates[$prefix.'planet']) : 0; |
|
139 | + $this->type = isset($coordinates[$prefix.'type']) |
|
140 | + ? isset($coordinates[$prefix.'type']) |
|
141 | + : (isset($coordinates[$prefix.'planet_type']) ? intval($coordinates[$prefix.'planet_type']) : 0); |
|
142 | 142 | |
143 | 143 | return $this; |
144 | 144 | } |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function toArray($prefix = '') { |
152 | 152 | $array = array( |
153 | - $prefix . 'galaxy' => $this->galaxy, |
|
154 | - $prefix . 'system' => $this->system, |
|
155 | - $prefix . 'planet' => $this->planet, |
|
156 | - $prefix . 'type' => $this->type, |
|
153 | + $prefix.'galaxy' => $this->galaxy, |
|
154 | + $prefix.'system' => $this->system, |
|
155 | + $prefix.'planet' => $this->planet, |
|
156 | + $prefix.'type' => $this->type, |
|
157 | 157 | ); |
158 | 158 | |
159 | 159 | return $array; |
@@ -93,28 +93,28 @@ discard block |
||
93 | 93 | public function __construct(\Common\GlobalContainer $gc) { |
94 | 94 | parent::__construct($gc); |
95 | 95 | |
96 | - $this->accessors->set(P_CONTAINER_SET, 'dbId', function (V2FleetContainer $that, $value) { |
|
96 | + $this->accessors->set(P_CONTAINER_SET, 'dbId', function(V2FleetContainer $that, $value) { |
|
97 | 97 | $that->setDirect('dbId', $value); |
98 | 98 | $that->location->setLocationId($value); |
99 | 99 | }); |
100 | 100 | |
101 | - $this->accessors->set(P_CONTAINER_SET, 'ownerId', function (V2FleetContainer $that, $value) { |
|
101 | + $this->accessors->set(P_CONTAINER_SET, 'ownerId', function(V2FleetContainer $that, $value) { |
|
102 | 102 | $that->setDirect('ownerId', $value); |
103 | 103 | $that->location->setLocationPlayerId($value); |
104 | 104 | }); |
105 | 105 | |
106 | - $this->accessors->set(P_CONTAINER_SET, 'owner', function (V2FleetContainer $that, $value) { |
|
106 | + $this->accessors->set(P_CONTAINER_SET, 'owner', function(V2FleetContainer $that, $value) { |
|
107 | 107 | $that->owner = $value; |
108 | - if(isset($value['id'])) { |
|
108 | + if (isset($value['id'])) { |
|
109 | 109 | $that->ownerId = $value['id']; |
110 | 110 | } else { |
111 | 111 | $that->ownerId = 0; |
112 | 112 | } |
113 | 113 | }); |
114 | 114 | |
115 | - $this->accessors->set(P_CONTAINER_SET, 'departure', function (V2FleetContainer $that, $value) { |
|
115 | + $this->accessors->set(P_CONTAINER_SET, 'departure', function(V2FleetContainer $that, $value) { |
|
116 | 116 | $that->departure = $value; |
117 | - if(isset($value['id'])) { |
|
117 | + if (isset($value['id'])) { |
|
118 | 118 | $that->departurePlanetId = $value['id']; |
119 | 119 | $that->vectorDeparture = $value; |
120 | 120 | } else { |
@@ -122,20 +122,20 @@ discard block |
||
122 | 122 | } |
123 | 123 | }); |
124 | 124 | |
125 | - $this->accessors->set(P_CONTAINER_GET, 'vectorDeparture', function (V2FleetContainer $that) { |
|
125 | + $this->accessors->set(P_CONTAINER_GET, 'vectorDeparture', function(V2FleetContainer $that) { |
|
126 | 126 | $vector = new Vector(); |
127 | 127 | $that->setDirect('vectorDeparture', $vector); |
128 | 128 | |
129 | 129 | return $vector; |
130 | 130 | }, ACCESSOR_SHARED); |
131 | - $this->accessors->set(P_CONTAINER_SET, 'vectorDeparture', function (V2FleetContainer $that, $value) { |
|
131 | + $this->accessors->set(P_CONTAINER_SET, 'vectorDeparture', function(V2FleetContainer $that, $value) { |
|
132 | 132 | $vector = $that->vectorDeparture; |
133 | 133 | |
134 | - if(is_array($value)) { |
|
134 | + if (is_array($value)) { |
|
135 | 135 | $value = Vector::convertToVector($value); |
136 | 136 | } |
137 | 137 | |
138 | - if($value instanceof Vector) { |
|
138 | + if ($value instanceof Vector) { |
|
139 | 139 | $vector->readFromVector($value); |
140 | 140 | } else { |
141 | 141 | throw new \Exception('V2Fleet::vectorDeparture setter - value is not a Vector or array!', ERR_ERROR); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $this->accessors->set(P_CONTAINER_EXPORT, 'vectorArrive', array($this, 'exportVector')); |
149 | 149 | |
150 | 150 | |
151 | - $this->accessors->set(P_CONTAINER_GET, 'location', function (V2FleetContainer $that) { |
|
151 | + $this->accessors->set(P_CONTAINER_GET, 'location', function(V2FleetContainer $that) { |
|
152 | 152 | // if (is_null($location = $that->getDirect('location'))) {} |
153 | 153 | $location = new V2Location(LOC_FLEET); |
154 | 154 | $that->setDirect('location', $location); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | return $location; |
157 | 157 | }, ACCESSOR_SHARED); |
158 | 158 | |
159 | - $this->accessors->set(P_CONTAINER_GET, 'units', function (V2FleetContainer $that) { |
|
159 | + $this->accessors->set(P_CONTAINER_GET, 'units', function(V2FleetContainer $that) { |
|
160 | 160 | // if (is_null($units = $that->getDirect('units'))) {} |
161 | 161 | $units = \classSupernova::$gc->unitList; |
162 | 162 | $that->setDirect('units', $units); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | return $units; |
165 | 165 | }, ACCESSOR_SHARED); |
166 | 166 | |
167 | - $this->accessors->set(P_CONTAINER_GET, 'isReturning', function (V2FleetContainer $that) { |
|
167 | + $this->accessors->set(P_CONTAINER_GET, 'isReturning', function(V2FleetContainer $that) { |
|
168 | 168 | return $that->status == FLEET_FLAG_RETURNING; |
169 | 169 | }); |
170 | 170 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | use DBStatic\DBStaticPlanet; |
34 | 34 | use DBStatic\DBStaticUser; |
35 | 35 | |
36 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
36 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
37 | 37 | |
38 | 38 | //$ccc = 0; |
39 | 39 | //foreach(DBStatic\DBStaticUser::db_user_list_non_bots() as $ip) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $result = array(); |
54 | 54 | |
55 | -switch($mode = sys_get_param_str('mode')) { |
|
55 | +switch ($mode = sys_get_param_str('mode')) { |
|
56 | 56 | case 'manage': |
57 | 57 | sn_sys_sector_buy('overview.php?mode=manage'); |
58 | 58 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $template = gettemplate('planet_manage', true); |
63 | 63 | $planet_id = sys_get_param_id('planet_id'); |
64 | 64 | |
65 | - if(sys_get_param_str('rename') && ($new_name_unsafe = sys_get_param_str_unsafe('new_name'))) { |
|
65 | + if (sys_get_param_str('rename') && ($new_name_unsafe = sys_get_param_str_unsafe('new_name'))) { |
|
66 | 66 | $planetrow['name'] = $new_name_unsafe; |
67 | 67 | DBStaticPlanet::db_planet_update_set_by_id( |
68 | 68 | $planetrow['id'], |
@@ -70,21 +70,21 @@ discard block |
||
70 | 70 | 'name' => $new_name_unsafe, |
71 | 71 | ) |
72 | 72 | ); |
73 | - } elseif(sys_get_param_str('action') == 'make_capital') { |
|
73 | + } elseif (sys_get_param_str('action') == 'make_capital') { |
|
74 | 74 | try { |
75 | 75 | sn_db_transaction_start(); |
76 | 76 | $user = DBStaticUser::db_user_by_id($user['id'], true, '*'); |
77 | 77 | $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true, '*'); |
78 | 78 | |
79 | - if($planetrow['planet_type'] != PT_PLANET) { |
|
79 | + if ($planetrow['planet_type'] != PT_PLANET) { |
|
80 | 80 | throw new exception(classLocale::$lang['ov_capital_err_not_a_planet'], ERR_ERROR); |
81 | 81 | } |
82 | 82 | |
83 | - if($planetrow['id'] == $user['id_planet']) { |
|
83 | + if ($planetrow['id'] == $user['id_planet']) { |
|
84 | 84 | throw new exception(classLocale::$lang['ov_capital_err_capital_already'], ERR_ERROR); |
85 | 85 | } |
86 | 86 | |
87 | - if($user_dark_matter < classSupernova::$config->planet_capital_cost) { |
|
87 | + if ($user_dark_matter < classSupernova::$config->planet_capital_cost) { |
|
88 | 88 | throw new exception(classLocale::$lang['ov_capital_err_no_dark_matter'], ERR_ERROR); |
89 | 89 | } |
90 | 90 | |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | ); |
110 | 110 | sn_db_transaction_commit(); |
111 | 111 | sys_redirect('overview.php?mode=manage'); |
112 | - } catch(exception $e) { |
|
112 | + } catch (exception $e) { |
|
113 | 113 | sn_db_transaction_rollback(); |
114 | 114 | $result[] = array( |
115 | 115 | 'STATUS' => $e->getCode(), |
116 | 116 | 'MESSAGE' => $e->getMessage(), |
117 | 117 | ); |
118 | 118 | } |
119 | - } elseif(sys_get_param_str('action') == 'planet_teleport') { |
|
119 | + } elseif (sys_get_param_str('action') == 'planet_teleport') { |
|
120 | 120 | try { |
121 | - if(!uni_coordinates_valid($new_coordinates = array( |
|
121 | + if (!uni_coordinates_valid($new_coordinates = array( |
|
122 | 122 | 'galaxy' => sys_get_param_int('new_galaxy'), |
123 | 123 | 'system' => sys_get_param_int('new_system'), |
124 | 124 | 'planet' => sys_get_param_int('new_planet'))) |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | // $planetrow = $global_data['planet']; |
136 | 136 | |
137 | 137 | $can_teleport = uni_planet_teleport_check($user, $planetrow, $new_coordinates); |
138 | - if($can_teleport['result'] != ERR_NONE) { |
|
138 | + if ($can_teleport['result'] != ERR_NONE) { |
|
139 | 139 | throw new exception($can_teleport['message'], $can_teleport['result']); |
140 | 140 | } |
141 | 141 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | array() |
155 | 155 | ); |
156 | 156 | |
157 | - if($planetrow['id'] == $user['id_planet']) { |
|
157 | + if ($planetrow['id'] == $user['id_planet']) { |
|
158 | 158 | DBStaticUser::db_user_set_by_id( |
159 | 159 | $user['id'], |
160 | 160 | array( |
@@ -174,17 +174,17 @@ discard block |
||
174 | 174 | 'MESSAGE' => classLocale::$lang['ov_teleport_err_none'], |
175 | 175 | ); |
176 | 176 | sys_redirect('overview.php?mode=manage'); |
177 | - } catch(exception $e) { |
|
177 | + } catch (exception $e) { |
|
178 | 178 | sn_db_transaction_rollback(); |
179 | 179 | $result[] = array( |
180 | 180 | 'STATUS' => $e->getCode(), |
181 | 181 | 'MESSAGE' => $e->getMessage(), |
182 | 182 | ); |
183 | 183 | } |
184 | - } elseif(sys_get_param_str('action') == 'planet_abandon') { |
|
184 | + } elseif (sys_get_param_str('action') == 'planet_abandon') { |
|
185 | 185 | // if(sec_password_check($user['id'], sys_get_param('abandon_confirm'))) { |
186 | - if(classSupernova::$auth->password_check(sys_get_param('abandon_confirm'))) { |
|
187 | - if($user['id_planet'] != $user['current_planet'] && $user['current_planet'] == $planet_id) { |
|
186 | + if (classSupernova::$auth->password_check(sys_get_param('abandon_confirm'))) { |
|
187 | + if ($user['id_planet'] != $user['current_planet'] && $user['current_planet'] == $planet_id) { |
|
188 | 188 | $destroyed = SN_TIME_NOW + 60 * 60 * 24; |
189 | 189 | DBStaticPlanet::db_planet_update_set_by_id( |
190 | 190 | $user['current_planet'], |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | message(classLocale::$lang['ov_delete_wrong_planet'], classLocale::$lang['colony_abandon'], 'overview.php?mode=manage'); |
211 | 211 | } |
212 | 212 | } else { |
213 | - message(classLocale::$lang['ov_delete_wrong_pass'] , classLocale::$lang['colony_abandon'], 'overview.php?mode=manage'); |
|
213 | + message(classLocale::$lang['ov_delete_wrong_pass'], classLocale::$lang['colony_abandon'], 'overview.php?mode=manage'); |
|
214 | 214 | } |
215 | - } elseif( |
|
215 | + } elseif ( |
|
216 | 216 | ($hire = sys_get_param_int('hire')) && in_array($hire, sn_get_groups('governors')) |
217 | 217 | && ( |
218 | 218 | !get_unit_param($hire, P_MAX_STACK) || |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | $user = DBStaticUser::db_user_by_id($user['id'], true); |
228 | 228 | $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true); |
229 | 229 | $build_data = eco_get_build_data($user, $planetrow, $hire, $planetrow['PLANET_GOVERNOR_ID'] == $hire ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0); |
230 | - if($build_data['CAN'][BUILD_CREATE]) { |
|
231 | - if($planetrow['PLANET_GOVERNOR_ID'] == $hire) { |
|
230 | + if ($build_data['CAN'][BUILD_CREATE]) { |
|
231 | + if ($planetrow['PLANET_GOVERNOR_ID'] == $hire) { |
|
232 | 232 | $planetrow['PLANET_GOVERNOR_LEVEL']++; |
233 | 233 | } else { |
234 | 234 | $planetrow['PLANET_GOVERNOR_LEVEL'] = 1; |
@@ -260,8 +260,8 @@ discard block |
||
260 | 260 | |
261 | 261 | lng_include('mrc_mercenary'); |
262 | 262 | int_planet_pretemplate($planetrow, $template); |
263 | - foreach(sn_get_groups('governors') as $governor_id) { |
|
264 | - if($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) { |
|
263 | + foreach (sn_get_groups('governors') as $governor_id) { |
|
264 | + if ($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) { |
|
265 | 265 | continue; |
266 | 266 | } |
267 | 267 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | 'PAGE_HINT' => classLocale::$lang['ov_manage_page_hint'], |
314 | 314 | )); |
315 | 315 | |
316 | - foreach($result as &$a_result) { |
|
316 | + foreach ($result as &$a_result) { |
|
317 | 317 | $template->assign_block_vars('result', $a_result); |
318 | 318 | } |
319 | 319 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | default: |
324 | 324 | sn_sys_sector_buy(); |
325 | 325 | |
326 | - if(sys_get_param_str('rename') && $new_name_unsafe = sys_get_param_str_unsafe('new_name')) { |
|
326 | + if (sys_get_param_str('rename') && $new_name_unsafe = sys_get_param_str_unsafe('new_name')) { |
|
327 | 327 | $planetrow['name'] = $new_name_unsafe; |
328 | 328 | DBStaticPlanet::db_planet_update_set_by_id( |
329 | 329 | $planetrow['id'], |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | |
359 | 359 | $planet_count = 0; |
360 | 360 | $planets_query = DBStaticPlanet::db_planet_list_sorted($user, false, '*'); |
361 | - foreach($planets_query as $an_id => $UserPlanet) { |
|
361 | + foreach ($planets_query as $an_id => $UserPlanet) { |
|
362 | 362 | sn_db_transaction_start(); |
363 | 363 | $UserPlanet = sys_o_get_updated($user, $UserPlanet['id'], SN_TIME_NOW, false, true); |
364 | 364 | sn_db_transaction_commit(); |
@@ -369,16 +369,16 @@ discard block |
||
369 | 369 | |
370 | 370 | $planet_fleet_id = 0; |
371 | 371 | $fleet_list = $template_planet['fleet_list']; |
372 | - if($fleet_list['own']['count']) { |
|
372 | + if ($fleet_list['own']['count']) { |
|
373 | 373 | $planet_fleet_id = "p{$UserPlanet['id']}"; |
374 | 374 | $fleets_to_planet[$UserPlanet['id']] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id); |
375 | 375 | // $fleet_id++;tpl_parse_fleet_sn |
376 | 376 | } |
377 | - if($UserPlanet['planet_type'] == PT_MOON) { |
|
377 | + if ($UserPlanet['planet_type'] == PT_MOON) { |
|
378 | 378 | continue; |
379 | 379 | } |
380 | 380 | $moon = DBStaticPlanet::db_planet_by_parent($UserPlanet['id']); |
381 | - if($moon) { |
|
381 | + if ($moon) { |
|
382 | 382 | $moon_fill = min(100, floor($moon['field_current'] / eco_planet_fields_max($moon) * 100)); |
383 | 383 | } else { |
384 | 384 | $moon_fill = 0; |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | tpl_assign_fleet($template, $fleets); |
419 | 419 | |
420 | 420 | $lune = $planetrow['planet_type'] == PT_PLANET ? DBStaticPlanet::db_planet_by_parent($planetrow['id']) : DBStaticPlanet::db_planet_by_id($planetrow['parent_planet']); |
421 | - if($lune) { |
|
421 | + if ($lune) { |
|
422 | 422 | $template->assign_vars(array( |
423 | 423 | 'MOON_ID' => $lune['id'], |
424 | 424 | 'MOON_IMG' => $lune['image'], |
@@ -430,15 +430,15 @@ discard block |
||
430 | 430 | $planet_fill = $planet_fill > 100 ? 100 : $planet_fill; |
431 | 431 | |
432 | 432 | $planet_recyclers_orbiting = 0; |
433 | - foreach(classSupernova::$gc->groupRecyclers as $recycler_id) { |
|
433 | + foreach (classSupernova::$gc->groupRecyclers as $recycler_id) { |
|
434 | 434 | $planet_recyclers_orbiting += mrc_get_level($user, $planetrow, $recycler_id); |
435 | 435 | } |
436 | 436 | |
437 | 437 | int_planet_pretemplate($planetrow, $template); |
438 | 438 | |
439 | 439 | $sn_group_ques = sn_get_groups('ques'); |
440 | - if(!defined('GAME_STRUCTURES_DISABLED') || !GAME_STRUCTURES_DISABLED) { |
|
441 | - foreach(array(QUE_STRUCTURES => $sn_group_ques[QUE_STRUCTURES]) as $que_id => $que_type_data) { |
|
440 | + if (!defined('GAME_STRUCTURES_DISABLED') || !GAME_STRUCTURES_DISABLED) { |
|
441 | + foreach (array(QUE_STRUCTURES => $sn_group_ques[QUE_STRUCTURES]) as $que_id => $que_type_data) { |
|
442 | 442 | $this_que = $que['ques'][$que_id][$user['id']][$planetrow['id']]; |
443 | 443 | $template->assign_block_vars('ques', array( |
444 | 444 | 'ID' => $que_id, |
@@ -446,8 +446,8 @@ discard block |
||
446 | 446 | 'LENGTH' => empty($this_que) ? 0 : count($this_que), |
447 | 447 | )); |
448 | 448 | |
449 | - if(!empty($this_que)) { |
|
450 | - foreach($this_que as $que_item) { |
|
449 | + if (!empty($this_que)) { |
|
450 | + foreach ($this_que as $que_item) { |
|
451 | 451 | $template->assign_block_vars('que', que_tpl_parse_element($que_item)); |
452 | 452 | } |
453 | 453 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | 'LENGTH' => $que_hangar_length, |
462 | 462 | )); |
463 | 463 | |
464 | - if(!defined('GAME_DEFENSE_DISABLED') || !GAME_DEFENSE_DISABLED) { |
|
464 | + if (!defined('GAME_DEFENSE_DISABLED') || !GAME_DEFENSE_DISABLED) { |
|
465 | 465 | $que_hangar_length = tpl_assign_hangar($template, $planetrow, SUBQUE_DEFENSE); |
466 | 466 | $template->assign_block_vars('ques', array( |
467 | 467 | 'ID' => SUBQUE_DEFENSE, |
@@ -473,12 +473,12 @@ discard block |
||
473 | 473 | $overview_planet_rows = $user['opt_int_overview_planet_rows']; |
474 | 474 | $overview_planet_columns = $user['opt_int_overview_planet_columns']; |
475 | 475 | |
476 | - if($overview_planet_rows <= 0 && $overview_planet_columns <= 0) { |
|
476 | + if ($overview_planet_rows <= 0 && $overview_planet_columns <= 0) { |
|
477 | 477 | $overview_planet_rows = $user_option_list[OPT_INTERFACE]['opt_int_overview_planet_rows']; |
478 | 478 | $overview_planet_columns = $user_option_list[OPT_INTERFACE]['opt_int_overview_planet_columns']; |
479 | 479 | } |
480 | 480 | |
481 | - if($overview_planet_rows > 0 && $overview_planet_columns <= 0) { |
|
481 | + if ($overview_planet_rows > 0 && $overview_planet_columns <= 0) { |
|
482 | 482 | $overview_planet_columns = ceil($planet_count / $overview_planet_rows); |
483 | 483 | } |
484 | 484 | |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | )); |
536 | 536 | tpl_set_resource_info($template, $planetrow, $fleets_to_planet, 2); |
537 | 537 | |
538 | - foreach($result as &$a_result) { |
|
538 | + foreach ($result as &$a_result) { |
|
539 | 539 | $template->assign_block_vars('result', $a_result); |
540 | 540 | } |
541 | 541 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | use DBStatic\DBStaticUser; |
12 | 12 | use Vector\Vector; |
13 | 13 | |
14 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
14 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
15 | 15 | |
16 | 16 | lng_include('universe'); |
17 | 17 | lng_include('stat'); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $uni_system = sys_get_param_int('system', $planetrow['system']); |
22 | 22 | $planet = sys_get_param_int('planet', $planetrow['planet']); |
23 | 23 | |
24 | -if($mode == 'name') { |
|
24 | +if ($mode == 'name') { |
|
25 | 25 | require_once('includes/includes/uni_rename.php'); |
26 | 26 | } |
27 | 27 | |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | |
43 | 43 | $flying_fleet_count = FleetList::fleet_count_flying($user['id']); |
44 | 44 | |
45 | -if($mode == 1) { |
|
46 | -} elseif($mode == 2 || $mode == 3) { |
|
45 | +if ($mode == 1) { |
|
46 | +} elseif ($mode == 2 || $mode == 3) { |
|
47 | 47 | $planet = $planetrow['planet']; |
48 | 48 | } else { |
49 | 49 | $uni_galaxy = $planetrow['galaxy']; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $planet = $planetrow['planet']; |
52 | 52 | } |
53 | 53 | |
54 | -$uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > Vector::$knownGalaxies? Vector::$knownGalaxies: $uni_galaxy); |
|
54 | +$uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > Vector::$knownGalaxies ? Vector::$knownGalaxies : $uni_galaxy); |
|
55 | 55 | $uni_system = $uni_system < 1 ? 1 : ($uni_system > Vector::$knownSystems ? Vector::$knownSystems : $uni_system); |
56 | 56 | $planet = $planet < 1 ? 1 : ($planet > Vector::$knownPlanets + 1 ? Vector::$knownPlanets + 1 : $planet); |
57 | 57 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | $PhalanxRange = GetPhalanxRange($HavePhalanx); |
70 | 70 | |
71 | 71 | $planet_precache_query = DBStaticPlanet::db_planet_list_in_system($uni_galaxy, $uni_system); |
72 | -if(!empty($planet_precache_query)) { |
|
73 | - foreach($planet_precache_query as $planet_row) { |
|
72 | +if (!empty($planet_precache_query)) { |
|
73 | + foreach ($planet_precache_query as $planet_row) { |
|
74 | 74 | $planet_list[$planet_row['planet']][$planet_row['planet_type']] = $planet_row; |
75 | 75 | } |
76 | 76 | } |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | * @var Fleet[][][] $fleet_list |
89 | 89 | */ |
90 | 90 | $fleet_list = array(); |
91 | -foreach($system_fleet_list->_container as $objFleetSystem) { |
|
92 | - if(!$objFleetSystem->isReturning()) { |
|
91 | +foreach ($system_fleet_list->_container as $objFleetSystem) { |
|
92 | + if (!$objFleetSystem->isReturning()) { |
|
93 | 93 | $fleet_planet = $objFleetSystem->fleet_end_planet; |
94 | 94 | $fleet_type = $objFleetSystem->fleet_end_type; |
95 | 95 | } else { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $recycler_info = array(); |
105 | 105 | $planet_recyclers_orbiting = 0; |
106 | 106 | $recyclers_fleet = array(); |
107 | -foreach(classSupernova::$gc->groupRecyclers as $recycler_id) { |
|
107 | +foreach (classSupernova::$gc->groupRecyclers as $recycler_id) { |
|
108 | 108 | $recycler_info[$recycler_id] = get_ship_data($recycler_id, $user); |
109 | 109 | $recyclers_fleet[$recycler_id] = mrc_get_level($user, $planetrow, $recycler_id); |
110 | 110 | $planet_recyclers_orbiting += $recyclers_fleet[$recycler_id]; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $fleet_id = 1; |
115 | 115 | $fleets = array(); |
116 | 116 | $config_game_max_planet = Vector::$knownPlanets + 1; |
117 | -for($Planet = 1; $Planet < $config_game_max_planet; $Planet++) { |
|
117 | +for ($Planet = 1; $Planet < $config_game_max_planet; $Planet++) { |
|
118 | 118 | unset($uni_galaxyRowPlanet); |
119 | 119 | unset($uni_galaxyRowMoon); |
120 | 120 | unset($uni_galaxyRowUser); |
@@ -124,17 +124,17 @@ discard block |
||
124 | 124 | $uni_galaxyRowPlanet = $planet_list[$Planet][PT_PLANET]; |
125 | 125 | |
126 | 126 | $planet_fleet_id = 0; |
127 | - if($uni_galaxyRowPlanet['destruyed']) { |
|
127 | + if ($uni_galaxyRowPlanet['destruyed']) { |
|
128 | 128 | CheckAbandonPlanetState($uni_galaxyRowPlanet); |
129 | - } elseif($uni_galaxyRowPlanet['id']) { |
|
130 | - if($cached['users'][$uni_galaxyRowPlanet['id_owner']]) { |
|
129 | + } elseif ($uni_galaxyRowPlanet['id']) { |
|
130 | + if ($cached['users'][$uni_galaxyRowPlanet['id_owner']]) { |
|
131 | 131 | $uni_galaxyRowUser = $cached['users'][$uni_galaxyRowPlanet['id_owner']]; |
132 | 132 | } else { |
133 | 133 | $uni_galaxyRowUser = DBStaticUser::db_user_by_id($uni_galaxyRowPlanet['id_owner']); |
134 | 134 | $cached['users'][$uni_galaxyRowUser['id']] = $uni_galaxyRowUser; |
135 | 135 | } |
136 | 136 | |
137 | - if(!$uni_galaxyRowUser['id']) { |
|
137 | + if (!$uni_galaxyRowUser['id']) { |
|
138 | 138 | classSupernova::$debug->warning("Planet '{$uni_galaxyRowPlanet['name']}' [{$uni_galaxy}:{$uni_system}:{$Planet}] has no owner!", 'Userless planet', 503); |
139 | 139 | $uni_galaxyRowPlanet['destruyed'] = SN_TIME_NOW + 60 * 60 * 24; |
140 | 140 | $uni_galaxyRowPlanet['id_owner'] = 0; |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | ); |
148 | 148 | } |
149 | 149 | |
150 | - if($uni_galaxyRowUser['id']) { |
|
150 | + if ($uni_galaxyRowUser['id']) { |
|
151 | 151 | $planetcount++; |
152 | - if($uni_galaxyRowUser['ally_id']) { |
|
153 | - if($cached['allies'][$uni_galaxyRowUser['ally_id']]) { |
|
152 | + if ($uni_galaxyRowUser['ally_id']) { |
|
153 | + if ($cached['allies'][$uni_galaxyRowUser['ally_id']]) { |
|
154 | 154 | $allyquery = $cached['allies'][$uni_galaxyRowUser['ally_id']]; |
155 | 155 | } else { |
156 | 156 | $allyquery = DBStaticAlly::db_ally_get_by_id($uni_galaxyRowUser['ally_id']); |
@@ -159,19 +159,19 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | $fleets_to_planet = flt_get_fleets_to_planet_by_array_of_Fleet($fleet_list[$Planet][PT_PLANET]); |
162 | - if(!empty($fleets_to_planet['own']['count'])) { |
|
162 | + if (!empty($fleets_to_planet['own']['count'])) { |
|
163 | 163 | $planet_fleet_id = $fleet_id; |
164 | 164 | $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id); |
165 | 165 | $fleet_id++; |
166 | 166 | } |
167 | 167 | |
168 | 168 | $uni_galaxyRowMoon = $planet_list[$Planet][PT_MOON]; |
169 | - if($uni_galaxyRowMoon['destruyed']) { |
|
169 | + if ($uni_galaxyRowMoon['destruyed']) { |
|
170 | 170 | CheckAbandonPlanetState($uni_galaxyRowMoon); |
171 | 171 | } else { |
172 | 172 | $moon_fleet_id = 0; |
173 | 173 | $fleets_to_planet = flt_get_fleets_to_planet_by_array_of_Fleet($fleet_list[$Planet][PT_MOON]); |
174 | - if(!empty($fleets_to_planet['own']['count'])) { |
|
174 | + if (!empty($fleets_to_planet['own']['count'])) { |
|
175 | 175 | $moon_fleet_id = $fleet_id; |
176 | 176 | $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id); |
177 | 177 | $fleet_id++; |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | |
183 | 183 | $recyclers_incoming_capacity = 0; |
184 | 184 | $uni_galaxyRowPlanet['debris'] = $uni_galaxyRowPlanet['debris_metal'] + $uni_galaxyRowPlanet['debris_crystal']; |
185 | - if($uni_galaxyRowPlanet['debris']) { |
|
186 | - if(!empty($fleet_list[$Planet][PT_DEBRIS])) { |
|
187 | - foreach($fleet_list[$Planet][PT_DEBRIS] as $objFleetToDebris) { |
|
188 | - if($objFleetToDebris->playerOwnerId == $user['id']) { |
|
185 | + if ($uni_galaxyRowPlanet['debris']) { |
|
186 | + if (!empty($fleet_list[$Planet][PT_DEBRIS])) { |
|
187 | + foreach ($fleet_list[$Planet][PT_DEBRIS] as $objFleetToDebris) { |
|
188 | + if ($objFleetToDebris->playerOwnerId == $user['id']) { |
|
189 | 189 | $recyclers_incoming_capacity += $objFleetToDebris->shipsGetCapacityRecyclers($recycler_info); |
190 | 190 | } |
191 | 191 | } |
@@ -262,21 +262,21 @@ discard block |
||
262 | 262 | |
263 | 263 | tpl_assign_fleet($template, $fleets); |
264 | 264 | |
265 | -foreach(sn_get_groups('defense_active') as $unit_id) { |
|
265 | +foreach (sn_get_groups('defense_active') as $unit_id) { |
|
266 | 266 | $template->assign_block_vars('defense_active', array( |
267 | 267 | 'ID' => $unit_id, |
268 | 268 | 'NAME' => classLocale::$lang['tech'][$unit_id], |
269 | 269 | )); |
270 | 270 | } |
271 | 271 | |
272 | -foreach($cached['users'] as $PlanetUser) { |
|
273 | - if(!$PlanetUser) { |
|
272 | +foreach ($cached['users'] as $PlanetUser) { |
|
273 | + if (!$PlanetUser) { |
|
274 | 274 | continue; |
275 | 275 | } |
276 | 276 | |
277 | 277 | $user_ally = $cached['allies'][$PlanetUser['ally_id']]; |
278 | - if(isset($user_ally)) { |
|
279 | - if($PlanetUser['id'] == $user_ally['ally_owner']) { |
|
278 | + if (isset($user_ally)) { |
|
279 | + if ($PlanetUser['id'] == $user_ally['ally_owner']) { |
|
280 | 280 | $user_rank_title = $user_ally['ally_owner_range']; |
281 | 281 | } else { |
282 | 282 | $ally_ranks = explode(';', $user_ally['ranklist']); |
@@ -299,8 +299,8 @@ discard block |
||
299 | 299 | )); |
300 | 300 | } |
301 | 301 | |
302 | -foreach($cached['allies'] as $PlanetAlly) { |
|
303 | - if($PlanetAlly) { |
|
302 | +foreach ($cached['allies'] as $PlanetAlly) { |
|
303 | + if ($PlanetAlly) { |
|
304 | 304 | $template->assign_block_vars('alliances', array( |
305 | 305 | 'ID' => $PlanetAlly['id'], |
306 | 306 | 'NAME_JS' => js_safe_string($PlanetAlly['ally_name']), |
@@ -5,11 +5,11 @@ discard block |
||
5 | 5 | |
6 | 6 | $classLocale = classLocale::$lang; |
7 | 7 | |
8 | -if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) { |
|
8 | +if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) { |
|
9 | 9 | classSupernova::$debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
10 | 10 | } |
11 | 11 | |
12 | -$page_title .= ' - ' . classLocale::$lang["eco_mrk_{$submode}"]; |
|
12 | +$page_title .= ' - '.classLocale::$lang["eco_mrk_{$submode}"]; |
|
13 | 13 | |
14 | 14 | $template = gettemplate('market_fleet', true); |
15 | 15 | $template->assign_vars(array( |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | 'rpg_cost' => $rpg_cost, |
18 | 18 | )); |
19 | 19 | |
20 | -if(is_array($shipList)) { |
|
21 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $rpg_cost) { |
|
20 | +if (is_array($shipList)) { |
|
21 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $rpg_cost) { |
|
22 | 22 | $intError = MARKET_NO_DM; |
23 | 23 | } |
24 | 24 | |
@@ -31,32 +31,32 @@ discard block |
||
31 | 31 | // Блокируем запись о запасах кораблей у трейдера |
32 | 32 | db_config_get_stockman_fleet(); |
33 | 33 | |
34 | - $message .= classLocale::$lang["eco_mrk_{$submode}_ships"] . '<ul>'; |
|
34 | + $message .= classLocale::$lang["eco_mrk_{$submode}_ships"].'<ul>'; |
|
35 | 35 | $total = array(); |
36 | - foreach($shipList as $shipID => &$shipCount) { |
|
36 | + foreach ($shipList as $shipID => &$shipCount) { |
|
37 | 37 | $shipCount = ceil(floatval($shipCount)); |
38 | - if(!$shipCount) { |
|
38 | + if (!$shipCount) { |
|
39 | 39 | continue; |
40 | 40 | } |
41 | 41 | |
42 | - if($shipCount < 0) { |
|
42 | + if ($shipCount < 0) { |
|
43 | 43 | classSupernova::$debug->warning('User supplied negative ship count on Black Market page', 'Hack Attempt', 307); |
44 | 44 | $intError = MARKET_NEGATIVE_SHIPS; |
45 | 45 | break; |
46 | 46 | } |
47 | 47 | |
48 | - if($mode == MARKET_SCRAPPER) { |
|
48 | + if ($mode == MARKET_SCRAPPER) { |
|
49 | 49 | $amount = mrc_get_level($user, $planetrow, $shipID, true, true); // $planetrow[get_unit_param($shipID, P_NAME)]; |
50 | - } elseif($mode == MARKET_STOCKMAN) { |
|
50 | + } elseif ($mode == MARKET_STOCKMAN) { |
|
51 | 51 | $amount = $stock[$shipID]; |
52 | 52 | } |
53 | 53 | |
54 | - if($amount < $shipCount) { |
|
54 | + if ($amount < $shipCount) { |
|
55 | 55 | $intError = $error_no_stock; |
56 | 56 | break; |
57 | 57 | } |
58 | 58 | |
59 | - if(!in_array($shipID, classSupernova::$gc->groupFleet)) { |
|
59 | + if (!in_array($shipID, classSupernova::$gc->groupFleet)) { |
|
60 | 60 | classSupernova::$debug->warning('Hack Attempt', 'User supplied non-ship unit ID on Black Market page', 306); |
61 | 61 | $intError = MARKET_NOT_A_SHIP; |
62 | 62 | break; |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | $resTemp[RES_CRYSTAL] = floor($build_data[BUILD_CREATE][RES_CRYSTAL] * $shipCount * $config_rpg_scrape_crystal * (-$multiplier)); |
73 | 73 | $resTemp[RES_DEUTERIUM] = floor($build_data[BUILD_CREATE][RES_DEUTERIUM] * $shipCount * $config_rpg_scrape_deuterium * (-$multiplier)); |
74 | 74 | |
75 | - foreach($resTemp as $resID => $resCount) { |
|
75 | + foreach ($resTemp as $resID => $resCount) { |
|
76 | 76 | $total[$resID] += $resCount; |
77 | 77 | } |
78 | 78 | |
79 | - $message .= "<li>{$classLocale['tech'][$shipID]}: " . pretty_number($shipCount); |
|
79 | + $message .= "<li>{$classLocale['tech'][$shipID]}: ".pretty_number($shipCount); |
|
80 | 80 | } |
81 | 81 | |
82 | - if($mode == MARKET_STOCKMAN && $intError == MARKET_DEAL) { |
|
83 | - foreach($total as $resID => $resCount) { |
|
84 | - if(mrc_get_level($user, $planetrow, $resID, true, true) < -$resCount) { |
|
82 | + if ($mode == MARKET_STOCKMAN && $intError == MARKET_DEAL) { |
|
83 | + foreach ($total as $resID => $resCount) { |
|
84 | + if (mrc_get_level($user, $planetrow, $resID, true, true) < -$resCount) { |
|
85 | 85 | $intError = MARKET_NO_RESOURCES; |
86 | 86 | classSupernova::$debug->warning('Trying to use bug in s/h market', 'S/H Ship Market', 301); |
87 | 87 | break; |
@@ -92,15 +92,15 @@ discard block |
||
92 | 92 | $intError = ($intError == MARKET_DEAL) && (array_sum($total) == 0) ? $error_zero_res : $intError; |
93 | 93 | |
94 | 94 | $qry = array(); |
95 | - if($intError == MARKET_DEAL) { |
|
96 | - $message .= '</ul>' . classLocale::$lang["eco_mrk_{$submode}_res"] . '<ul>'; |
|
97 | - foreach($total as $resID => $resCount) { |
|
98 | - if(!$resCount) { |
|
95 | + if ($intError == MARKET_DEAL) { |
|
96 | + $message .= '</ul>'.classLocale::$lang["eco_mrk_{$submode}_res"].'<ul>'; |
|
97 | + foreach ($total as $resID => $resCount) { |
|
98 | + if (!$resCount) { |
|
99 | 99 | continue; |
100 | 100 | } |
101 | 101 | |
102 | 102 | $qry[pname_resource_name($resID)] = $resCount; |
103 | - $message .= "<li>" . classLocale::$lang['sys_' . pname_resource_name($resID)] . ": " . pretty_number(abs($resCount)); |
|
103 | + $message .= "<li>".classLocale::$lang['sys_'.pname_resource_name($resID)].": ".pretty_number(abs($resCount)); |
|
104 | 104 | } |
105 | 105 | $message .= "</ul>"; |
106 | 106 | |
@@ -128,38 +128,38 @@ discard block |
||
128 | 128 | 'MESSAGE' => classLocale::$lang['eco_mrk_errors'][$intError], |
129 | 129 | )); |
130 | 130 | |
131 | - foreach($shipList as $shipID => $shipCount) { |
|
131 | + foreach ($shipList as $shipID => $shipCount) { |
|
132 | 132 | $data['ships'][$shipID] = max(0, intval($shipCount)); |
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
136 | 136 | $message = ''; |
137 | 137 | |
138 | -if(!classSupernova::$config->eco_stockman_fleet && classSupernova::$config->eco_stockman_fleet_populate) { |
|
139 | - classSupernova::$config->db_saveItem('eco_stockman_fleet', sys_unit_arr2str(array_map(function($item){return mt_rand(1, 1000);}, classSupernova::$gc->groupFleet))); |
|
138 | +if (!classSupernova::$config->eco_stockman_fleet && classSupernova::$config->eco_stockman_fleet_populate) { |
|
139 | + classSupernova::$config->db_saveItem('eco_stockman_fleet', sys_unit_arr2str(array_map(function($item) {return mt_rand(1, 1000); }, classSupernova::$gc->groupFleet))); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | tpl_set_resource_info($template, $planetrow, array()); |
143 | 143 | |
144 | -if(!$array) { |
|
144 | +if (!$array) { |
|
145 | 145 | $array = array(); |
146 | 146 | } |
147 | 147 | |
148 | 148 | $group_fleet = classSupernova::$gc->groupFleet; |
149 | -foreach($array as $key => $value) { |
|
150 | - if($mode == MARKET_SCRAPPER) { |
|
149 | +foreach ($array as $key => $value) { |
|
150 | + if ($mode == MARKET_SCRAPPER) { |
|
151 | 151 | $shipID = $value; |
152 | 152 | $amount = mrc_get_level($user, $planetrow, $shipID, false, true); // $planetrow[get_unit_param($shipID, P_NAME)]; |
153 | - } elseif($mode == MARKET_STOCKMAN) { |
|
153 | + } elseif ($mode == MARKET_STOCKMAN) { |
|
154 | 154 | $shipID = $key; |
155 | 155 | $amount = $value; |
156 | 156 | } |
157 | 157 | |
158 | - if(!in_array($shipID, $group_fleet)) { |
|
158 | + if (!in_array($shipID, $group_fleet)) { |
|
159 | 159 | continue; |
160 | 160 | } |
161 | 161 | |
162 | - if($amount > 0) { |
|
162 | + if ($amount > 0) { |
|
163 | 163 | $build_data = eco_get_build_data($user, $planetrow, $shipID); |
164 | 164 | $template->assign_block_vars('ships', array( |
165 | 165 | 'ID' => $shipID, |
@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | $RecyclerCapacity = 0; |
17 | 17 | $OtherFleetCapacity = 0; |
18 | 18 | |
19 | - foreach($objFleet->shipsIterator() as $unit_id => $unit) { |
|
20 | - if(in_array($unit_id, classSupernova::$gc->groupFleet)) { |
|
19 | + foreach ($objFleet->shipsIterator() as $unit_id => $unit) { |
|
20 | + if (in_array($unit_id, classSupernova::$gc->groupFleet)) { |
|
21 | 21 | $capacity = get_unit_param($unit_id, P_CAPACITY) * $unit->count; |
22 | - if(in_array($unit_id, classSupernova::$gc->groupRecyclers)) { |
|
22 | + if (in_array($unit_id, classSupernova::$gc->groupRecyclers)) { |
|
23 | 23 | $RecyclerCapacity += $capacity; |
24 | 24 | } else { |
25 | 25 | $OtherFleetCapacity += $capacity; |
@@ -28,33 +28,33 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | $fleet_resources_amount = $objFleet->resourcesGetTotal(); |
31 | - if($fleet_resources_amount > $OtherFleetCapacity) { |
|
31 | + if ($fleet_resources_amount > $OtherFleetCapacity) { |
|
32 | 32 | // Если во флоте есть другие корабли И количество ресурсов больше, чем их ёмкость трюмов - значит часть этих ресурсов лежит в трюмах переработчиков |
33 | 33 | // Уменьшаем ёмкость переработчиков на указанную величину |
34 | 34 | $RecyclerCapacity -= ($fleet_resources_amount - $OtherFleetCapacity); |
35 | 35 | } |
36 | 36 | |
37 | 37 | $resources_recycled = array(); |
38 | - if(($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) { |
|
38 | + if (($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) { |
|
39 | 39 | $resources_recycled[RES_METAL] = $destination_planet["debris_metal"]; |
40 | 40 | $resources_recycled[RES_CRYSTAL] = $destination_planet["debris_crystal"]; |
41 | 41 | } else { |
42 | - if(($destination_planet["debris_metal"] > $RecyclerCapacity / 2) && |
|
42 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) && |
|
43 | 43 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2) |
44 | 44 | ) { |
45 | 45 | $resources_recycled[RES_METAL] = $RecyclerCapacity / 2; |
46 | 46 | $resources_recycled[RES_CRYSTAL] = $RecyclerCapacity / 2; |
47 | 47 | } else { |
48 | - if($destination_planet["debris_metal"] > $destination_planet["debris_crystal"]) { |
|
48 | + if ($destination_planet["debris_metal"] > $destination_planet["debris_crystal"]) { |
|
49 | 49 | $resources_recycled[RES_CRYSTAL] = $destination_planet["debris_crystal"]; |
50 | - if($destination_planet["debris_metal"] > ($RecyclerCapacity - $resources_recycled[RES_CRYSTAL])) { |
|
50 | + if ($destination_planet["debris_metal"] > ($RecyclerCapacity - $resources_recycled[RES_CRYSTAL])) { |
|
51 | 51 | $resources_recycled[RES_METAL] = $RecyclerCapacity - $resources_recycled[RES_CRYSTAL]; |
52 | 52 | } else { |
53 | 53 | $resources_recycled[RES_METAL] = $destination_planet["debris_metal"]; |
54 | 54 | } |
55 | 55 | } else { |
56 | 56 | $resources_recycled[RES_METAL] = $destination_planet["debris_metal"]; |
57 | - if($destination_planet["debris_crystal"] > ($RecyclerCapacity - $resources_recycled[RES_METAL])) { |
|
57 | + if ($destination_planet["debris_crystal"] > ($RecyclerCapacity - $resources_recycled[RES_METAL])) { |
|
58 | 58 | $resources_recycled[RES_CRYSTAL] = $RecyclerCapacity - $resources_recycled[RES_METAL]; |
59 | 59 | } else { |
60 | 60 | $resources_recycled[RES_CRYSTAL] = $destination_planet["debris_crystal"]; |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | /** |
980 | 980 | * Set current resource list from array of units |
981 | 981 | * |
982 | - * @param array $resource_list |
|
982 | + * @param integer[] $resource_list |
|
983 | 983 | */ |
984 | 984 | public function resourcesSet($resource_list) { |
985 | 985 | if (!empty($this->propertiesAdjusted['resource_list'])) { |
@@ -1027,7 +1027,7 @@ discard block |
||
1027 | 1027 | } |
1028 | 1028 | |
1029 | 1029 | /** |
1030 | - * @param array $rate |
|
1030 | + * @param integer[] $rate |
|
1031 | 1031 | * |
1032 | 1032 | * @return float |
1033 | 1033 | */ |
@@ -1058,8 +1058,6 @@ discard block |
||
1058 | 1058 | * Restores fleet or resources to planet |
1059 | 1059 | * |
1060 | 1060 | * @param bool $start |
1061 | - * @param bool $only_resources |
|
1062 | - * @param int $result |
|
1063 | 1061 | */ |
1064 | 1062 | public function resourcesUnload($start = true) { |
1065 | 1063 | sn_db_transaction_check(true); |
@@ -1,6 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | use DBStatic\DBStaticFleetACS; |
3 | -use DBStatic\DBStaticNote; |
|
4 | 3 | use DBStatic\DBStaticPlanet; |
5 | 4 | use DBStatic\DBStaticUnit; |
6 | 5 | use DBStatic\DBStaticUser; |
@@ -401,31 +401,31 @@ discard block |
||
401 | 401 | |
402 | 402 | return classSupernova::$db->doSelect( |
403 | 403 | // Блокировка самого флота |
404 | - "SELECT 1 FROM {{fleets}} AS f " . |
|
404 | + "SELECT 1 FROM {{fleets}} AS f ". |
|
405 | 405 | |
406 | 406 | // Блокировка всех юнитов, принадлежащих этому флоту |
407 | - "LEFT JOIN {{unit}} as unit ON unit.unit_location_type = " . static::$locationType . " AND unit.unit_location_id = f.fleet_id " . |
|
407 | + "LEFT JOIN {{unit}} as unit ON unit.unit_location_type = ".static::$locationType." AND unit.unit_location_id = f.fleet_id ". |
|
408 | 408 | |
409 | 409 | // Блокировка всех прилетающих и улетающих флотов, если нужно |
410 | 410 | // TODO - lock fleets by COORDINATES |
411 | - ($mission_data['dst_fleets'] ? "LEFT JOIN {{fleets}} AS fd ON fd.fleet_end_planet_id = f.fleet_end_planet_id OR fd.fleet_start_planet_id = f.fleet_end_planet_id " : '') . |
|
411 | + ($mission_data['dst_fleets'] ? "LEFT JOIN {{fleets}} AS fd ON fd.fleet_end_planet_id = f.fleet_end_planet_id OR fd.fleet_start_planet_id = f.fleet_end_planet_id " : ''). |
|
412 | 412 | // Блокировка всех юнитов, принадлежащих прилетающим и улетающим флотам - ufd = unit_fleet_destination |
413 | - ($mission_data['dst_fleets'] ? "LEFT JOIN {{unit}} AS ufd ON ufd.unit_location_type = " . static::$locationType . " AND ufd.unit_location_id = fd.fleet_id " : '') . |
|
413 | + ($mission_data['dst_fleets'] ? "LEFT JOIN {{unit}} AS ufd ON ufd.unit_location_type = ".static::$locationType." AND ufd.unit_location_id = fd.fleet_id " : ''). |
|
414 | 414 | |
415 | - ($mission_data['dst_user'] || $mission_data['dst_planet'] ? "LEFT JOIN {{users}} AS ud ON ud.id = f.fleet_target_owner " : '') . |
|
415 | + ($mission_data['dst_user'] || $mission_data['dst_planet'] ? "LEFT JOIN {{users}} AS ud ON ud.id = f.fleet_target_owner " : ''). |
|
416 | 416 | // Блокировка всех юнитов, принадлежащих владельцу планеты-цели |
417 | - ($mission_data['dst_user'] || $mission_data['dst_planet'] ? "LEFT JOIN {{unit}} AS unit_player_dest ON unit_player_dest.unit_player_id = ud.id " : '') . |
|
417 | + ($mission_data['dst_user'] || $mission_data['dst_planet'] ? "LEFT JOIN {{unit}} AS unit_player_dest ON unit_player_dest.unit_player_id = ud.id " : ''). |
|
418 | 418 | // Блокировка планеты-цели |
419 | - ($mission_data['dst_planet'] ? "LEFT JOIN {{planets}} AS pd ON pd.id = f.fleet_end_planet_id " : '') . |
|
419 | + ($mission_data['dst_planet'] ? "LEFT JOIN {{planets}} AS pd ON pd.id = f.fleet_end_planet_id " : ''). |
|
420 | 420 | // Блокировка всех юнитов, принадлежащих планете-цели - НЕ НУЖНО. Уже залочили ранее, как принадлежащие игроку-цели |
421 | 421 | // ($mission_data['dst_planet'] ? "LEFT JOIN {{unit}} AS upd ON upd.unit_location_type = " . LOC_PLANET . " AND upd.unit_location_id = pd.id " : '') . |
422 | 422 | |
423 | 423 | |
424 | - ($mission_data['src_user'] || $mission_data['src_planet'] ? "LEFT JOIN {{users}} AS us ON us.id = f.fleet_owner " : '') . |
|
424 | + ($mission_data['src_user'] || $mission_data['src_planet'] ? "LEFT JOIN {{users}} AS us ON us.id = f.fleet_owner " : ''). |
|
425 | 425 | // Блокировка всех юнитов, принадлежащих владельцу флота |
426 | - ($mission_data['src_user'] || $mission_data['src_planet'] ? "LEFT JOIN {{unit}} AS unit_player_src ON unit_player_src.unit_player_id = us.id " : '') . |
|
426 | + ($mission_data['src_user'] || $mission_data['src_planet'] ? "LEFT JOIN {{unit}} AS unit_player_src ON unit_player_src.unit_player_id = us.id " : ''). |
|
427 | 427 | // Блокировка планеты отправления |
428 | - ($mission_data['src_planet'] ? "LEFT JOIN {{planets}} AS ps ON ps.id = f.fleet_start_planet_id " : '') . |
|
428 | + ($mission_data['src_planet'] ? "LEFT JOIN {{planets}} AS ps ON ps.id = f.fleet_start_planet_id " : ''). |
|
429 | 429 | // Блокировка всех юнитов, принадлежащих планете с которой юниты были отправлены - НЕ НУЖНО. Уже залочили ранее, как принадлежащие владельцу флота |
430 | 430 | // ($mission_data['src_planet'] ? "LEFT JOIN {{unit}} AS ups ON ups.unit_location_type = " . LOC_PLANET . " AND ups.unit_location_id = ps.id " : '') . |
431 | 431 | |
@@ -442,11 +442,11 @@ discard block |
||
442 | 442 | public function dbGetLockById($dbId) { |
443 | 443 | classSupernova::$db->doSelect( |
444 | 444 | // Блокировка самого флота |
445 | - "SELECT 1 FROM {{fleets}} AS FLEET0 " . |
|
445 | + "SELECT 1 FROM {{fleets}} AS FLEET0 ". |
|
446 | 446 | // Lock fleet owner |
447 | - "LEFT JOIN {{users}} as USER0 on USER0.id = FLEET0.fleet_owner " . |
|
447 | + "LEFT JOIN {{users}} as USER0 on USER0.id = FLEET0.fleet_owner ". |
|
448 | 448 | // Блокировка всех юнитов, принадлежащих этому флоту |
449 | - "LEFT JOIN {{unit}} as UNIT0 ON UNIT0.unit_location_type = " . LOC_FLEET . " AND UNIT0.unit_location_id = FLEET0.fleet_id " . |
|
449 | + "LEFT JOIN {{unit}} as UNIT0 ON UNIT0.unit_location_type = ".LOC_FLEET." AND UNIT0.unit_location_id = FLEET0.fleet_id ". |
|
450 | 450 | |
451 | 451 | // Без предварительной выборки неизвестно - куда летит этот флот. |
452 | 452 | // Поэтому надо выбирать флоты, чьи координаты прибытия ИЛИ отбытия совпадают с координатами прибытия ИЛИ отбытия текущего флота. |
@@ -462,9 +462,9 @@ discard block |
||
462 | 462 | FLEET1.fleet_end_planet = FLEET0.fleet_end_planet |
463 | 463 | " . |
464 | 464 | // Блокировка всех юнитов, принадлежащих этим флотам |
465 | - "LEFT JOIN {{unit}} as UNIT1 ON UNIT1.unit_location_type = " . LOC_FLEET . " AND UNIT1.unit_location_id = FLEET1.fleet_id " . |
|
465 | + "LEFT JOIN {{unit}} as UNIT1 ON UNIT1.unit_location_type = ".LOC_FLEET." AND UNIT1.unit_location_id = FLEET1.fleet_id ". |
|
466 | 466 | // Lock fleet owner |
467 | - "LEFT JOIN {{users}} as USER1 on USER1.id = FLEET1.fleet_owner " . |
|
467 | + "LEFT JOIN {{users}} as USER1 on USER1.id = FLEET1.fleet_owner ". |
|
468 | 468 | |
469 | 469 | "LEFT JOIN {{fleets}} AS FLEET2 ON |
470 | 470 | FLEET2.fleet_mess = 1 AND FLEET0.fleet_mess = 0 AND |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | " . |
475 | 475 | // Блокировка всех юнитов, принадлежащих этим флотам |
476 | 476 | "LEFT JOIN {{unit}} as UNIT2 ON |
477 | - UNIT2.unit_location_type = " . LOC_FLEET . " AND |
|
477 | + UNIT2.unit_location_type = " . LOC_FLEET." AND |
|
478 | 478 | UNIT2.unit_location_id = FLEET2.fleet_id |
479 | 479 | " . |
480 | 480 | // Lock fleet owner |
@@ -491,11 +491,11 @@ discard block |
||
491 | 491 | " . |
492 | 492 | // Блокировка всех юнитов, принадлежащих этим флотам |
493 | 493 | "LEFT JOIN {{unit}} as UNIT3 ON |
494 | - UNIT3.unit_location_type = " . LOC_FLEET . " AND |
|
494 | + UNIT3.unit_location_type = " . LOC_FLEET." AND |
|
495 | 495 | UNIT3.unit_location_id = FLEET3.fleet_id |
496 | 496 | " . |
497 | 497 | // Lock fleet owner |
498 | - "LEFT JOIN {{users}} as USER3 on USER3.id = FLEET3.fleet_owner " . |
|
498 | + "LEFT JOIN {{users}} as USER3 on USER3.id = FLEET3.fleet_owner ". |
|
499 | 499 | |
500 | 500 | "LEFT JOIN {{fleets}} AS FLEET4 ON |
501 | 501 | FLEET4.fleet_mess = 1 AND FLEET0.fleet_mess = 1 AND |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | " . |
506 | 506 | // Блокировка всех юнитов, принадлежащих этим флотам |
507 | 507 | "LEFT JOIN {{unit}} as UNIT4 ON |
508 | - UNIT4.unit_location_type = " . LOC_FLEET . " AND |
|
508 | + UNIT4.unit_location_type = " . LOC_FLEET." AND |
|
509 | 509 | UNIT4.unit_location_id = FLEET4.fleet_id |
510 | 510 | " . |
511 | 511 | // Lock fleet owner |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | " . |
528 | 528 | // Блокировка всех юнитов, принадлежащих этой планете |
529 | 529 | "LEFT JOIN {{unit}} as UNIT5 ON |
530 | - UNIT5.unit_location_type = " . LOC_PLANET . " AND |
|
530 | + UNIT5.unit_location_type = " . LOC_PLANET." AND |
|
531 | 531 | UNIT5.unit_location_id = PLANETS5.id |
532 | 532 | " . |
533 | 533 | |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | " . |
546 | 546 | // Блокировка всех юнитов, принадлежащих этой планете |
547 | 547 | "LEFT JOIN {{unit}} as UNIT6 ON |
548 | - UNIT6.unit_location_type = " . LOC_PLANET . " AND |
|
548 | + UNIT6.unit_location_type = " . LOC_PLANET." AND |
|
549 | 549 | UNIT6.unit_location_id = PLANETS6.id |
550 | 550 | " . |
551 | 551 | "WHERE FLEET0.fleet_id = {$dbId} GROUP BY 1 FOR UPDATE" |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | } elseif ($this->isResource($unit_id)) { |
658 | 658 | $this->resource_list[$unit_id] = $unit_count; |
659 | 659 | } else { |
660 | - throw new Exception('Trying to pass to fleet non-resource and non-ship ' . var_export($unit_array, true), FLIGHT_SHIPS_UNIT_WRONG); |
|
660 | + throw new Exception('Trying to pass to fleet non-resource and non-ship '.var_export($unit_array, true), FLIGHT_SHIPS_UNIT_WRONG); |
|
661 | 661 | } |
662 | 662 | } |
663 | 663 | } |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | * @param int $unit_count |
792 | 792 | */ |
793 | 793 | public function shipSetCount($unit_id, $unit_count = 0) { |
794 | - pdump(__CLASS__ . '->' . __FUNCTION__); |
|
794 | + pdump(__CLASS__.'->'.__FUNCTION__); |
|
795 | 795 | $this->shipAdjustCount($unit_id, $unit_count, true); |
796 | 796 | } |
797 | 797 | |
@@ -983,7 +983,7 @@ discard block |
||
983 | 983 | */ |
984 | 984 | public function resourcesSet($resource_list) { |
985 | 985 | if (!empty($this->propertiesAdjusted['resource_list'])) { |
986 | - throw new ExceptionPropertyAccess('Property "resource_list" already was adjusted so no SET is possible until dbSave in ' . get_called_class() . '::unitSetResourceList', ERR_ERROR); |
|
986 | + throw new ExceptionPropertyAccess('Property "resource_list" already was adjusted so no SET is possible until dbSave in '.get_called_class().'::unitSetResourceList', ERR_ERROR); |
|
987 | 987 | } |
988 | 988 | $this->resourcesAdjust($resource_list, true); |
989 | 989 | } |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | // Check for negative unit value |
1018 | 1018 | if ($this->resource_list[$resource_id] < 0) { |
1019 | 1019 | // TODO |
1020 | - throw new Exception('Resource ' . $resource_id . ' will become negative in ' . get_called_class() . '::unitAdjustResourceList', ERR_ERROR); |
|
1020 | + throw new Exception('Resource '.$resource_id.' will become negative in '.get_called_class().'::unitAdjustResourceList', ERR_ERROR); |
|
1021 | 1021 | } |
1022 | 1022 | } |
1023 | 1023 | } |
@@ -1325,14 +1325,14 @@ discard block |
||
1325 | 1325 | if (FLIGHT_ALLOWED == $validateResult[$missionType]) { |
1326 | 1326 | $this->allowed_missions[$missionType] = $mission; |
1327 | 1327 | } else { |
1328 | - if($missionType == $this->mission_type) { |
|
1328 | + if ($missionType == $this->mission_type) { |
|
1329 | 1329 | } |
1330 | 1330 | unset($this->allowed_missions[$missionType]); |
1331 | 1331 | } |
1332 | 1332 | } |
1333 | 1333 | |
1334 | - if(empty($this->allowed_missions)) { |
|
1335 | - if($this->mission_type != MT_NONE && isset($validateResult[$this->mission_type])) { |
|
1334 | + if (empty($this->allowed_missions)) { |
|
1335 | + if ($this->mission_type != MT_NONE && isset($validateResult[$this->mission_type])) { |
|
1336 | 1336 | throw new ExceptionFleetInvalid($validateResult[$this->mission_type], $validateResult[$this->mission_type]); |
1337 | 1337 | } else { |
1338 | 1338 | throw new ExceptionFleetInvalid(FLIGHT_MISSION_IMPOSSIBLE, FLIGHT_MISSION_IMPOSSIBLE); |
@@ -1570,7 +1570,7 @@ discard block |
||
1570 | 1570 | $template_result['.']['fleets'][] = $this->fleetRenderer->renderFleet($this, SN_TIME_NOW, $timeMissionJob); |
1571 | 1571 | |
1572 | 1572 | $template_result += array( |
1573 | - 'mission' => classLocale::$lang['type_mission'][$this->_mission_type] . ($this->_mission_type == MT_EXPLORE || $this->_mission_type == MT_HOLD ? ' ' . pretty_time($timeMissionJob) : ''), |
|
1573 | + 'mission' => classLocale::$lang['type_mission'][$this->_mission_type].($this->_mission_type == MT_EXPLORE || $this->_mission_type == MT_HOLD ? ' '.pretty_time($timeMissionJob) : ''), |
|
1574 | 1574 | 'dist' => pretty_number($this->travelData['distance']), |
1575 | 1575 | 'speed' => pretty_number($this->travelData['fleet_speed']), |
1576 | 1576 | 'deute_need' => pretty_number($this->travelData['consumption']), |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $this->rowOperator = $gc->dbGlobalRowOperator; |
76 | 76 | $this->accessors = new Accessors(); |
77 | 77 | |
78 | - if(property_exists($this, 'newProperties') && !empty($this->newProperties)) { |
|
78 | + if (property_exists($this, 'newProperties') && !empty($this->newProperties)) { |
|
79 | 79 | $this->extendProperties($this->newProperties); |
80 | 80 | } |
81 | 81 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @throws \Exception |
222 | 222 | */ |
223 | 223 | protected function delete($cEntity) { |
224 | - throw new \Exception(__CLASS__ . '::delete() in ' . get_called_class() . 'is not yet implemented'); |
|
224 | + throw new \Exception(__CLASS__.'::delete() in '.get_called_class().'is not yet implemented'); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | // Generate changeset row |
243 | 243 | // Foreach all rows. If there is change and no delta - then put delta. Otherwise put change |
244 | 244 | // If row not empty - update |
245 | - throw new \Exception(__CLASS__ . '::update() in ' . get_called_class() . 'is not yet implemented'); |
|
245 | + throw new \Exception(__CLASS__.'::update() in '.get_called_class().'is not yet implemented'); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
@@ -250,10 +250,10 @@ discard block |
||
250 | 250 | * |
251 | 251 | * @throws \Exception |
252 | 252 | */ |
253 | - protected function unchanged($cEntity){ |
|
253 | + protected function unchanged($cEntity) { |
|
254 | 254 | // TODO - or just save nothing ????? |
255 | 255 | // throw new \Exception('EntityModel isNotEmpty, have dbId and not CHANGED! It can\'t be!'); |
256 | - throw new \Exception(__CLASS__ . '::unchanged() in ' . get_called_class() . 'is not yet implemented'); |
|
256 | + throw new \Exception(__CLASS__.'::unchanged() in '.get_called_class().'is not yet implemented'); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | protected function emptyAction($cEntity) { |
265 | 265 | // Just created container and doesn't use it |
266 | 266 | // throw new \Exception('EntityModel isEmpty but not loaded! It can\'t be!'); |
267 | - throw new \Exception(__CLASS__ . '::emptyAction() in ' . get_called_class() . 'is not yet implemented'); |
|
267 | + throw new \Exception(__CLASS__.'::emptyAction() in '.get_called_class().'is not yet implemented'); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | protected function save(EntityContainer $cEntity) { |