$stmt->bindParam(':email', $_SESSION['username']); $stmt->execute(); $playerinfo = $stmt->fetch(PDO::FETCH_ASSOC); if (array_key_exists('sure', $_GET)) { $sure = $_GET['sure']; } if (!isset($sure)) { echo "<font color=red><strong>" . $langvars['l_die_rusure'] . "</strong></font><br><br>"; echo "Please Note: You will loose all your Planets if you Self-Destruct!.<br>\n"; echo "<a href='main.php'>" . $langvars['l_die_nonono'] . "</a> " . $langvars['l_die_what'] . "<br><br>"; echo "<a href=self_destruct.php?sure=1>" . $langvars['l_yes'] . "!</a> " . $langvars['l_die_goodbye'] . "<br><br>"; } elseif ($sure == 1) { echo "<font color=red><strong>" . $langvars['l_die_check'] . "</strong></font><br><br>"; echo "Please Note: You will loose all your Planets if you Self-Destruct!.<br>\n"; echo "<a href='main.php'>" . $langvars['l_die_nonono'] . "</a> " . $langvars['l_die_what'] . "<br><br>"; echo "<a href=self_destruct.php?sure=2>" . $langvars['l_yes'] . "!</a> " . $langvars['l_die_goodbye'] . "<br><br>"; } elseif ($sure == 2) { echo $langvars['l_die_count'] . "<br>"; echo $langvars['l_die_vapor'] . "<br><br>"; $langvars['l_die_please'] = str_replace("[logout]", "<a href='logout.php'>" . $langvars['l_logout'] . "</a>", $langvars['l_die_please']); echo $langvars['l_die_please'] . "<br>"; Tki\Character::kill($pdo_db, $playerinfo['ship_id'], $langvars, $tkireg, true); Tki\Bounty::cancel($pdo_db, $playerinfo['ship_id']); Tki\AdminLog::writeLog($pdo_db, LOG_ADMIN_HARAKIRI, "{$playerinfo['character_name']}|" . $request->server->get('REMOTE_ADDR') . ""); Tki\PlayerLog::WriteLog($pdo_db, $playerinfo['ship_id'], LOG_HARAKIRI, $request->server->get('REMOTE_ADDR')); echo "Due to nobody looking after your Planets, all your Planets have reduced into dust and ruble. Your Planets are no more.<br>\n"; } else { echo $langvars['l_die_exploit'] . "<br><br>"; } Tki\Text::gotomain($pdo_db, $lang); Tki\Footer::display($pdo_db, $lang, $tkireg, $template);
$update4b = $db->Execute("UPDATE {$db->prefix}ships SET ship_energy = ?, ship_fighters = ship_fighters - ?, armor_pts = armor_pts - ?, torps = torps - ?, " . "turns = turns - 1, turns_used = turns_used + 1, rating = rating - ? " . "WHERE ship_id = ?;", array($energy, $fighters_lost, $armor_lost, $playertorpnum, $rating_change, $playerinfo['ship_id'])); Tki\Db::LogDbErrors($pdo_db, $update4b, __LINE__, __FILE__); echo $langvars['l_att_ylost'] . " " . $armor_lost . " " . $langvars['l_armorpts'], $fighters_lost . " " . $langvars['l_fighters'], $langvars['l_att_andused'] . " " . $playertorpnum . " " . $langvars['l_torps'] . ".<br><br>"; } if ($playerarmor < 1) { echo $langvars['l_att_yshiplost'] . "<br><br>"; if ($playerinfo['dev_escapepod'] == "Y") { $rating = round($playerinfo['rating'] / 2); echo $langvars['l_att_loosepod'] . "<br><br>"; $resx = $db->Execute("UPDATE {$db->prefix}ships SET hull = 0, engines = 0, power = 0, sensors = 0, computer = 0, beams = 0, torp_launchers = 0, torps = 0, " . "armor = 0, armor_pts = 100, cloak = 0, shields = 0, sector = 0, ship_organics = 0, ship_ore = 0, ship_goods = 0, ship_energy = ?, " . "ship_colonists = 0, ship_fighters = 100, dev_warpedit = 0, dev_genesis = 0, dev_beacon = 0, dev_emerwarp = 0, dev_escapepod = 'N', " . "dev_fuelscoop = 'N', dev_minedeflector = 0, on_planet = 'N', rating = ?, dev_lssd = 'N' " . "WHERE ship_id = ?", array($tkireg->start_energy, $rating, $playerinfo['ship_id'])); Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); Tki\Bounty::collect($pdo_db, $langvars, $targetinfo['ship_id'], $playerinfo['ship_id']); } else { echo "Didnt have pod?! {$playerinfo['dev_escapepod']}<br>"; Tki\Character::kill($pdo_db, $playerinfo['ship_id'], $langvars, $tkireg, false); Tki\Bounty::collect($pdo_db, $langvars, $targetinfo['ship_id'], $playerinfo['ship_id']); } if ($targetarmor > 0) { $salv_credits = 0; $free_ore = round($playerinfo['ship_ore'] / 2); $free_organics = round($playerinfo['ship_organics'] / 2); $free_goods = round($playerinfo['ship_goods'] / 2); $free_holds = Tki\CalcLevels::holds($targetinfo['hull'], $tkireg) - $targetinfo['ship_ore'] - $targetinfo['ship_organics'] - $targetinfo['ship_goods'] - $targetinfo['ship_colonists']; if ($free_holds > $free_goods) { $salv_goods = $free_goods; $free_holds = $free_holds - $free_goods; } elseif ($free_holds > 0) { $salv_goods = $free_holds; $free_holds = 0; } else { $salv_goods = 0;