@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | !is_array($offset) ? $offset = array($offset) : false; |
| 39 | 39 | |
| 40 | 40 | $current_leaf = $this->__get(reset($offset)); |
| 41 | - while(($leaf_index = next($offset)) !== false) { |
|
| 42 | - if(!isset($current_leaf) || !is_array($current_leaf) || !isset($current_leaf[$leaf_index])) { |
|
| 41 | + while (($leaf_index = next($offset)) !== false) { |
|
| 42 | + if (!isset($current_leaf) || !is_array($current_leaf) || !isset($current_leaf[$leaf_index])) { |
|
| 43 | 43 | unset($current_leaf); |
| 44 | 44 | break; |
| 45 | 45 | } |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | !is_array($offset) ? $offset = array($offset) : false; |
| 66 | 66 | |
| 67 | - if($this->offsetExists($offset)) { |
|
| 67 | + if ($this->offsetExists($offset)) { |
|
| 68 | 68 | $result = $this->__get(reset($offset)); |
| 69 | - while(($leaf_index = next($offset)) !== false) { |
|
| 69 | + while (($leaf_index = next($offset)) !== false) { |
|
| 70 | 70 | $result = $result[$leaf_index]; |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function offsetSet($offset, $value = null) { |
| 93 | 93 | // Если нет никакого индекса - значит нечего записывать |
| 94 | - if(!isset($offset) || (is_array($offset) && empty($offset))) { |
|
| 94 | + if (!isset($offset) || (is_array($offset) && empty($offset))) { |
|
| 95 | 95 | return; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Если в массиве индекса только один элемент - значит это просто индекс |
| 99 | - if(is_array($offset) && count($offset) == 1) { |
|
| 99 | + if (is_array($offset) && count($offset) == 1) { |
|
| 100 | 100 | // Разворачиваем его в индекс |
| 101 | 101 | $offset = array(reset($offset) => $value); |
| 102 | 102 | unset($value); |
@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | // Адресация многомерного массива через массив индексов в $option |
| 107 | - if(is_array($offset) && isset($value)) { |
|
| 107 | + if (is_array($offset) && isset($value)) { |
|
| 108 | 108 | // TODO - а не переделать ли это всё на __isset() ?? |
| 109 | 109 | // Вытаскиваем корневой элемент |
| 110 | 110 | $root = $this->__get(reset($offset)); |
| 111 | 111 | $current_leaf = &$root; |
| 112 | - while(($leaf_index = next($offset)) !== false) { |
|
| 112 | + while (($leaf_index = next($offset)) !== false) { |
|
| 113 | 113 | !is_array($current_leaf[$leaf_index]) ? $current_leaf[$leaf_index] = array() : false; |
| 114 | 114 | $current_leaf = &$current_leaf[$leaf_index]; |
| 115 | 115 | } |
| 116 | - if($current_leaf != $value) { |
|
| 116 | + if ($current_leaf != $value) { |
|
| 117 | 117 | $current_leaf = $value; |
| 118 | 118 | // Сохраняем данные с корня |
| 119 | 119 | $this->__set(reset($offset), $root); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | // Пакетная запись из массива ключ -> значение |
| 123 | 123 | !is_array($offset) ? $offset = array($offset => $value) : false; |
| 124 | 124 | |
| 125 | - foreach($offset as $key => $value) { |
|
| 125 | + foreach ($offset as $key => $value) { |
|
| 126 | 126 | $this->__get($key) !== $value ? $this->__set($key, $value) : false; |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -143,18 +143,18 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function offsetUnset($offset) { |
| 145 | 145 | // Если нет никакого индекса - значит нечего записывать |
| 146 | - if(!isset($offset) || (is_array($offset) && empty($offset))) { |
|
| 146 | + if (!isset($offset) || (is_array($offset) && empty($offset))) { |
|
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | !is_array($offset) ? $offset = array($offset) : false; |
| 151 | 151 | |
| 152 | - if($this->offsetExists($offset)) { |
|
| 152 | + if ($this->offsetExists($offset)) { |
|
| 153 | 153 | // Перематываем массив в конец |
| 154 | 154 | $key_to_delete = end($offset); |
| 155 | 155 | $parent_offset = $offset; |
| 156 | 156 | array_pop($parent_offset); |
| 157 | - if(!count($parent_offset)) { |
|
| 157 | + if (!count($parent_offset)) { |
|
| 158 | 158 | // В массиве был один элемент - мы удаляем в корне. Просто удаляем элемент |
| 159 | 159 | $this->__unset($key_to_delete); |
| 160 | 160 | } else { |
@@ -89,15 +89,15 @@ discard block |
||
| 89 | 89 | // Инфа об устройстве и браузере - общая для всех |
| 90 | 90 | sn_db_transaction_start(); |
| 91 | 91 | $this->device_cypher = $_COOKIE[SN_COOKIE_D]; |
| 92 | - if($this->device_cypher) { |
|
| 92 | + if ($this->device_cypher) { |
|
| 93 | 93 | $cypher_safe = db_escape($this->device_cypher); |
| 94 | 94 | $device_id = doquery("SELECT `device_id` FROM {{security_device}} WHERE `device_cypher` = '{$cypher_safe}' LIMIT 1 FOR UPDATE", true); |
| 95 | - if(!empty($device_id['device_id'])) { |
|
| 95 | + if (!empty($device_id['device_id'])) { |
|
| 96 | 96 | $this->device_id = $device_id['device_id']; |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if($this->device_id <= 0) { |
|
| 100 | + if ($this->device_id <= 0) { |
|
| 101 | 101 | do { |
| 102 | 102 | $cypher_safe = db_escape($this->device_cypher = sys_random_string()); |
| 103 | 103 | $row = doquery("SELECT `device_id` FROM {{security_device}} WHERE `device_cypher` = '{$cypher_safe}' LIMIT 1 FOR UPDATE", true); |
@@ -118,10 +118,10 @@ discard block |
||
| 118 | 118 | $this->page_address_id = db_get_set_unique_id_value($this->page_address, 'url_id', 'security_url', 'url_string'); |
| 119 | 119 | sn_db_transaction_commit(); |
| 120 | 120 | |
| 121 | - if($this->write_full_url) { |
|
| 121 | + if ($this->write_full_url) { |
|
| 122 | 122 | sn_db_transaction_start(); |
| 123 | 123 | $this->page_url = substr($_SERVER['REQUEST_URI'], strlen(SN_ROOT_RELATIVE)); |
| 124 | - if(strpos($_SERVER['REQUEST_URI'], '/simulator.php') === 0) { |
|
| 124 | + if (strpos($_SERVER['REQUEST_URI'], '/simulator.php') === 0) { |
|
| 125 | 125 | $this->page_url = '/simulator.php'; |
| 126 | 126 | } |
| 127 | 127 | $this->page_url_id = db_get_set_unique_id_value($this->page_url, 'url_id', 'security_url', 'url_string'); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function db_security_entry_insert($user_id_unsafe) { |
| 146 | 146 | // TODO $user_id = !empty(self::$user['id']) ? self::$user['id'] : 'NULL'; |
| 147 | - if(empty($user_id_unsafe)) { |
|
| 147 | + if (empty($user_id_unsafe)) { |
|
| 148 | 148 | // self::flog('Нет ИД пользователя'); |
| 149 | 149 | return true; |
| 150 | 150 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | public function db_counter_insert($user_id_unsafe) { |
| 168 | 168 | global $config, $sys_stop_log_hit, $is_watching; |
| 169 | 169 | |
| 170 | - if($sys_stop_log_hit || !$config->game_counter) { |
|
| 170 | + if ($sys_stop_log_hit || !$config->game_counter) { |
|
| 171 | 171 | return; |
| 172 | 172 | } |
| 173 | 173 | |
@@ -183,14 +183,14 @@ discard block |
||
| 183 | 183 | // $this->ip_v4_int . ", '{$proxy_safe}', " . $this->page_address_id . ", " . $this->page_url_id . ");"); |
| 184 | 184 | doquery( |
| 185 | 185 | "INSERT INTO {{counter}} SET |
| 186 | - `visit_time` = '" . SN_TIME_SQL. "', |
|
| 186 | + `visit_time` = '" . SN_TIME_SQL . "', |
|
| 187 | 187 | `user_id` = {$user_id_safe}, |
| 188 | 188 | `device_id` = {$this->device_id}, |
| 189 | 189 | `browser_id` = {$this->browser_id}, |
| 190 | 190 | `user_ip` = {$this->ip_v4_int}, |
| 191 | 191 | `user_proxy` = '{$proxy_safe}', |
| 192 | 192 | `page_url_id` = {$this->page_address_id}" . |
| 193 | - ($this->write_full_url ? ", `plain_url_id` = {$this->page_url_id}" : '' ). |
|
| 193 | + ($this->write_full_url ? ", `plain_url_id` = {$this->page_url_id}" : '') . |
|
| 194 | 194 | ";"); |
| 195 | 195 | |
| 196 | 196 | $is_watching = false; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | function db_unit_records_sum($unit_id, $user_skip_list_unit) |
| 105 | 105 | { |
| 106 | - return doquery ( |
|
| 106 | + return doquery( |
|
| 107 | 107 | "SELECT unit_player_id, username, sum(unit_level) as unit_level |
| 108 | 108 | FROM {{unit}} JOIN {{users}} AS u ON u.id = unit_player_id |
| 109 | 109 | WHERE unit_player_id != 0 AND unit_snid = {$unit_id} {$user_skip_list_unit} |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | function db_unit_records_plain($unit_id, $user_skip_list_unit) |
| 117 | 117 | { |
| 118 | - return doquery ( |
|
| 118 | + return doquery( |
|
| 119 | 119 | "SELECT unit_player_id, username, unit_level |
| 120 | 120 | FROM {{unit}} JOIN {{users}} AS u ON u.id = unit_player_id |
| 121 | 121 | WHERE unit_player_id != 0 AND unit_snid = {$unit_id} {$user_skip_list_unit} |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | function db_stat_list_statistic($who, $is_common_stat, $Rank, $start, $source = false) { |
| 128 | - if(!$source) { |
|
| 128 | + if (!$source) { |
|
| 129 | 129 | $source = array( |
| 130 | 130 | 'statpoints' => 'statpoints', |
| 131 | 131 | 'users' => 'users', |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | ); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - if($who == 1) { |
|
| 150 | - if($is_common_stat) { // , UNIX_TIMESTAMP(CONCAT(YEAR(CURRENT_DATE), DATE_FORMAT(`user_birthday`, '-%m-%d'))) AS `nearest_birthday` |
|
| 149 | + if ($who == 1) { |
|
| 150 | + if ($is_common_stat) { // , UNIX_TIMESTAMP(CONCAT(YEAR(CURRENT_DATE), DATE_FORMAT(`user_birthday`, '-%m-%d'))) AS `nearest_birthday` |
|
| 151 | 151 | $query_str = |
| 152 | 152 | "SELECT |
| 153 | 153 | @rownum:=@rownum+1 rownum, subject.{$source['id']} as `id`, sp.{$Rank}_rank as rank, sp.{$Rank}_old_rank as rank_old, sp.{$Rank}_points as points, subject.{$source['username']} as `name`, subject.* |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | ORDER BY |
| 162 | 162 | sp.`{$Rank}_rank`, subject.{$source['id']} |
| 163 | 163 | LIMIT |
| 164 | - ". $start .",100;"; |
|
| 164 | + " . $start . ",100;"; |
|
| 165 | 165 | } else { // , UNIX_TIMESTAMP(CONCAT(YEAR(CURRENT_DATE), DATE_FORMAT(`user_birthday`, '-%m-%d'))) AS `nearest_birthday` |
| 166 | 166 | $query_str = |
| 167 | 167 | "SELECT |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | ORDER BY |
| 175 | 175 | subject.{$Rank} DESC, subject.{$source['id']} |
| 176 | 176 | LIMIT |
| 177 | - ". $start .",100;"; |
|
| 177 | + " . $start . ",100;"; |
|
| 178 | 178 | } |
| 179 | 179 | } else { |
| 180 | 180 | // TODO |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | ORDER BY |
| 192 | 192 | sp.`{$Rank}_rank`, subject.id |
| 193 | 193 | LIMIT |
| 194 | - ". $start .",100;"; |
|
| 194 | + " . $start . ",100;"; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | return doquery($query_str); |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | function db_get_set_unique_id_value($current_value_unsafe, $db_id_field_name, $db_table_name, $db_value_field_name) { |
| 278 | 278 | $current_value_safe = db_escape($current_value_unsafe); |
| 279 | 279 | $value_id = doquery("SELECT `{$db_id_field_name}` AS id_field FROM {{{$db_table_name}}} WHERE `{$db_value_field_name}` = '{$current_value_safe}' LIMIT 1 FOR UPDATE", true); |
| 280 | - if(!isset($value_id['id_field']) || !$value_id['id_field']) { |
|
| 280 | + if (!isset($value_id['id_field']) || !$value_id['id_field']) { |
|
| 281 | 281 | doquery("INSERT INTO {{{$db_table_name}}} (`{$db_value_field_name}`) VALUES ('{$current_value_safe}');"); |
| 282 | 282 | $variable_id = db_insert_id(); |
| 283 | 283 | } else { |
@@ -27,19 +27,19 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | function db_set_make_safe_string($set, $delta = false) { |
| 29 | 29 | $set_safe = array(); |
| 30 | - foreach($set as $field => $value) { |
|
| 31 | - if(empty($field)) { |
|
| 30 | + foreach ($set as $field => $value) { |
|
| 31 | + if (empty($field)) { |
|
| 32 | 32 | continue; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $field = '`' . db_escape($field) . '`'; |
| 36 | 36 | $new_value = $value; |
| 37 | - if($value === null) { |
|
| 37 | + if ($value === null) { |
|
| 38 | 38 | $new_value = 'NULL'; |
| 39 | - } elseif(is_string($value) && (string)($new_value = floatval($value)) != (string)$value) { |
|
| 39 | + } elseif (is_string($value) && (string) ($new_value = floatval($value)) != (string) $value) { |
|
| 40 | 40 | // non-float |
| 41 | 41 | $new_value = '"' . db_escape($value) . '"'; |
| 42 | - } elseif($delta) { |
|
| 42 | + } elseif ($delta) { |
|
| 43 | 43 | // float and DELTA-set |
| 44 | 44 | $new_value = "{$field} + ({$new_value})"; |
| 45 | 45 | } |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | function missile_list_convert_to_fleet(&$missile_db_list, &$fleet_db_list) { |
| 61 | 61 | // Missile attack |
| 62 | - foreach($missile_db_list as $irak) { |
|
| 63 | - if($irak['fleet_end_time'] >= SN_TIME_NOW) { |
|
| 62 | + foreach ($missile_db_list as $irak) { |
|
| 63 | + if ($irak['fleet_end_time'] >= SN_TIME_NOW) { |
|
| 64 | 64 | $irak['fleet_start_type'] = PT_PLANET; |
| 65 | 65 | $planet_start = DBStaticPlanet::db_planet_by_vector($irak, 'fleet_start_', false, 'name'); |
| 66 | 66 | $irak['fleet_id'] = -$irak['id']; |
@@ -8,23 +8,23 @@ discard block |
||
| 8 | 8 | $fleet_events = array(); |
| 9 | 9 | $fleet_number = 0; |
| 10 | 10 | |
| 11 | - if(empty($fleet_list)) |
|
| 11 | + if (empty($fleet_list)) |
|
| 12 | 12 | { |
| 13 | 13 | return; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - foreach($fleet_list as $fleet) |
|
| 16 | + foreach ($fleet_list as $fleet) |
|
| 17 | 17 | { |
| 18 | 18 | $planet_start_type = $fleet['fleet_start_type'] == PT_MOON ? PT_MOON : PT_PLANET; |
| 19 | 19 | $planet_start = DBStaticPlanet::db_planet_by_gspt($fleet['fleet_start_galaxy'], $fleet['fleet_start_system'], $fleet['fleet_start_planet'], $planet_start_type, false, 'name'); |
| 20 | 20 | $fleet['fleet_start_name'] = $planet_start['name']; |
| 21 | 21 | |
| 22 | 22 | $planet_end_type = $fleet['fleet_end_type'] == PT_MOON ? PT_MOON : PT_PLANET; |
| 23 | - if($fleet['fleet_end_planet'] > $config->game_maxPlanet) |
|
| 23 | + if ($fleet['fleet_end_planet'] > $config->game_maxPlanet) |
|
| 24 | 24 | { |
| 25 | 25 | $fleet['fleet_end_name'] = $lang['ov_fleet_exploration']; |
| 26 | 26 | } |
| 27 | - elseif($fleet['fleet_mission'] == MT_COLONIZE) |
|
| 27 | + elseif ($fleet['fleet_mission'] == MT_COLONIZE) |
|
| 28 | 28 | { |
| 29 | 29 | $fleet['fleet_end_name'] = $lang['ov_fleet_colonization']; |
| 30 | 30 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $fleet['fleet_end_name'] = $planet_end['name']; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if($fleet['fleet_start_time'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] != MT_MISSILE && |
|
| 37 | + if ($fleet['fleet_start_time'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] != MT_MISSILE && |
|
| 38 | 38 | ($planet_scanned === false |
| 39 | 39 | || |
| 40 | 40 | ( |
@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | $fleet_events[] = flt_register_fleet_event($fleet, 0, $planet_end_type); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if($fleet['fleet_end_stay'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $planet_scanned === false && $fleet['fleet_mission'] != MT_MISSILE) |
|
| 52 | + if ($fleet['fleet_end_stay'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $planet_scanned === false && $fleet['fleet_mission'] != MT_MISSILE) |
|
| 53 | 53 | { |
| 54 | 54 | $fleet_events[] = flt_register_fleet_event($fleet, 1, $planet_end_type); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if( |
|
| 57 | + if ( |
|
| 58 | 58 | $fleet['fleet_end_time'] > SN_TIME_NOW && $fleet['fleet_mission'] != MT_MISSILE && ($fleet['fleet_mess'] == 1 || ($fleet['fleet_mission'] != MT_RELOCATE && $fleet['fleet_mission'] != MT_COLONIZE)) && |
| 59 | 59 | ( |
| 60 | 60 | ($planet_scanned === false && $fleet['fleet_owner'] == $user['id']) |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $fleet_events[] = flt_register_fleet_event($fleet, 2, $planet_end_type); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if($fleet['fleet_mission'] == MT_MISSILE) |
|
| 74 | + if ($fleet['fleet_mission'] == MT_MISSILE) |
|
| 75 | 75 | { |
| 76 | 76 | $fleet_events[] = flt_register_fleet_event($fleet, 3, $planet_end_type); |
| 77 | 77 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | global $user, $planetrow, $fleet_number; |
| 86 | 86 | |
| 87 | - switch($fleet['ov_label'] = $ov_label) |
|
| 87 | + switch ($fleet['ov_label'] = $ov_label) |
|
| 88 | 88 | { |
| 89 | 89 | case 0: |
| 90 | 90 | $fleet['event_time'] = $fleet['fleet_start_time']; |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $fleet['ov_this_planet'] = $is_this_planet;// || $planet_scanned != false; |
|
| 119 | + $fleet['ov_this_planet'] = $is_this_planet; // || $planet_scanned != false; |
|
| 120 | 120 | |
| 121 | - if($fleet['fleet_owner'] == $user['id']) |
|
| 121 | + if ($fleet['fleet_owner'] == $user['id']) |
|
| 122 | 122 | { |
| 123 | 123 | $user_data = $user; |
| 124 | 124 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | function flt_mission_hold(&$mission_data) |
| 4 | 4 | { |
| 5 | - if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
|
| 5 | + if ($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
|
| 6 | 6 | { |
| 7 | 7 | fleet_send_back($mission_data['fleet']); |
| 8 | 8 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $fleet_row = &$mission_data['fleet']; |
| 14 | 14 | $destination_planet = &$mission_data['dst_planet']; |
| 15 | 15 | |
| 16 | - if(!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
| 16 | + if (!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
| 17 | 17 | { |
| 18 | 18 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
| 19 | 19 | fleet_send_back($mission_data['fleet']); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $mission_data['src_planet']['name'], uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
| 27 | 27 | $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']) . |
| 28 | 28 | '<br />' . $lang['sys_relocate_mess_user']; |
| 29 | - foreach(sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
| 29 | + foreach (sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
| 30 | 30 | { |
| 31 | 31 | $Message .= $lang['tech'][$ship_id] . ' - ' . $ship_count . '<br />'; |
| 32 | 32 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | function flt_mission_destroy($mission_data) { |
| 9 | 9 | $fleet_row = $mission_data['fleet']; |
| 10 | 10 | $destination_planet = $mission_data['dst_planet']; |
| 11 | - if(!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) { |
|
| 11 | + if (!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) { |
|
| 12 | 12 | fleet_send_back($fleet_row); |
| 13 | 13 | |
| 14 | 14 | return CACHE_FLEET; |
@@ -6,12 +6,12 @@ discard block |
||
| 6 | 6 | $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']); |
| 7 | 7 | $uni_system = sys_get_param_int('system'); |
| 8 | 8 | |
| 9 | - if($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy) |
|
| 9 | + if ($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy) |
|
| 10 | 10 | { |
| 11 | 11 | throw new exception($lang['uni_msg_error_wrong_galaxy'], ERR_ERROR); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - if($uni_system < 0 || $uni_system > $config->game_maxSystem) |
|
| 14 | + if ($uni_system < 0 || $uni_system > $config->game_maxSystem) |
|
| 15 | 15 | { |
| 16 | 16 | throw new exception($lang['uni_msg_error_wrong_system'], ERR_ERROR); |
| 17 | 17 | } |
@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | $uni_row['universe_price'] += $uni_system ? $config->uni_price_system : $config->uni_price_galaxy; |
| 21 | 21 | $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$lang['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$lang['sys_galaxy']} {$uni_galaxy}")); |
| 22 | 22 | |
| 23 | - if(sys_get_param_str('uni_name_submit')) |
|
| 23 | + if (sys_get_param_str('uni_name_submit')) |
|
| 24 | 24 | { |
| 25 | 25 | $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name')); |
| 26 | 26 | |
| 27 | 27 | $uni_price = sys_get_param_float('uni_price'); |
| 28 | - if($uni_price < $uni_row['universe_price']) |
|
| 28 | + if ($uni_price < $uni_row['universe_price']) |
|
| 29 | 29 | { |
| 30 | 30 | throw new exception($lang['uni_msg_error_low_price'], ERR_ERROR); |
| 31 | 31 | } |
@@ -34,12 +34,12 @@ discard block |
||
| 34 | 34 | sn_db_transaction_start(); |
| 35 | 35 | $user = db_user_by_id($user['id'], true); |
| 36 | 36 | // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price) |
| 37 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
| 37 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
| 38 | 38 | { |
| 39 | 39 | throw new exception($lang['uni_msg_error_no_dm'], ERR_ERROR); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
| 42 | + if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
| 43 | 43 | { |
| 44 | 44 | throw new exception($lang['sys_msg_err_update_dm'], ERR_ERROR); |
| 45 | 45 | } |