* All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * --> NOTICE <-- * This file is part of the core development branch, changing its contents will * make you unable to use the automatic updates manager. Please refer to the * documentation for further information about customizing XNova. * */ define('INSIDE' , true); define('INSTALL' , false); require_once dirname(__FILE__) .'/common.php'; includeLang('fleet'); $fleetid = $_POST['fleetid']; if (!is_numeric($fleetid) || empty($fleetid)) { header("Location: overview.php"); exit(); } $query = doquery("SELECT * FROM {{table}} WHERE fleet_id = '" . $fleetid . "'", 'fleets'); if (mysql_num_rows($query) != 1) { message('Cette flotte n\'existe pas (ou plus)!', 'Erreur'); } $daten = mysql_fetch_array($query); if ($daten['fleet_start_time'] <= time() || $daten['fleet_end_time'] < time() || $daten['fleet_mess'] == 1) { message('Votre flotte est d�j� sur le chemin du retour!', 'Erreur'); } if (!isset($_POST['send'])) { SetSelectedPlanet ( $user ); $planetrow = doquery("SELECT * FROM {{table}} WHERE `id` = '".$user['current_planet']."';", 'planets', true); $galaxyrow = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '".$planetrow['id']."';", 'galaxy', true); $dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"]; $maxfleet = doquery("SELECT COUNT(fleet_owner) as ilosc FROM {{table}} WHERE fleet_owner='{$user['id']}'", 'fleets', true); $maxfleet_count = $maxfleet["ilosc"]; CheckPlanetUsedFields($planetrow); $fleet = doquery("SELECT * FROM {{table}} WHERE fleet_id = '" . $fleetid . "'", 'fleets', true); if (empty($fleet['fleet_group'])) { $rand = mt_rand(100000, 999999999); doquery( "INSERT INTO {{table}} SET `name` = 'KV" . $rand . "', `teilnehmer` = '" . $user['id'] . "', `flotten` = '" . $fleetid . "', `ankunft` = '" . $fleet['fleet_start_time'] . "', `galaxy` = '" . $fleet['fleet_start_galaxy'] . "', `system` = '" . $fleet['fleet_start_system'] . "', `planet` = '" . $fleet['fleet_start_planet'] . "', `eingeladen` = '" . $user['id'] . "' ", 'aks'); $aks = doquery( "SELECT * FROM {{table}} WHERE `name` = 'KV" . $rand . "' AND `teilnehmer` = '" . $user['id'] . "' AND `flotten` = '" . $fleetid . "' AND `ankunft` = '" . $fleet['fleet_start_time'] . "' AND `galaxy` = '" . $fleet['fleet_start_galaxy'] . "' AND `system` = '" . $fleet['fleet_start_system'] . "' AND `planet` = '" . $fleet['fleet_start_planet'] . "' AND `eingeladen` = '" . $user['id'] . "' ", 'aks', true); doquery( "UPDATE {{table}} SET fleet_group = '" . $aks['id'] . "' WHERE fleet_id = '" . $fleetid . "'", 'fleets'); } else { $aks = doquery( "SELECT * FROM {{table}} WHERE id = '" . $fleet['fleet_group'] . "'" , 'aks'); if (mysql_num_rows($aks) != 1) { message('AKS nicht gefunden!', 'Fehler'); } $aks = mysql_num_rows($aks); } $missiontype = array(1 => 'Attaquer', 2 => 'Zerstören', 3 => 'Transporter', 4 => 'Stationner', 5 => 'Halten', 6 => 'Espionner', 7 => 'Coloniser', 8 => 'Recycler', 9 => 'Coloniser', ); $speed = array(10 => 100, 9 => 90, 8 => 80, 7 => 70, 6 => 60, 5 => 50, 4 => 40, 3 => 30, 2 => 20, 1 => 10, ); if (!$galaxy) { $galaxy = $planetrow['galaxy']; } if (!$system) { $system = $planetrow['system']; } if (!$planet) { $planet = $planetrow['planet']; } if (!$planettype) { $planettype = $planetrow['planet_type']; } $ile = '' . ++$user[$resource[108]] . ''; $page = '
'; /* Here must show the fleet movings of owner player. */ $fq = doquery("SELECT * FROM {{table}} WHERE fleet_owner={$user[id]}", 'fleets'); $i = 0; while ($f = $fq->fetch(PDO::FETCH_BOTH)) { $i++; $page .= ""; // $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= " "; $page .= ""; } else $page .= " "; $page .= ""; } if ($i == 0) { $page .= ""; } if ($ile == $maxfleet_count) { $maxflot = ''; } $page .= ' ' . $maxflot . '
Flotte (max. ' . $ile . ')
ID Mission Nombre Depart Arrivée (cible) Objectif Arrivée (retour) Retour � Ordre
$i"; $page .= "{$missiontype[$f[fleet_mission]]}"; if (($f['fleet_start_time'] + 1) == $f['fleet_end_time']) $page .= " (F)"; $page .= " $b) { if ($b != '') { $e++; $a = explode(",", $b); $page .= "{$lang['tech']{$a[0]}}: {$a[1]}\n"; if ($e > 1) { $page .= "\t"; } } } $page .= "\">" . pretty_number($f[fleet_amount]) . "".gmdate("d. M Y H:i:s",$f['fleet_start_time'])."[{$f[fleet_start_galaxy]}:{$f[fleet_start_system]}:{$f[fleet_start_planet]}]" . gmdate("d. M Y H:i:s", $f['fleet_start_time']) . "[{$f[fleet_end_galaxy]}:{$f[fleet_end_system]}:{$f[fleet_end_planet]}]" . gmdate("d. M Y H:i:s", $f['fleet_end_time']) . "
" . pretty_time(floor($f['fleet_end_time'] + 1 - time())) . "
"; if ($f['fleet_mess'] == 0) { $page .= "
---------
Nombre de slot de flotte maximum atteint!
Association de flotte KV50502025
VModifiez le nom de l\'Association

Invit�s participants Inviter des participants

'; // $page .= ' '; if (!$planetrow) { message('WTF! FEHLER!', 'ERROR'); } //uno nunca sabe xD $galaxy = intval($_GET['galaxy']); $system = intval($_GET['system']); $planet = intval($_GET['planet']); $planettype = intval($_GET['planettype']); $target_mission = intval($_GET['target_mission']); foreach($reslist['fleet'] as $n => $i) { if ($planetrow[$resource[$i]] > 0) { if ($i == 202 or $i == 203 or $i == 204 or $i == 209 or $i == 210) { $pricelist[$i]['speed'] = $pricelist[$i]['speed'] + (($pricelist[$i]['speed'] * $user['combustion_tech']) * 0.1); } if ($i == 205 or $i == 206 or $i == 208 or $i == 211) { $pricelist[$i]['speed'] = $pricelist[$i]['speed'] + (($pricelist[$i]['speed'] * $user['impulse_motor_tech']) * 0.2); } if ($i == 207 or $i == 213 or $i == 214 or $i == 215 or $i == 216) { $pricelist[$i]['speed'] = $pricelist[$i]['speed'] + (($pricelist[$i]['speed'] * $user['hyperspace_motor_tech']) * 0.3); } $page .= ''; if ($i == 212) { $page .= ''; } else { $page .= ''; $aaaaaaa = $pricelist[$i]['consumption']; } $have_ships = true; } } if (!$have_ships) { $page .= '
Nouveau march�: Choix de la flotte
Nom du vaisseau Nombre- -
' . $lang['tech'][$i] . ' ' . pretty_number($planetrow[$resource[$i]]) . '
max
Aucun vaisseau
'; } else { $page .= ' Aucun Vaisseaux Tout les vaisseaux '; $przydalej = ''; if ($ile == $maxfleet_count) { $przydalej = ''; } $page .= ' ' . $przydalej . '

'; } } else { } display($page, "Flotten"); ?>