@@ -142,7 +142,7 @@ |
||
| 142 | 142 | */ |
| 143 | 143 | // TODO - do a check that all fields present in stored data. I.e. no empty fields with no defaults |
| 144 | 144 | public function insert() { |
| 145 | - if(!parent::insert()) { |
|
| 145 | + if (!parent::insert()) { |
|
| 146 | 146 | return false; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $this->Field = isset($mySqlDescription['Field']) ? $mySqlDescription['Field'] : null; |
| 30 | 30 | $this->Type = isset($mySqlDescription['Type']) ? $mySqlDescription['Type'] : null; |
| 31 | 31 | $this->Collation = isset($mySqlDescription['Collation']) ? $mySqlDescription['Collation'] : null; |
| 32 | - $this->Null = isset($mySqlDescription['Null']) ? $mySqlDescription['Null'] : null; |
|
| 32 | + $this->null = isset($mySqlDescription['Null']) ? $mySqlDescription['Null'] : null; |
|
| 33 | 33 | $this->Key = isset($mySqlDescription['Key']) ? $mySqlDescription['Key'] : null; |
| 34 | 34 | $this->Default = isset($mySqlDescription['Default']) ? $mySqlDescription['Default'] : null; |
| 35 | 35 | $this->Extra = isset($mySqlDescription['Extra']) ? $mySqlDescription['Extra'] : null; |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | return $Message; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | -if(($action = sys_get_param_int('action')) && in_array($unit_id = sys_get_param_int('unit_id'), $sn_group_artifacts)) |
|
| 67 | +if (($action = sys_get_param_int('action')) && in_array($unit_id = sys_get_param_int('unit_id'), $sn_group_artifacts)) |
|
| 68 | 68 | { |
| 69 | 69 | $Message = ''; |
| 70 | - switch($action) |
|
| 70 | + switch ($action) |
|
| 71 | 71 | { |
| 72 | 72 | case ACTION_BUY: |
| 73 | 73 | $Message = art_buy($user, $unit_id, $planetrow, $lang); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $template = gettemplate('artifacts', true); |
| 87 | 87 | |
| 88 | -foreach($sn_group_artifacts as $artifact_id) |
|
| 88 | +foreach ($sn_group_artifacts as $artifact_id) |
|
| 89 | 89 | { |
| 90 | 90 | $artifact_level = mrc_get_level($user, [], $artifact_id, true); |
| 91 | 91 | $build_data = eco_get_build_data($user, $planetrow, $artifact_id, $artifact_level); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | public function unset_by_prefix($prefix_unset = '') { |
| 152 | 152 | static $array_clear; |
| 153 | - !$array_clear ? $array_clear = function (&$v, $k, $p) { |
|
| 153 | + !$array_clear ? $array_clear = function(&$v, $k, $p) { |
|
| 154 | 154 | strpos($k, $p) === 0 ? $v = null : false; |
| 155 | 155 | } : false; |
| 156 | 156 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | if ($this->$name[0] === null) { |
| 206 | 206 | for ($i = count($name) - 1; $i > 0; $i--) { |
| 207 | 207 | $cName = "{$name[$i]}_COUNT"; |
| 208 | - $cName1 = "{$name[$i-1]}_COUNT"; |
|
| 208 | + $cName1 = "{$name[$i - 1]}_COUNT"; |
|
| 209 | 209 | if ($this->$cName1 == null || $i == 1) { |
| 210 | 210 | $this->$cName++; |
| 211 | 211 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | $count = count($name); |
| 252 | 252 | for ($i = 1; $i < $count; $i++) { |
| 253 | 253 | $cName = "{$name[$i]}_COUNT"; |
| 254 | - $cName1 = "{$name[$i-1]}_COUNT"; |
|
| 254 | + $cName1 = "{$name[$i - 1]}_COUNT"; |
|
| 255 | 255 | |
| 256 | 256 | if ($i == 1 || $this->$cName1 === null) { |
| 257 | 257 | $this->$cName--; |
@@ -109,33 +109,33 @@ discard block |
||
| 109 | 109 | `ube_report_time_combat` = '" . date(FMT_DATE_TIME_SQL, $combat_data[UBE_TIME]) . "', |
| 110 | 110 | `ube_report_time_spent` = {$combat_data[UBE_TIME_SPENT]}, |
| 111 | 111 | |
| 112 | - `ube_report_combat_admin` = " . (int)$combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ", |
|
| 112 | + `ube_report_combat_admin` = " . (int) $combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ", |
|
| 113 | 113 | `ube_report_mission_type` = {$combat_data[UBE_OPTIONS][UBE_MISSION_TYPE]}, |
| 114 | 114 | |
| 115 | 115 | `ube_report_combat_result` = {$outcome[UBE_COMBAT_RESULT]}, |
| 116 | - `ube_report_combat_sfr` = " . (int)$outcome[UBE_SFR] . ", |
|
| 116 | + `ube_report_combat_sfr` = " . (int) $outcome[UBE_SFR] . ", |
|
| 117 | 117 | |
| 118 | - `ube_report_debris_metal` = " . (float)$outcome[UBE_DEBRIS][RES_METAL] . ", |
|
| 119 | - `ube_report_debris_crystal` = " . (float)$outcome[UBE_DEBRIS][RES_CRYSTAL] . ", |
|
| 118 | + `ube_report_debris_metal` = " . (float) $outcome[UBE_DEBRIS][RES_METAL] . ", |
|
| 119 | + `ube_report_debris_crystal` = " . (float) $outcome[UBE_DEBRIS][RES_CRYSTAL] . ", |
|
| 120 | 120 | `ube_report_debris_total_in_metal` = " . $ube_report_debris_total_in_metal . ", |
| 121 | 121 | |
| 122 | - `ube_report_planet_id` = " . (int)$outcome[UBE_PLANET][PLANET_ID] . ", |
|
| 122 | + `ube_report_planet_id` = " . (int) $outcome[UBE_PLANET][PLANET_ID] . ", |
|
| 123 | 123 | `ube_report_planet_name` = '" . db_escape($outcome[UBE_PLANET][PLANET_NAME]) . "', |
| 124 | - `ube_report_planet_size` = " . (int)$outcome[UBE_PLANET][PLANET_SIZE] . ", |
|
| 125 | - `ube_report_planet_galaxy` = " . (int)$outcome[UBE_PLANET][PLANET_GALAXY] . ", |
|
| 126 | - `ube_report_planet_system` = " . (int)$outcome[UBE_PLANET][PLANET_SYSTEM] . ", |
|
| 127 | - `ube_report_planet_planet` = " . (int)$outcome[UBE_PLANET][PLANET_PLANET] . ", |
|
| 128 | - `ube_report_planet_planet_type` = " . (int)$outcome[UBE_PLANET][PLANET_TYPE] . ", |
|
| 124 | + `ube_report_planet_size` = " . (int) $outcome[UBE_PLANET][PLANET_SIZE] . ", |
|
| 125 | + `ube_report_planet_galaxy` = " . (int) $outcome[UBE_PLANET][PLANET_GALAXY] . ", |
|
| 126 | + `ube_report_planet_system` = " . (int) $outcome[UBE_PLANET][PLANET_SYSTEM] . ", |
|
| 127 | + `ube_report_planet_planet` = " . (int) $outcome[UBE_PLANET][PLANET_PLANET] . ", |
|
| 128 | + `ube_report_planet_planet_type` = " . (int) $outcome[UBE_PLANET][PLANET_TYPE] . ", |
|
| 129 | 129 | |
| 130 | - `ube_report_moon` = " . (int)$outcome[UBE_MOON] . ", |
|
| 131 | - `ube_report_moon_chance` = " . (int)$outcome[UBE_MOON_CHANCE] . ", |
|
| 132 | - `ube_report_moon_size` = " . (float)$outcome[UBE_MOON_SIZE] . ", |
|
| 130 | + `ube_report_moon` = " . (int) $outcome[UBE_MOON] . ", |
|
| 131 | + `ube_report_moon_chance` = " . (int) $outcome[UBE_MOON_CHANCE] . ", |
|
| 132 | + `ube_report_moon_size` = " . (float) $outcome[UBE_MOON_SIZE] . ", |
|
| 133 | 133 | |
| 134 | - `ube_report_moon_reapers` = " . (int)$outcome[UBE_MOON_REAPERS] . ", |
|
| 135 | - `ube_report_moon_destroy_chance` = " . (int)$outcome[UBE_MOON_DESTROY_CHANCE] . ", |
|
| 136 | - `ube_report_moon_reapers_die_chance` = " . (int)$outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ", |
|
| 134 | + `ube_report_moon_reapers` = " . (int) $outcome[UBE_MOON_REAPERS] . ", |
|
| 135 | + `ube_report_moon_destroy_chance` = " . (int) $outcome[UBE_MOON_DESTROY_CHANCE] . ", |
|
| 136 | + `ube_report_moon_reapers_die_chance` = " . (int) $outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ", |
|
| 137 | 137 | |
| 138 | - `ube_report_capture_result` = " . (int)$outcome[UBE_CAPTURE_RESULT] . " |
|
| 138 | + `ube_report_capture_result` = " . (int) $outcome[UBE_CAPTURE_RESULT] . " |
|
| 139 | 139 | "); |
| 140 | 140 | $ube_report_id = $combat_data[UBE_REPORT_ID] = db_insert_id(); |
| 141 | 141 | |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | $player_id, |
| 147 | 147 | |
| 148 | 148 | "'" . db_escape($player_info[UBE_NAME]) . "'", |
| 149 | - (int)$player_info[UBE_ATTACKER], |
|
| 149 | + (int) $player_info[UBE_ATTACKER], |
|
| 150 | 150 | |
| 151 | - (float)$player_info[UBE_BONUSES][UBE_ATTACK], |
|
| 152 | - (float)$player_info[UBE_BONUSES][UBE_SHIELD], |
|
| 153 | - (float)$player_info[UBE_BONUSES][UBE_ARMOR], |
|
| 151 | + (float) $player_info[UBE_BONUSES][UBE_ATTACK], |
|
| 152 | + (float) $player_info[UBE_BONUSES][UBE_SHIELD], |
|
| 153 | + (float) $player_info[UBE_BONUSES][UBE_ARMOR], |
|
| 154 | 154 | ); |
| 155 | 155 | } |
| 156 | 156 | |
@@ -163,20 +163,20 @@ discard block |
||
| 163 | 163 | $fleet_info[UBE_OWNER], |
| 164 | 164 | $fleet_id, |
| 165 | 165 | |
| 166 | - (float)$fleet_info[UBE_PLANET][PLANET_ID], |
|
| 166 | + (float) $fleet_info[UBE_PLANET][PLANET_ID], |
|
| 167 | 167 | "'" . db_escape($fleet_info[UBE_PLANET][PLANET_NAME]) . "'", |
| 168 | - (int)$fleet_info[UBE_PLANET][PLANET_GALAXY], |
|
| 169 | - (int)$fleet_info[UBE_PLANET][PLANET_SYSTEM], |
|
| 170 | - (int)$fleet_info[UBE_PLANET][PLANET_PLANET], |
|
| 171 | - (int)$fleet_info[UBE_PLANET][PLANET_TYPE], |
|
| 172 | - |
|
| 173 | - (float)$fleet_info[UBE_RESOURCES][RES_METAL], |
|
| 174 | - (float)$fleet_info[UBE_RESOURCES][RES_CRYSTAL], |
|
| 175 | - (float)$fleet_info[UBE_RESOURCES][RES_DEUTERIUM], |
|
| 176 | - |
|
| 177 | - (float)$fleet_info[UBE_BONUSES][UBE_ATTACK], |
|
| 178 | - (float)$fleet_info[UBE_BONUSES][UBE_SHIELD], |
|
| 179 | - (float)$fleet_info[UBE_BONUSES][UBE_ARMOR], |
|
| 168 | + (int) $fleet_info[UBE_PLANET][PLANET_GALAXY], |
|
| 169 | + (int) $fleet_info[UBE_PLANET][PLANET_SYSTEM], |
|
| 170 | + (int) $fleet_info[UBE_PLANET][PLANET_PLANET], |
|
| 171 | + (int) $fleet_info[UBE_PLANET][PLANET_TYPE], |
|
| 172 | + |
|
| 173 | + (float) $fleet_info[UBE_RESOURCES][RES_METAL], |
|
| 174 | + (float) $fleet_info[UBE_RESOURCES][RES_CRYSTAL], |
|
| 175 | + (float) $fleet_info[UBE_RESOURCES][RES_DEUTERIUM], |
|
| 176 | + |
|
| 177 | + (float) $fleet_info[UBE_BONUSES][UBE_ATTACK], |
|
| 178 | + (float) $fleet_info[UBE_BONUSES][UBE_SHIELD], |
|
| 179 | + (float) $fleet_info[UBE_BONUSES][UBE_ARMOR], |
|
| 180 | 180 | ); |
| 181 | 181 | |
| 182 | 182 | // Сохраняем итоговую информацию по ресурсам флота - потеряно, выброшено, увезено |
@@ -185,19 +185,19 @@ discard block |
||
| 185 | 185 | $ube_report_id, |
| 186 | 186 | $fleet_id, |
| 187 | 187 | |
| 188 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL], |
|
| 189 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL], |
|
| 190 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM], |
|
| 188 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL], |
|
| 189 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL], |
|
| 190 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM], |
|
| 191 | 191 | |
| 192 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL], |
|
| 193 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL], |
|
| 194 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM], |
|
| 192 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL], |
|
| 193 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL], |
|
| 194 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM], |
|
| 195 | 195 | |
| 196 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL], |
|
| 197 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL], |
|
| 198 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM], |
|
| 196 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL], |
|
| 197 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL], |
|
| 198 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM], |
|
| 199 | 199 | |
| 200 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL], |
|
| 200 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL], |
|
| 201 | 201 | ); |
| 202 | 202 | |
| 203 | 203 | // Сохраняем результаты по юнитам - потеряно и восстановлено |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | $fleet_id, |
| 210 | 210 | |
| 211 | 211 | $unit_id, |
| 212 | - (float)$fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id], |
|
| 213 | - (float)$fleet_outcome_data[UBE_UNITS_LOST][$unit_id], |
|
| 212 | + (float) $fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id], |
|
| 213 | + (float) $fleet_outcome_data[UBE_UNITS_LOST][$unit_id], |
|
| 214 | 214 | |
| 215 | 215 | $unit_sort_order, |
| 216 | 216 | ); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | $unit_id, |
| 235 | 235 | $unit_count, |
| 236 | - (int)$fleet_data[UBE_UNITS_BOOM][$unit_id], |
|
| 236 | + (int) $fleet_data[UBE_UNITS_BOOM][$unit_id], |
|
| 237 | 237 | |
| 238 | 238 | $fleet_data[UBE_ATTACK][$unit_id], |
| 239 | 239 | $fleet_data[UBE_SHIELD][$unit_id], |
@@ -272,7 +272,7 @@ |
||
| 272 | 272 | if ($query_add) { |
| 273 | 273 | $query_add = "IN ({$query_add})"; |
| 274 | 274 | if ($this->deleteRange == static::MESSAGES_DELETE_RANGE_UNCHECKED) { |
| 275 | - $query_add = "NOT {$query_add}"; |
|
| 275 | + $query_add = "not {$query_add}"; |
|
| 276 | 276 | } |
| 277 | 277 | $query_add = " AND `message_id` {$query_add}"; |
| 278 | 278 | } |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | protected function modelDelete() { |
| 245 | 245 | // No range specified - nothing to do |
| 246 | - if($this->deleteRange == static::MESSAGES_DELETE_RANGE_NONE) { |
|
| 246 | + if ($this->deleteRange == static::MESSAGES_DELETE_RANGE_NONE) { |
|
| 247 | 247 | return; |
| 248 | 248 | } |
| 249 | 249 | // Сurrent range is CHECKED and NO messages marked - nothing to do |
@@ -337,15 +337,15 @@ discard block |
||
| 337 | 337 | $template = gettemplate('msg_message_list', true); |
| 338 | 338 | while ($message_row = db_fetch($message_query)) { |
| 339 | 339 | $text = $message_row['message_text']; |
| 340 | - if($message_row['message_json']) { |
|
| 341 | - if($message_row['message_type'] == MSG_TYPE_SPY) { |
|
| 340 | + if ($message_row['message_json']) { |
|
| 341 | + if ($message_row['message_type'] == MSG_TYPE_SPY) { |
|
| 342 | 342 | $text = DecodeEspionage::decode(MissionEspionageReport::fromJson($text)); |
| 343 | 343 | } else { |
| 344 | 344 | $text = '{ Unauthorised access - please contact Administration! }'; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | } else { |
| 348 | - if(in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender']) { |
|
| 348 | + if (in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender']) { |
|
| 349 | 349 | $text = htmlspecialchars($message_row['message_text']); |
| 350 | 350 | } |
| 351 | 351 | $text = nl2br($text); |
@@ -501,8 +501,8 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | $this->markedMessageIdList = []; |
| 503 | 503 | $unsafeMarkList = sys_get_param('mark', []); |
| 504 | - foreach($unsafeMarkList as $unsafeMark) { |
|
| 505 | - if(!empty($unsafeMark = idval($unsafeMark))) { |
|
| 504 | + foreach ($unsafeMarkList as $unsafeMark) { |
|
| 505 | + if (!empty($unsafeMark = idval($unsafeMark))) { |
|
| 506 | 506 | $this->markedMessageIdList[] = $unsafeMark; |
| 507 | 507 | } |
| 508 | 508 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | MT_EXPLORE => 'flt_mission_explore', |
| 210 | 210 | ); |
| 211 | 211 | foreach ($missions_used as $mission_id => $cork) { |
| 212 | - if(empty($mission_files[$mission_id])) { |
|
| 212 | + if (empty($mission_files[$mission_id])) { |
|
| 213 | 213 | continue; |
| 214 | 214 | } |
| 215 | 215 | |
@@ -474,15 +474,11 @@ discard block |
||
| 474 | 474 | protected function flt_flyingFleetsSort($a, $b) { |
| 475 | 475 | return |
| 476 | 476 | // Сравниваем время флотов - кто раньше, тот и первый обрабатывается |
| 477 | - $a['fleet_time'] > $b['fleet_time'] ? 1 : ($a['fleet_time'] < $b['fleet_time'] ? -1 : |
|
| 478 | - // Если время - одинаковое, сравниваем события флотов |
|
| 477 | + $a['fleet_time'] > $b['fleet_time'] ? 1 : ($a['fleet_time'] < $b['fleet_time'] ? -1 : // Если время - одинаковое, сравниваем события флотов |
|
| 479 | 478 | // Если события - одинаковые, то флоты равны |
| 480 | - ($a['fleet_event'] == $b['fleet_event'] ? 0 : |
|
| 481 | - // Если события разные - первыми считаем прибывающие флоты |
|
| 482 | - ($a['fleet_event'] == EVENT_FLT_ARRIVE ? 1 : ($b['fleet_event'] == EVENT_FLT_ARRIVE ? -1 : |
|
| 483 | - // Если нет прибывающих флотов - дальше считаем флоты, которые закончили миссию |
|
| 484 | - ($a['fleet_event'] == EVENT_FLT_ACOMPLISH ? 1 : ($b['fleet_event'] == EVENT_FLT_ACOMPLISH ? -1 : |
|
| 485 | - // Если нет флотов, закончивших задание - остались возвращающиеся флоты, которые равны между собой |
|
| 479 | + ($a['fleet_event'] == $b['fleet_event'] ? 0 : // Если события разные - первыми считаем прибывающие флоты |
|
| 480 | + ($a['fleet_event'] == EVENT_FLT_ARRIVE ? 1 : ($b['fleet_event'] == EVENT_FLT_ARRIVE ? -1 : // Если нет прибывающих флотов - дальше считаем флоты, которые закончили миссию |
|
| 481 | + ($a['fleet_event'] == EVENT_FLT_ACOMPLISH ? 1 : ($b['fleet_event'] == EVENT_FLT_ACOMPLISH ? -1 : // Если нет флотов, закончивших задание - остались возвращающиеся флоты, которые равны между собой |
|
| 486 | 482 | // TODO: Добавить еще проверку по ID флота и/или времени запуска - что бы обсчитывать их в порядке запуска |
| 487 | 483 | ( |
| 488 | 484 | 0 // Вообще сюда доходить не должно - будет отсекаться на равенстве событий |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | for ($Option = 10; $Option >= 0; $Option--) |
| 98 | 98 | { |
| 99 | - $template->assign_block_vars('option', array( |
|
| 100 | - 'VALUE' => $Option * 10, |
|
| 101 | - )); |
|
| 99 | + $template->assign_block_vars('option', array( |
|
| 100 | + 'VALUE' => $Option * 10, |
|
| 101 | + )); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $capsObj = new ResourceCalculations(); |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | int_calc_storage_bar(RES_DEUTERIUM, $capsObj); |
| 166 | 166 | |
| 167 | 167 | $template->assign_vars(array( |
| 168 | - 'PLANET_NAME' => $planetrow['name'], |
|
| 169 | - 'PLANET_TYPE' => $planetrow['planet_type'], |
|
| 170 | - 'PLANET_DENSITY_INDEX' => $planet_density_index, |
|
| 171 | - 'PLANET_CORE_TEXT' => $lang['uni_planet_density_types'][$planet_density_index], |
|
| 168 | + 'PLANET_NAME' => $planetrow['name'], |
|
| 169 | + 'PLANET_TYPE' => $planetrow['planet_type'], |
|
| 170 | + 'PLANET_DENSITY_INDEX' => $planet_density_index, |
|
| 171 | + 'PLANET_CORE_TEXT' => $lang['uni_planet_density_types'][$planet_density_index], |
|
| 172 | 172 | |
| 173 | - 'PRODUCTION_LEVEL' => floor($capsObj->efficiency * 100), |
|
| 173 | + 'PRODUCTION_LEVEL' => floor($capsObj->efficiency * 100), |
|
| 174 | 174 | |
| 175 | - 'PAGE_HINT' => $lang['res_hint'], |
|
| 175 | + 'PAGE_HINT' => $lang['res_hint'], |
|
| 176 | 176 | )); |
| 177 | 177 | |
| 178 | 178 | display($template, $lang['res_planet_production']); |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | ]); |
| 51 | 51 | }; |
| 52 | 52 | |
| 53 | -$ValidList['percent'] = array ( 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ); |
|
| 53 | +$ValidList['percent'] = array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100); |
|
| 54 | 54 | $template = gettemplate('resources', true); |
| 55 | 55 | |
| 56 | 56 | $transmutation_result = sn_sys_planet_core_transmute($user, $planetrow); |
| 57 | -if(!empty($transmutation_result)) |
|
| 57 | +if (!empty($transmutation_result)) |
|
| 58 | 58 | { |
| 59 | 59 | $template->assign_block_vars('result', $transmutation_result); // array('STATUS' => $transmutation_result['STATUS'], 'MESSAGE' => $transmutation_result['MESSAGE'])); |
| 60 | 60 | } |
@@ -63,20 +63,20 @@ discard block |
||
| 63 | 63 | $production = $_POST['production']; |
| 64 | 64 | //$SubQry = ''; |
| 65 | 65 | $SubQry = array(); |
| 66 | -if(is_array($production)) { |
|
| 67 | - foreach($production as $prod_id => $percent) { |
|
| 68 | - if($percent > 100 || $percent < 0) { |
|
| 66 | +if (is_array($production)) { |
|
| 67 | + foreach ($production as $prod_id => $percent) { |
|
| 68 | + if ($percent > 100 || $percent < 0) { |
|
| 69 | 69 | $debug->warning('Supplying wrong production percent (less then 0 or greater then 100)', 'Hack attempt', 302, array('base_dump' => true)); |
| 70 | 70 | die(); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $prod_id = intval($prod_id); |
| 74 | - if(in_array($prod_id, $sn_group_factories) && get_unit_param($prod_id, P_MINING_IS_MANAGED)) { |
|
| 74 | + if (in_array($prod_id, $sn_group_factories) && get_unit_param($prod_id, P_MINING_IS_MANAGED)) { |
|
| 75 | 75 | $field_name = pname_factory_production_field_name($prod_id); |
| 76 | 76 | $percent = floor($percent / 10); |
| 77 | 77 | $planetrow[$field_name] = $percent; |
| 78 | 78 | //$SubQry .= "`{$field_name}` = '{$percent}',"; |
| 79 | - $SubQry[] = "`{$field_name}` = '{$percent}'"; |
|
| 79 | + $SubQry[] = "`{$field_name}` = '{$percent}'"; |
|
| 80 | 80 | } else { |
| 81 | 81 | $debug->warning('Supplying wrong ID in production array - attempt to change some field - ID' . $prod_id, 'Resource Page', 301); |
| 82 | 82 | continue; |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | 'ENERGY_TYPE' => prettyNumberStyledDefault($capsObj->productionCurrentMatrix[RES_ENERGY][0]), |
| 114 | 114 | )); |
| 115 | 115 | |
| 116 | -foreach($sn_group_factories as $unit_id) |
|
| 116 | +foreach ($sn_group_factories as $unit_id) |
|
| 117 | 117 | { |
| 118 | - if(mrc_get_level($user, $planetrow, $unit_id) > 0 && get_unit_param($unit_id)) |
|
| 118 | + if (mrc_get_level($user, $planetrow, $unit_id) > 0 && get_unit_param($unit_id)) |
|
| 119 | 119 | { |
| 120 | 120 | $level_plain = mrc_get_level($user, $planetrow, $unit_id, false, true); |
| 121 | 121 | $template->assign_block_vars('production', array( |
@@ -30,8 +30,7 @@ |
||
| 30 | 30 | * @param $resource_id |
| 31 | 31 | * @param ResourceCalculations $capsObj |
| 32 | 32 | */ |
| 33 | -function int_calc_storage_bar($resource_id, $capsObj) |
|
| 34 | -{ |
|
| 33 | +function int_calc_storage_bar($resource_id, $capsObj) { |
|
| 35 | 34 | global $lang, $template, $planetrow, $user; |
| 36 | 35 | |
| 37 | 36 | $totalProduction = $capsObj->getProduction($resource_id); |
@@ -77,75 +77,75 @@ |
||
| 77 | 77 | |
| 78 | 78 | // Services -------------------------------------------------------------------------------------------------------- |
| 79 | 79 | // Default db |
| 80 | - $gc->db = function (GlobalContainer $c) { |
|
| 80 | + $gc->db = function(GlobalContainer $c) { |
|
| 81 | 81 | classSupernova::$db = new \db_mysql($c); |
| 82 | 82 | |
| 83 | 83 | return classSupernova::$db; |
| 84 | 84 | }; |
| 85 | 85 | |
| 86 | - $gc->debug = function (/** @noinspection PhpUnusedParameterInspection */ |
|
| 86 | + $gc->debug = function(/** @noinspection PhpUnusedParameterInspection */ |
|
| 87 | 87 | GlobalContainer $c) { |
| 88 | 88 | return new \debug(); |
| 89 | 89 | }; |
| 90 | 90 | |
| 91 | - $gc->cache = function (GlobalContainer $gc) { |
|
| 91 | + $gc->cache = function(GlobalContainer $gc) { |
|
| 92 | 92 | return new \classCache($gc->cachePrefix); |
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | - $gc->config = function (GlobalContainer $gc) { |
|
| 95 | + $gc->config = function(GlobalContainer $gc) { |
|
| 96 | 96 | return new \classConfig($gc->cachePrefix); |
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | 99 | |
| 100 | - $gc->repository = function (GlobalContainer $gc) { |
|
| 100 | + $gc->repository = function(GlobalContainer $gc) { |
|
| 101 | 101 | return new Repository($gc); |
| 102 | 102 | }; |
| 103 | 103 | |
| 104 | - $gc->storage = function (GlobalContainer $gc) { |
|
| 104 | + $gc->storage = function(GlobalContainer $gc) { |
|
| 105 | 105 | return new \Storage($gc); |
| 106 | 106 | }; |
| 107 | 107 | |
| 108 | - $gc->design = function (GlobalContainer $gc) { |
|
| 108 | + $gc->design = function(GlobalContainer $gc) { |
|
| 109 | 109 | return new \Design($gc); |
| 110 | 110 | }; |
| 111 | 111 | |
| 112 | - $gc->bbCodeParser = function (GlobalContainer $gc) { |
|
| 112 | + $gc->bbCodeParser = function(GlobalContainer $gc) { |
|
| 113 | 113 | return new \BBCodeParser($gc); |
| 114 | 114 | }; |
| 115 | 115 | |
| 116 | - $gc->fleetDispatcher = function (GlobalContainer $gc) { |
|
| 116 | + $gc->fleetDispatcher = function(GlobalContainer $gc) { |
|
| 117 | 117 | return new \FleetDispatcher($gc); |
| 118 | 118 | }; |
| 119 | 119 | |
| 120 | - $gc->watchdog = function (GlobalContainer $gc) { |
|
| 120 | + $gc->watchdog = function(GlobalContainer $gc) { |
|
| 121 | 121 | return new Watchdog($gc); |
| 122 | 122 | }; |
| 123 | 123 | |
| 124 | - $gc->eventBus = function (GlobalContainer $gc) { |
|
| 124 | + $gc->eventBus = function(GlobalContainer $gc) { |
|
| 125 | 125 | return new EventBus($gc); |
| 126 | 126 | }; |
| 127 | 127 | |
| 128 | - $gc->general = function (GlobalContainer $gc) { |
|
| 128 | + $gc->general = function(GlobalContainer $gc) { |
|
| 129 | 129 | return new General($gc); |
| 130 | 130 | }; |
| 131 | 131 | |
| 132 | - $gc->economicHelper = function (GlobalContainer $gc) { |
|
| 132 | + $gc->economicHelper = function(GlobalContainer $gc) { |
|
| 133 | 133 | return new EconomicHelper($gc); |
| 134 | 134 | }; |
| 135 | 135 | |
| 136 | 136 | // Dummy objects --------------------------------------------------------------------------------------------------- |
| 137 | - $gc->theUser = function (GlobalContainer $gc) { |
|
| 137 | + $gc->theUser = function(GlobalContainer $gc) { |
|
| 138 | 138 | return new \TheUser($gc); |
| 139 | 139 | }; |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | // Models ---------------------------------------------------------------------------------------------------------- |
| 143 | 143 | $gc->skinEntityClass = 'SkinV2'; |
| 144 | - $gc->skinModel = function (GlobalContainer $gc) { |
|
| 144 | + $gc->skinModel = function(GlobalContainer $gc) { |
|
| 145 | 145 | return new \SkinModel($gc); |
| 146 | 146 | }; |
| 147 | 147 | |
| 148 | - $gc->textModel = function (GlobalContainer $gc) { |
|
| 148 | + $gc->textModel = function(GlobalContainer $gc) { |
|
| 149 | 149 | return new \TextModel($gc); |
| 150 | 150 | }; |
| 151 | 151 | |