* Fleet command Script * Created * By: Moriarty * On: 22/2/03 ************************************************************/ require_once "user.inc.php"; ship_status_checker(); //$output_str = "Due to a recent bungle by the head of Sol Fleet Administration, Fleet Command is not yet fully functional. <br />We appologise for the Administrators Ineptness, and will have the service functioning ASAP.<p />"; if (isset($fleet_id_2) && $fleet_id_2 != 0) { $fleet_id = $fleet_id_2; } /************* * Change Fleets **************/ if (isset($fleet_manip) && ($fleet_manip == 0 || $fleet_manip == 1)) { $output_str .= "<br />" . change_fleet_num($fleet_id, $fleet_manip, $do_ship, $cw['ship_id']); /************* * Destroy Ships **************/ } elseif (isset($fleet_manip) && $fleet_manip == 2) { $rs .= "<br /><a href='fleet_command.php'>" . $cw['back_to_fleet_command'] . "</a>"; if (!$do_ship && $fleet_id == 0) { print_page($cw['self_destruct'], $st[563]); } //blow up a fleet if (isset($fleet_id) && $fleet_id != 0) { if ($user_ship['fleet_id'] == $fleet_id) { print_page($cw['self_destruct'], $st[564]); } db("select count(*) from {$db_name}_ships where fleet_id = '{$fleet_id}' && login_id = '{$user['login_id']}'"); $target_ship = dbr();
$user['on_planet'] = 0; } #change a ship's fleet if (isset($fleet_type)) { if ($join_fleet_id_2 != '') { $join_fleet_id = $join_fleet_id_2; } if (isset($do_ship_type)) { #selected by ship type $other = "shipclass"; } else { #selected by ship $other = "ship_id"; $do_ship_type = $do_ship; } $user_loc_message = change_fleet_num($join_fleet_id, $fleet_type, $do_ship_type, $other); } // command a different ship if (!empty($command)) { if ($command == 0 || $command == 1) { print_page($cw['error'], $st[4]); } db("select * from {$db_name}_ships where ship_id = {$command}"); $temp_ship = dbr(1); if ($temp_ship['login_id'] == $user['login_id']) { if ($temp_ship['location'] != $user['location']) { $dist = get_star_dist($user['location'], $temp_ship['location']); if ($dist < 12) { if ($dist > $user['turns']) { print_page($cw['command_failed'], sprintf($st[5], $dist, $user[turns])); } else {
} $temp_str .= quick_row($cw['delta_bombs'], $res3['delta']); } $temp_str .= "</table><br />"; print_page($cw['clan_info'], $temp_str . $x_link); } else { // print normal page for clan-member db("select * from {$db_name}_clans where clan_id = {$user['clan_id']}"); $clan = dbr(1); $clan_name = stripslashes($clan['clan_name']); #change a ship's fleet if (isset($fleet_type) && $user['login_id'] == $clan['leader_id']) { if ($join_fleet_id_2 != 0) { $join_fleet_id = $join_fleet_id_2; } $error_str .= "<br />" . change_fleet_num($join_fleet_id, 1, $do_ship, "ship_id") . "<p /><br />"; } $error_str .= sprintf($st[559], $clan_name, $clan[sym_color], $clan[symbol]); if ($clan['leader_id'] == $user['login_id']) { $error_str .= sprintf($st[560], $clan[passwd]); } $error_str .= make_table(array($cw['member'], $cw['turns'], $cw['cash'], $cw['tech_units'], $cw['kills'], $cw['last_activity'])); db("select login_name,turns,cash,tech,ships_killed,last_request,login_id from {$db_name}_users where clan_id = {$user['clan_id']} order by login_name,ships_killed"); $clan_member = dbr(1); while ($clan_member) { if ($clan['leader_id'] == $clan_member['login_id']) { $clan_member['login_name'] = "(L) " . print_name($clan_member); } else { $clan_member['login_name'] = print_name($clan_member); } if ($clan_member['last_request'] > time() - 300) {