示例#1
0
// Get the Player Info
$playerinfo = $sql_manager->playerinfo($user_ship_id, "");
// Empty out Planet and Ship vars
$planetinfo = null;
// Check if planet_id is valid.
if ($planet_id <= 0) {
    echo "Invalid Planet<br/><br/>";
    text_GOTOMAIN();
    include "footer.php";
    die;
}
$sectorinfo = $sql_manager->universeinfo($playerinfo['sector'], "");
# Load Sector Information
$planetinfo = $sql_manager->planetinfo($planet_id, "");
# Load Planet Information
$are_you_real = $sql_manager->real_planet($planet_id);
// Check to see if it returned valid planet info.
if ($are_you_real < 1 || is_bool($planetinfo) && $planetinfo == false) {
    echo "Invalid Planet<br/><br/>";
    text_GOTOMAIN();
    die;
}
if (!is_bool($planetinfo) && $planetinfo != false) {
    if ($playerinfo['sector'] != $planetinfo['sector_id']) {
        if ($playerinfo['on_planet'] == 'Y') {
            /*User not in the sector, most likely the ship was destroyed when a player attacked the planet they where parked on*/
            $resx = $db->Execute("UPDATE {$db->prefix}ships SET on_planet='N' WHERE ship_id={$playerinfo['ship_id']}");
            db_op_result($db, $resx, __LINE__, __FILE__, $db_logging);
        }
        echo "You are not in the same sector as this planet, so you can't interact with it.<br/>";
        text_GOTOMAIN();