@@ -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 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $source_planet = &$mission_data['src_planet']; |
| 15 | 15 | $destination_planet = &$mission_data['dst_planet']; |
| 16 | 16 | |
| 17 | - if(!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
| 17 | + if (!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
| 18 | 18 | { |
| 19 | 19 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
| 20 | 20 | fleet_send_back($fleet_row); |
@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
| 28 | 28 | $fleet_row['fleet_resource_metal'], $lang['Metal'], |
| 29 | 29 | $fleet_row['fleet_resource_crystal'], $lang['Crystal'], |
| 30 | - $fleet_row['fleet_resource_deuterium'], $lang['Deuterium'] ); |
|
| 30 | + $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']); |
|
| 31 | 31 | msg_send_simple_message($fleet_row['fleet_target_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message); |
| 32 | 32 | |
| 33 | - if($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
| 33 | + if ($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
| 34 | 34 | { |
| 35 | 35 | msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message); |
| 36 | 36 | } |
@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | 'planet' => $target_planet = sys_get_param_int('planet'), |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | -if(!uni_coordinates_valid($target_coord)) |
|
| 32 | +if (!uni_coordinates_valid($target_coord)) |
|
| 33 | 33 | { |
| 34 | 34 | die($lang['gs_c02']); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $target_mission = sys_get_param_int('mission'); |
| 38 | 38 | $sn_group_missions = sn_get_groups('missions'); |
| 39 | -if(!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX']) |
|
| 39 | +if (!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX']) |
|
| 40 | 40 | { |
| 41 | 41 | die($lang['gs_c00']); |
| 42 | 42 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $target_coord['planet_type'] = $target_planet_check; |
| 53 | 53 | $target_row = DBStaticPlanet::db_planet_by_vector($target_coord); |
| 54 | 54 | |
| 55 | -if(empty($target_row)) |
|
| 55 | +if (empty($target_row)) |
|
| 56 | 56 | { |
| 57 | 57 | $target_row = array( |
| 58 | 58 | 'galaxy' => $target_coord['galaxy'], |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $fleet_array = array(); |
| 67 | -switch($target_mission) |
|
| 67 | +switch ($target_mission) |
|
| 68 | 68 | { |
| 69 | 69 | case MT_SPY: |
| 70 | 70 | // $fleet_array[SHIP_SPY] = min(mrc_get_level($user, $planetrow, SHIP_SPY), abs($user['spio_anz'])); |
@@ -73,9 +73,9 @@ discard block |
||
| 73 | 73 | break; |
| 74 | 74 | |
| 75 | 75 | case MT_RECYCLE: |
| 76 | - foreach(sn_get_groups('flt_recyclers') as $unit_id) |
|
| 76 | + foreach (sn_get_groups('flt_recyclers') as $unit_id) |
|
| 77 | 77 | { |
| 78 | - if($unit_count = mrc_get_level($user, $planetrow, $unit_id)) |
|
| 78 | + if ($unit_count = mrc_get_level($user, $planetrow, $unit_id)) |
|
| 79 | 79 | { |
| 80 | 80 | $fleet_array[$unit_id] = $unit_count; |
| 81 | 81 | } |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | $cant_attack = flt_can_attack($planetrow, $target_row, $fleet_array, $target_mission, $options); |
| 97 | 97 | |
| 98 | 98 | |
| 99 | -if($cant_attack != ATTACK_ALLOWED) |
|
| 99 | +if ($cant_attack != ATTACK_ALLOWED) |
|
| 100 | 100 | { |
| 101 | 101 | die($lang['fl_attack_error'][$cant_attack]); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -$FleetDBArray = array(); |
|
| 104 | +$FleetDBArray = array(); |
|
| 105 | 105 | $db_changeset = array(); |
| 106 | -foreach($fleet_array as $unit_id => $unit_count) |
|
| 106 | +foreach ($fleet_array as $unit_id => $unit_count) |
|
| 107 | 107 | { |
| 108 | 108 | $FleetDBArray[] = "{$unit_id},{$unit_count}"; |
| 109 | 109 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, -$unit_count, $user, $planetrow); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $fleet_ship_count = array_sum($fleet_array); |
| 114 | 114 | |
| 115 | -if($target_mission == MT_MISSILE) |
|
| 115 | +if ($target_mission == MT_MISSILE) |
|
| 116 | 116 | { |
| 117 | 117 | $distance = abs($target_coord['system'] - $planetrow['system']); |
| 118 | 118 | $duration = round((30 + (60 * $distance)) / flt_server_flight_speed_multiplier()); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | $travel_data = flt_travel_data($user, $planetrow, $target_coord, $fleet_array, 10); |
| 132 | 132 | |
| 133 | - if($planetrow['deuterium'] < $travel_data['consumption']) |
|
| 133 | + if ($planetrow['deuterium'] < $travel_data['consumption']) |
|
| 134 | 134 | { |
| 135 | 135 | die($lang['gs_c13']); |
| 136 | 136 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $ships_sent = array(); |
| 190 | 190 | //$ships_sent_js = array(); |
| 191 | 191 | $ships_sent_js = 0; |
| 192 | -foreach($fleet_array as $unit_id => $unit_count) |
|
| 192 | +foreach ($fleet_array as $unit_id => $unit_count) |
|
| 193 | 193 | { |
| 194 | 194 | $ships_sent[] = "{$unit_count} {$lang['tech'][$unit_id]}"; |
| 195 | 195 | $ships_sent_js += mrc_get_level($user, $planetrow, $unit_id, false, true); |
@@ -198,6 +198,6 @@ discard block |
||
| 198 | 198 | //$ships_sent_js = implode(',', $ships_sent_js); |
| 199 | 199 | $ships_sent_js = "{$unit_group}={$ships_sent_js}"; |
| 200 | 200 | |
| 201 | -$ResultMessage = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}"; |
|
| 201 | +$ResultMessage = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}"; |
|
| 202 | 202 | |
| 203 | 203 | die($ResultMessage); |
@@ -5,14 +5,14 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | global $template; |
| 7 | 7 | |
| 8 | -if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
| 8 | +if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
| 9 | 9 | require_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 10 | - if($sn_page_name) { |
|
| 10 | + if ($sn_page_name) { |
|
| 11 | 11 | // Loading page-specific language files |
| 12 | 12 | |
| 13 | 13 | !empty($sn_mvc['model'][$sn_page_name]) and execute_hooks($sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name); |
| 14 | 14 | !empty($sn_mvc['view'][$sn_page_name]) and execute_hooks($sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name); |
| 15 | - if(!empty($template_result) && is_object($template)) { |
|
| 15 | + if (!empty($template_result) && is_object($template)) { |
|
| 16 | 16 | $template->assign_recursive($template_result); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | define('IN_AJAX', true); |
| 23 | 23 | |
| 24 | - if(!is_object($template)) { |
|
| 24 | + if (!is_object($template)) { |
|
| 25 | 25 | $template = gettemplate('_ajax', true); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -37,16 +37,16 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $mode = sys_get_param_str('mode'); |
| 39 | 39 | |
| 40 | - if(class_exists($className = 'Pages\\Page' . ucfirst($mode))) { |
|
| 40 | + if (class_exists($className = 'Pages\\Page' . ucfirst($mode))) { |
|
| 41 | 41 | /** |
| 42 | 42 | * @var \Pages\IPage $page |
| 43 | 43 | */ |
| 44 | 44 | $page = new $className(); |
| 45 | - if(method_exists($page, 'loadParams')) { |
|
| 45 | + if (method_exists($page, 'loadParams')) { |
|
| 46 | 46 | $page->loadParams(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if(method_exists($page, $action = sys_get_param('action')) && $page->checkAction($action)) { |
|
| 49 | + if (method_exists($page, $action = sys_get_param('action')) && $page->checkAction($action)) { |
|
| 50 | 50 | $result = $page->$action(); |
| 51 | 51 | is_array($result) ? HelperArray::merge($template_result['AJAX'], $result) : false; |
| 52 | 52 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | QUEST_STATUS_COMPLETE => '', |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | - if(!isset($statuses[$this->filterQuestStatus])) { |
|
| 34 | + if (!isset($statuses[$this->filterQuestStatus])) { |
|
| 35 | 35 | $this->filterQuestStatus = QUEST_STATUS_ALL; |
| 36 | 36 | } |
| 37 | 37 | } |