* 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 Wootook. * */ define('INSIDE' , true); define('INSTALL' , false); require_once dirname(__FILE__) .'/application/bootstrap.php'; includeLang('fleet'); $speed = array( 10 => 100, 9 => 90, 8 => 80, 7 => 70, 6 => 60, 5 => 50, 4 => 40, 3 => 30, 2 => 20, 1 => 10, ); $user = Wootook_Empire_Model_User::getSingleton(); $planetrow = $user->getCurrentPlanet(); $g = isset($_POST['galaxy']) ? intval($_POST['galaxy']) : 0; $s = isset($_POST['system']) ? intval($_POST['system']) : 0; $p = isset($_POST['planet']) ? intval($_POST['planet']) : 0; $t = isset($_POST['planet_type']) ? intval($_POST['planet_type']) : 0; if ($g <= 0 || $g > MAX_GALAXY_IN_WORLD) { $g = $planetrow['galaxy']; } if ($s <= 0 || $s > MAX_SYSTEM_IN_GALAXY) { $s = $planetrow['system']; } if ($p <= 0 || $p > MAX_PLANET_IN_SYSTEM) { $p = $planetrow['planet']; } $allowedPlanetTypes = array( Wootook_Empire_Model_Planet::TYPE_PLANET, Wootook_Empire_Model_Planet::TYPE_DEBRIS, Wootook_Empire_Model_Planet::TYPE_MOON ); if (!in_array($t, $allowedPlanetTypes)) { $t = $planet['planet_type']; } $session = Wootook::getSession('fleet'); $session->clearData(); $FleetHiddenBlock = ""; $fleetArray = array(); $speedArray = array(); $consumptionArray = array(); $capacityArray = array(); if (isset($_POST['ship']) && is_array($_POST['ship'])) { $selectedShips = $_POST['ship']; } foreach ($reslist[Legacies_Empire::TYPE_SHIP] as $shipId) { if (!isset($selectedShips[$shipId])) { continue; } $qty = intval($selectedShips[$shipId]); if ($qty <= 0) { continue; } if ($qty > $planetrow->getElement($shipId)) { $page .= $lang['fl_noenought']; $speedalls[$shipId] = GetFleetMaxSpeed("", $shipId, $user); } else { $fleetArray[$shipId] = $qty; $session['qty'] += $qty; $speedArray[$shipId] = GetFleetMaxSpeed("", $shipId, $user); $consumptionArray[$shipId] = GetShipConsumption($shipId, $user); $capacityArray[$shipId] = $pricelist[$shipId]['capacity']; // Tableau des vitesses $FleetHiddenBlock .= ""; $FleetHiddenBlock .= ""; $FleetHiddenBlock .= ""; $FleetHiddenBlock .= ""; $speedalls[$shipId] = GetFleetMaxSpeed("", $shipId, $user); } } unset($selectedShips); $session['fleet'] = $fleetArray; $session['speed'] = $speedArray; $session['consumption'] = $consumptionArray; $session['capacity'] = $capacityArray; if (empty($fleetArray)) { message($lang['fl_unselectall'], $lang['fl_error'], "fleet." . PHPEXT, 1); } else { $speedallsmin = min($speedalls); } $speedFactor = GetGameSpeedFactor(); $session['speedallsmin'] = $speedallsmin; $scriptPath = Wootook::getUrl('scripts/flotten.js'); $page .= ""; $page .= "\n"; $page .= "
"; $page .= $FleetHiddenBlock; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= "
"; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; /* A faire assez rapidement (faut juste savoir comment) $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; */ $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; // Gestion des raccourcis sur la galaxie $page .= ""; $page .= ""; $page .= ""; if ($user['fleet_shortcut']) { $scarray = explode("\r\n", $user['fleet_shortcut']); $i = 0; foreach ($scarray as $a => $b) { if ($b != "") { $c = explode(',', $b); if ($i == 0) { $page .= ""; } $page .= ""; $page .= ""; } $page .= ""; $page .= ""; $page .= ""; // Gestion des raccourcis vers ses propres colonies ou planetes $kolonien = SortUserPlanets ( $user ); $currentplanet = doquery("SELECT * FROM {{table}} WHERE id = '" . $user['current_planet'] . "'", 'planets', true); if ($kolonien->rowCount() > 1) { $i = 0; $w = 0; $tr = true; while ($row = $kolonien->fetch(PDO::FETCH_BOTH)) { if ($w == 0 && $tr) { $page .= ""; $tr = false; } if ($w == 2) { $page .= ""; $w = 0; $tr = true; } if ($row['planet_type'] == 3) { $row['name'] .= " ". $lang['fl_shrtcup3']; } if ($currentplanet['galaxy'] == $row['galaxy'] && $currentplanet['system'] == $row['system'] && $currentplanet['planet'] == $row['planet'] && $currentplanet['planet_type'] == $row['planet_type'] ) { // $page .= ''; } else { $page .= ""; $w++; $i++; } } if ($i % 2 != 0) { $page .= ""; } elseif ($w == 2) { $page .= ""; } } else { $page .= ""; } $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= "
". $lang['fl_floten1_ttl'] ."
". $lang['fl_dest'] .""; $page .= ""; $page .= ""; $page .= ""; $page .= ""; $page .= "
". $lang['fl_speed'] .""; $page .= " %"; $page .= "
". $lang['fl_dist'] ."
-
". $lang['fl_fltime'] ."
-
". $lang['fl_time_go'] ."
". gmdate("H:i:s") ."
". $lang['fl_time_back'] ."
". gmdate("H:i:s") ."
". $lang['fl_deute_need'] ."
-
". $lang['fl_speed_max'] ."
-
". $lang['fl_max_load'] ."
-
". $lang['fl_shortcut'] ." ". $lang['fl_shortlnk'] ."
"; $page .= "". $lang['fl_noshortc'] ."
". $lang['fl_myplanets'] ."
'.$row['name'].' '.$row['galaxy'].':'.$row['system'].':'.$row['planet'].'". $row['name'] ." ". $row['galaxy'] .":". $row['system'] .":". $row['planet'] ." 
". $lang['fl_nocolonies'] ."
". $lang['fl_grattack'] ."
-
"; $page .= "
"; $maxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY); $ExpeditionEnCours = 0; $EnvoiMaxExpedition = 0; if ($maxExpedition >= 1) { $maxexpde = doquery("SELECT 1 FROM {{table}} WHERE `fleet_owner` = '".$user['id']."' AND `fleet_mission` = '15';", 'fleets'); $ExpeditionEnCours = $maxexpde->rowCount(); $maxexpde->closeCursor(); $EnvoiMaxExpedition = 1 + floor($maxExpedition / 3); } $page .= ""; $page .= ""; $page .= ""; $page .= "
"; $page .= ""; display($page, $lang['fl_title']);