Bug fixes
Removed some dowuery calls in deprecated code. Updated labels Updated requirements & types for ore miner Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
422f2c1295
commit
b09c4e6c62
22 changed files with 936 additions and 604 deletions
|
|
@ -32,37 +32,31 @@ define('INSIDE' , true);
|
|||
define('INSTALL' , false);
|
||||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
|
||||
$mode = Wootook::getRequest()->getPost('mode');
|
||||
|
||||
includeLang('admin');
|
||||
if ($mode == 'addit') {
|
||||
$adapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write');
|
||||
$adapter->insert()
|
||||
->into($adapter->getTable('declared'))
|
||||
->set('declarator', $user->getId())
|
||||
->set('declarator_name', $user->getUsername())
|
||||
->set('declared_1', Wootook::getRequest()->getPost('dec1'))
|
||||
->set('declared_2', Wootook::getRequest()->getPost('dec2'))
|
||||
->set('declared_3', Wootook::getRequest()->getPost('dec2'))
|
||||
->set('reason', Wootook::getRequest()->getPost('reason'))
|
||||
->execute()
|
||||
;
|
||||
|
||||
$mode = $_POST['mode'];
|
||||
$adapter->update()
|
||||
->into($adapter->getTable('users'))
|
||||
->set('multi_validated', 1)
|
||||
;
|
||||
|
||||
$PageTpl = gettemplate("add_declare");
|
||||
$parse = $lang;
|
||||
message("Merci, votre demande a ete prise en compte. Les autres joueurs que vous avez implique doivent egalement et imperativement suivre cette procedure aussi.", "Ajout");
|
||||
}
|
||||
|
||||
if ($mode == 'addit') {
|
||||
$declarator = $user['id'];
|
||||
$declarator_name = addslashes(htmlspecialchars($user['username']));
|
||||
$decl1 = addslashes(htmlspecialchars($_POST['dec1']));
|
||||
$decl2 = addslashes(htmlspecialchars($_POST['dec2']));
|
||||
$decl3 = addslashes(htmlspecialchars($_POST['dec3']));
|
||||
$reason1 = addslashes(htmlspecialchars($_POST['reason']));
|
||||
includeLang('admin');
|
||||
$Page = parsetemplate(gettemplate("add_declare"), $lang);
|
||||
|
||||
$QryDeclare = "INSERT INTO {{table}} SET ";
|
||||
$QryDeclare .= "`declarator` = '". $declarator ."', ";
|
||||
$QryDeclare .= "`declarator_name` = '". $declarator_name ."', "; $QryDeclare .= "`declared_1` = '". $decl1 ."', ";
|
||||
$QryDeclare .= "`declared_2` = '". $decl2 ."', ";
|
||||
$QryDeclare .= "`declared_3` = '". $decl3 ."', ";
|
||||
$QryDeclare .= "`reason` = '". $reason1 ."' ";
|
||||
display($Page, "Declaration d\'IP partagee", false, '', true);
|
||||
|
||||
doquery( $QryDeclare, "declared");
|
||||
doquery("UPDATE {{table}} SET multi_validated ='1' WHERE username='{$user['username']}'","users");
|
||||
|
||||
AdminMessage ( "Merci, votre demande a ete prise en compte. Les autres joueurs que vous avez implique doivent egalement et imperativement suivre cette procedure aussi.", "Ajout" );
|
||||
}
|
||||
$Page = parsetemplate($PageTpl, $parse);
|
||||
|
||||
display ($Page, "Declaration d\'IP partagee", false, '', true);
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -31,35 +31,26 @@
|
|||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
$users = doquery("SELECT * FROM {{table}} WHERE id='".$user['id']."';", 'users');
|
||||
$annonce = doquery("SELECT * FROM {{table}} ", 'annonce');
|
||||
$action = $_GET['action'];
|
||||
|
||||
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read');
|
||||
$writeAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write');
|
||||
|
||||
$action = isset($_GET['action']) ? $_GET['action'] : null;
|
||||
|
||||
if ($action == 5) {
|
||||
$metalvendre = $_POST['metalvendre'];
|
||||
$cristalvendre = $_POST['cristalvendre'];
|
||||
$deutvendre = $_POST['deutvendre'];
|
||||
|
||||
$metalsouhait = $_POST['metalsouhait'];
|
||||
$cristalsouhait = $_POST['cristalsouhait'];
|
||||
$deutsouhait = $_POST['deutsouhait'];
|
||||
|
||||
while ($v_annonce = $users->fetch(PDO::FETCH_BOTH)) {
|
||||
$user = $v_annonce['username'];
|
||||
$galaxie = $v_annonce['galaxy'];
|
||||
$systeme = $v_annonce['system'];
|
||||
}
|
||||
|
||||
doquery("INSERT INTO {{table}} SET
|
||||
user='{$user}',
|
||||
galaxie='{$galaxie}',
|
||||
systeme='{$systeme}',
|
||||
metala='{$metalvendre}',
|
||||
cristala='{$cristalvendre}',
|
||||
deuta='{$deutvendre}',
|
||||
metals='{$metalsouhait}',
|
||||
cristals='{$cristalsouhait}',
|
||||
deuts='{$deutsouhait}'" , "annonce");
|
||||
$writeAdapter->insert()
|
||||
->into($writeAdapter->getTable('annonce'))
|
||||
->set('user', $user->getUsername())
|
||||
->set('galaxie', $planet->getGalaxy())
|
||||
->set('systeme', $planet->getSystem())
|
||||
->set('metala', Wootook::getRequest()->getParam('metalvendre'))
|
||||
->set('cristala', Wootook::getRequest()->getParam('cristalvendre'))
|
||||
->set('deuta', Wootook::getRequest()->getParam('deutvendre'))
|
||||
->set('metals', Wootook::getRequest()->getParam('metalsouhait'))
|
||||
->set('cristals', Wootook::getRequest()->getParam('cristalsouhait'))
|
||||
->set('deuts', Wootook::getRequest()->getParam('deutsouhait'))
|
||||
->execute()
|
||||
;
|
||||
|
||||
$page2 .= <<<HTML
|
||||
<center>
|
||||
|
|
@ -73,7 +64,7 @@ HTML;
|
|||
}
|
||||
|
||||
if ($action != 5) {
|
||||
$annonce = doquery("SELECT * FROM {{table}} ORDER BY `id` DESC ", "annonce");
|
||||
$statement = $readAdapter->select()->from(array('annonce' => $readAdapter->getTable('annonce')))->order('id', 'DESC')->prepare();
|
||||
|
||||
$page2 = "<HTML>
|
||||
<center>
|
||||
|
|
@ -82,12 +73,9 @@ if ($action != 5) {
|
|||
<td class=\"c\" colspan=\"10\"><font color=\"#FFFFFF\">Petites Annonces</font></td></tr>
|
||||
<tr><th colspan=\"3\">Infos de livraison</th><th colspan=\"3\">Ressources à vendre</th><th colspan=\"3\">Ressources souhaitées</th><th>Action</th></tr>
|
||||
<tr><th>Vendeur</th><th>Galaxie</th><th>Système</th><th>Métal</th><th>Cristal</th><th>Deuterium</th><th>Métal</th><th>Cristal</th><th>Deuterium</th><th>Delet</th></tr>
|
||||
|
||||
|
||||
|
||||
|
||||
";
|
||||
while ($b = $annonce->fetch(PDO::FETCH_BOTH)) {
|
||||
|
||||
foreach ($statement as $b) {
|
||||
$page2 .= '<tr><th> ';
|
||||
$page2 .= $b["user"] ;
|
||||
$page2 .= '</th><th>';
|
||||
|
|
@ -119,4 +107,3 @@ if ($action != 5) {
|
|||
display($page2);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -99,6 +99,7 @@ class Legacies_Empire
|
|||
const ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK = 123;
|
||||
const ID_RESEARCH_EXPEDITION_TECHNOLOGY = 124;
|
||||
const ID_RESEARCH_ASTROPHYSICS = 124;
|
||||
const ID_RESEARCH_ORE_MINING = 125;
|
||||
const ID_RESEARCH_GRAVITON_TECHNOLOGY = 199;
|
||||
|
||||
const ID_SHIP_LIGHT_TRANSPORT = 202;
|
||||
|
|
@ -116,6 +117,7 @@ class Legacies_Empire
|
|||
const ID_SHIP_DEATH_STAR = 214;
|
||||
const ID_SHIP_BATTLECRUISER = 215;
|
||||
const ID_SHIP_SUPERNOVA = 216;
|
||||
const ID_SHIP_ORE_MININER = 217;
|
||||
|
||||
const ID_DEFENSE_ROCKET_LAUNCHER = 401;
|
||||
const ID_DEFENSE_LIGHT_LASER = 402;
|
||||
|
|
@ -144,6 +146,7 @@ class Legacies_Empire
|
|||
const ID_MISSION_DESTROY = 9;
|
||||
const ID_MISSION_MISSILES = 10;
|
||||
const ID_MISSION_EXPEDITION = 15;
|
||||
const ID_MISSION_ORE_MINING = 16;
|
||||
|
||||
public static function getFieldName($id)
|
||||
{
|
||||
|
|
@ -155,4 +158,4 @@ class Legacies_Empire
|
|||
|
||||
return $fieldsAlias[$id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ class Legacies_Empire_Block_Planet_Shipyard_Item
|
|||
return $this->getPlanet()->getElement($this->getItemId());
|
||||
}
|
||||
|
||||
public function getClass()
|
||||
{
|
||||
return $this->getLabel('class');
|
||||
}
|
||||
|
||||
public function getResourcesNeeded($qty)
|
||||
{
|
||||
return $this->getPlanet()->getShipyard()->getResourcesNeeded($this->getItemId(), $qty);
|
||||
|
|
@ -77,4 +82,4 @@ class Legacies_Empire_Block_Planet_Shipyard_Item
|
|||
}
|
||||
return $resourceConfig;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ class Wootook
|
|||
}
|
||||
|
||||
$userLocale = Wootook_Player_Model_Session::getSingleton()->getData('locale');
|
||||
if ($userLocale !== null) {
|
||||
if ($userLocale !== null && in_array($userLocale, $availableLocales)) {
|
||||
return $userLocale;
|
||||
}
|
||||
|
||||
|
|
@ -270,8 +270,8 @@ class Wootook
|
|||
return self::getDefaultLocale();
|
||||
}
|
||||
|
||||
$preferredLocale = key($locales);
|
||||
$preferredPriority = current($locales);
|
||||
$preferredLocale = current($availableLocales);
|
||||
$preferredPriority = 0;
|
||||
foreach ($locales as $locale => $piority) {
|
||||
if (!in_array($locale, $availableLocales)) {
|
||||
continue;
|
||||
|
|
@ -281,6 +281,7 @@ class Wootook
|
|||
$preferredLocale = $locale;
|
||||
}
|
||||
}
|
||||
var_dump($preferredLocale);
|
||||
|
||||
Wootook_Player_Model_Session::getSingleton()->setData('locale', $preferredLocale);
|
||||
|
||||
|
|
|
|||
|
|
@ -292,4 +292,4 @@ class Wootook_Core_DateTime
|
|||
return $this->_mktime($parts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,13 @@ abstract class Wootook_Empire_Block_Planet_Builder_ItemAbstract
|
|||
protected $_planet = null;
|
||||
protected $_itemId = null;
|
||||
|
||||
protected $_labels = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_labels = Wootook_Empire_Helper_Config_Labels::getSingleton();
|
||||
}
|
||||
|
||||
public function setPlayer(Wootook_Player_Model_Entity $player)
|
||||
{
|
||||
$this->_player = $player;
|
||||
|
|
@ -56,38 +63,24 @@ abstract class Wootook_Empire_Block_Planet_Builder_ItemAbstract
|
|||
return $this->getStaticUrl('infos.php', array('gid' => $this->getItemId()));
|
||||
}
|
||||
|
||||
public function getLabel($type)
|
||||
{
|
||||
return $this->_labels[$this->getItemId()][$type];
|
||||
}
|
||||
|
||||
public function getItemImageUrl()
|
||||
{
|
||||
// TODO : Upgrade theme
|
||||
return $this->getSkinUrl('graphics/gebaeude/' . $this->getItemId() . '.gif');
|
||||
return $this->getSkinUrl($this->getLabel('image'));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
static $lang = null;
|
||||
if ($lang === null) {
|
||||
// FIXME: implement a cleaner way to get names
|
||||
$lang = includeLang('tech');
|
||||
}
|
||||
|
||||
if (isset($lang['tech']) && isset($lang['tech'][$this->getItemId()])) {
|
||||
return $this->__($lang['tech'][$this->getItemId()]);
|
||||
}
|
||||
return '';
|
||||
return $this->getLabel('name');
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
static $lang = null;
|
||||
if ($lang === null) {
|
||||
// FIXME: implement a cleaner way to get names
|
||||
$lang = includeLang('tech');
|
||||
}
|
||||
|
||||
if (isset($lang['res']) && isset($lang['res']['descriptions']) && isset($lang['res']['descriptions'][$this->getItemId()])) {
|
||||
return $this->__($lang['res']['descriptions'][$this->getItemId()]);
|
||||
}
|
||||
return '';
|
||||
return $this->getLabel('description');
|
||||
}
|
||||
|
||||
public function getResourceName($resourceId)
|
||||
|
|
@ -115,4 +108,4 @@ abstract class Wootook_Empire_Block_Planet_Builder_ItemAbstract
|
|||
abstract public function getResourcesNeeded($level);
|
||||
|
||||
abstract public function getBuildingTime($level);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*
|
||||
* @uses Wootook_Object
|
||||
* @uses Legacies_Empire
|
||||
*/
|
||||
class Wootook_Empire_Helper_Config_Labels
|
||||
extends Wootook_Core_Helper_Config_ConfigHandler
|
||||
implements Wootook_Core_Singleton
|
||||
{
|
||||
private static $_singleton = null;
|
||||
|
||||
public static function getSingleton()
|
||||
{
|
||||
if (self::$_singleton === null) {
|
||||
self::$_singleton = new self();
|
||||
}
|
||||
return self::$_singleton;
|
||||
}
|
||||
|
||||
protected function _init()
|
||||
{
|
||||
$locale = Wootook::getPreferredLocale(array(
|
||||
'fr_FR', 'en_US'
|
||||
));
|
||||
|
||||
$this->_initData("locale/{$locale}/labels");
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function _load()
|
||||
{
|
||||
// NOP
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function _save()
|
||||
{
|
||||
// NOP
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function _delete()
|
||||
{
|
||||
// NOP
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +101,9 @@ class Wootook_Empire_Model_Planet
|
|||
$coords['type'] = $type;
|
||||
}
|
||||
|
||||
$collection = new Wootook_Empire_Resource_Planet_Collection('core_read');
|
||||
$adapter = Wootook_Core_Database_ConnectionManager::getSingleton()
|
||||
->getConnection('core_read');
|
||||
$collection = new Wootook_Empire_Resource_Planet_Collection($adapter);
|
||||
$collection->addCoordsToFilter($coords['galaxy'], $coords['system'], $coords['position'], $coords['type'])
|
||||
->setPage(1, 1);
|
||||
|
||||
|
|
@ -196,7 +198,7 @@ class Wootook_Empire_Model_Planet
|
|||
return $this->getPlanet()->getGalaxyData();
|
||||
}
|
||||
|
||||
public function updateStorages($time = null)
|
||||
public function updateStorages()
|
||||
{
|
||||
Math::setPrecision(50);
|
||||
$resources = Wootook_Empire_Helper_Config_Resources::getSingleton();
|
||||
|
|
@ -388,15 +390,14 @@ class Wootook_Empire_Model_Planet
|
|||
$time = new Wootook_Core_DateTime();
|
||||
}
|
||||
|
||||
$timeDiff = clone $time;
|
||||
$timeDiff->diff($time);
|
||||
$timeDiff = $time->diff($this->getLastUpdate());
|
||||
|
||||
foreach ($resources->getAllDatas() as $resourceId => $resourceConfig) {
|
||||
if (!$resourceConfig['storage_field']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$production = Math::mul($this->getData($resourceConfig['production_field']), $timeDiff->getTimestamp() / 3600);
|
||||
$production = Math::mul($this->getData($resourceConfig['production_field']), $timeDiff / 3600);
|
||||
$resourceValue = Math::add($this->getData($resourceConfig['field']), $production);
|
||||
$this->setData($resourceConfig['field'], Math::min($resourceValue, $this->getData($resourceConfig['storage_field'])));
|
||||
}
|
||||
|
|
@ -413,7 +414,7 @@ class Wootook_Empire_Model_Planet
|
|||
if (!isset($production[$buildingId])) {
|
||||
return null;
|
||||
}
|
||||
$class = $production[$buildingId][Legacies_Empire::RESOURCE_CLASS];
|
||||
$class = $production[$buildingId];
|
||||
$reflection = new ReflectionClass($class);
|
||||
self::$_productionInstances[$buildingId] = $reflection->newInstance();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<div class="item-container">
|
||||
<div class="item title">
|
||||
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a></h2>
|
||||
<h3 class="class"><?php echo $this->__('Class %s', $this->escape($this->getClass()))?></h3>
|
||||
<h3 class="count"><?php echo $this->__('Current count: %s', $this->renderNumber($this->getQty()))?></h3>
|
||||
</div>
|
||||
<div class="item details">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,407 @@
|
|||
<?php return array(
|
||||
//
|
||||
// Planet buildings labels
|
||||
// {{{
|
||||
Legacies_Empire::ID_BUILDING_METAL_MINE => array(
|
||||
'name' => 'Mine de métal',
|
||||
'description' => "<p>La <strong>mine de métal</strong> exploite les profondeurs géologiques à la recherche de ressources riches en métaux, puis les raffine et crée ensuite les alliages les plus solides.</p><p>Principales matières premières pour la construction de structures planétaires et de vaisseaux, les métaux permettent d'asseoir votre domination sur l'univers.</p>",
|
||||
'image' => 'graphics/buildings/metal-mine.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array(
|
||||
'name' => 'Mine de cristal',
|
||||
'description' => "<p>La <strong>mine de cristal</strong> développe l'exploitation des minéraux entrant dans la comosition des systèmes électroniques.</p><p>Ces matériaux vous permettront d'augmenter la capacité de calculs de vos laboratoires ainsi que de ceux de vos systèmes de combat.</p>",
|
||||
'image' => 'graphics/buildings/cristal-mine.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array(
|
||||
'name' => "Synthétiseur de deutérium",
|
||||
'description' => "<p>Le <strong>synthétiseur de deutérium</strong> permet d'exploiter les sources d'hydrogène lourd. Disponible en faible quantité sur les planètes telluriques et plus répandu sur les planètes géantes gazeuses, le deutérium et tritium composent votre principale source d'hydrogène lourd.</p>",
|
||||
'image' => 'graphics/buildings/deuterium-syntherizer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_SOLAR_PLANT => array(
|
||||
'name' => 'Centrale électrique solaire',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/solar-plant.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_FUSION_REACTOR => array(
|
||||
'name' => 'Réacteur à fusion nucléaire',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/fusion-reactor.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY => array(
|
||||
'name' => 'Usine de robots',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/robotic-factory.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_NANITE_FACTORY => array(
|
||||
'name' => 'Usine de nanites',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/nanite-factory.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_SHIPYARD => array(
|
||||
'name' => 'Chantier spatial',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/shipyard.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_METAL_STORAGE => array(
|
||||
'name' => 'Hangar de métal',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/metal-storage.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_CRISTAL_STORAGE => array(
|
||||
'name' => 'Hangar de cristal',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/cristal-storage.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_DEUTERIUM_TANK => array(
|
||||
'name' => 'Réservoir de deutérium',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/deuterium-tank.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_RESEARCH_LAB => array(
|
||||
'name' => 'Laboratoire de recherche',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/research-lab.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_TERRAFORMER => array(
|
||||
'name' => 'Terraformeur',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/terraformer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_ALLIANCE_DEPOT => array(
|
||||
'name' => 'Dépôt de ravitaillement',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/alliance-depot.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_MISSILE_SILO => array(
|
||||
'name' => 'Silo de missiles',
|
||||
'description' => '',
|
||||
'image' => 'graphics/buildings/missile-silo.png'
|
||||
),
|
||||
// }}}
|
||||
|
||||
//
|
||||
// Moon buildings labels
|
||||
// {{{
|
||||
Legacies_Empire::ID_BUILDING_LUNAR_BASE => array(
|
||||
'name' => 'Base lunaire',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/lunar-base.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_SENSOR_PHALANX => array(
|
||||
'name' => 'Phalange de capteur',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/sensor-phalanx.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_JUMP_GATE => array(
|
||||
'name' => 'Porte de saut spatial',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/jump-gate.png'
|
||||
),
|
||||
// }}}
|
||||
|
||||
//
|
||||
// Technologies labels
|
||||
// {{{
|
||||
Legacies_Empire::ID_RESEARCH_ESPIONAGE_TECHNOLOGY => array(
|
||||
'name' => 'Techniques d\'espionnage',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/espionnage.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_COMPUTER_TECHNOLOGY => array(
|
||||
'name' => 'Recherche informatique',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/computer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_WEAPON_TECHNOLOGY => array(
|
||||
'name' => 'Technologies d\'armements',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/weaponry.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_SHIELDING_TECHNOLOGY => array(
|
||||
'name' => 'Boucliers énergétiques',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/shielding.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_ARMOUR_TECHNOLOGY => array(
|
||||
'name' => 'Structures spatiales',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/armour.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY => array(
|
||||
'name' => 'Nouvelles énergies',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/energy.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY => array(
|
||||
'name' => 'Technologie hyperespace',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/hyperspace-technology.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE => array(
|
||||
'name' => 'Propulsion à combustion',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/combustion-drive.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE => array(
|
||||
'name' => 'Propulsion à impulsion',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/impulse-drive.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE => array(
|
||||
'name' => 'Propulsion hyperespace',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/hyperspace-drive.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_LASER_TECHNOLOGY => array(
|
||||
'name' => 'Propriétés laser',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/laser.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_ION_TECHNOLOGY => array(
|
||||
'name' => 'Propriétés des ions',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/ion.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_PLASMA_TECHNOLOGY => array(
|
||||
'name' => 'Propriétés des plasma',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/plasma.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK => array(
|
||||
'name' => 'Réseau de recherche intergalactique',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/intergalactic-research-network.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY => array(
|
||||
'name' => 'Technologie expéditions',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/expedition.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_ORE_MINING => array(
|
||||
'name' => 'Exploitation minière',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/ore-mining.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => array(
|
||||
'name' => 'Graviton',
|
||||
'description' => '',
|
||||
'image' => 'graphics/technology/graviton.png'
|
||||
),
|
||||
// }}}
|
||||
|
||||
//
|
||||
// Fleets labels
|
||||
// {{{
|
||||
Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT => array(
|
||||
'name' => 'Transporteur T5',
|
||||
'class' => 'Etalon',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/light-transport.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_LARGE_TRANSPORT => array(
|
||||
'name' => 'Transporteur T25',
|
||||
'class' => 'Buffle',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/large-transport.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_LIGHT_FIGHTER => array(
|
||||
'name' => 'Chasseur C50',
|
||||
'class' => 'Guêpe',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/light-fighter.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_HEAVY_FIGHTER => array(
|
||||
'name' => 'Chasseur C150',
|
||||
'class' => 'Frelon',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/heavy-fighter.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_CRUISER => array(
|
||||
'name' => 'Croiseur V400',
|
||||
'class' => 'Aigle',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/cruiser.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_BATTLESHIP => array(
|
||||
'name' => 'Vaisseau de bataille V1000',
|
||||
'class' => 'Faucon',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/battleship.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_COLONY_SHIP => array(
|
||||
'name' => 'Vaisseau de colonisation',
|
||||
'class' => 'Romulus',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/colony-ship.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_RECYCLER => array(
|
||||
'name' => 'Recycleur',
|
||||
'class' => 'Goule',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/recycler.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_SPY_DRONE => array(
|
||||
'name' => 'Sonde d\'espionnage',
|
||||
'class' => 'Moustique',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/spy-drone.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_BOMBER => array(
|
||||
'name' => 'Bombarider',
|
||||
'class' => 'Vengeur',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/terraformer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => array(
|
||||
'name' => 'Satellite solaire',
|
||||
'class' => 'Râ',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/terraformer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_DESTRUCTOR => array(
|
||||
'name' => 'Vaisseau de bataille V2000',
|
||||
'class' => 'Destructeur',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/terraformer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_DEATH_STAR => array(
|
||||
'name' => 'Vaisseau mère M1',
|
||||
'class' => 'Vengeur',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/terraformer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_BATTLECRUISER => array(
|
||||
'name' => 'Vaisseau de bataille V700',
|
||||
'class' => 'Dagon',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/terraformer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_SUPERNOVA => array(
|
||||
'name' => 'Vaisseau mère M5',
|
||||
'class' => 'Annihilateur',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/terraformer.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_ORE_MININER => array(
|
||||
'name' => 'Vaisseau d\'exploitation',
|
||||
'class' => 'Onyx',
|
||||
'description' => '',
|
||||
'image' => 'graphics/units/terraformer.png'
|
||||
),
|
||||
// }}}
|
||||
|
||||
//
|
||||
// Defenses labels
|
||||
// {{{
|
||||
Legacies_Empire::ID_DEFENSE_ROCKET_LAUNCHER => array(
|
||||
'name' => 'Lance-missiles balistiques',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/rocket-launcher.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_DEFENSE_LIGHT_LASER => array(
|
||||
'name' => 'Artillerie laser légère',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/light-laser.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_DEFENSE_HEAVY_LASER => array(
|
||||
'name' => 'Artillerie laser lourde',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/heavy-laser.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_DEFENSE_ION_CANNON => array(
|
||||
'name' => 'Canon à ions',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/ion-canon.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_DEFENSE_GAUSS_CANNON => array(
|
||||
'name' => 'Canon à effet Gauss',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/gauss-canon.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_DEFENSE_PLASMA_TURRET => array(
|
||||
'name' => 'Canon à plasma',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/plasma-turret.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_DEFENSE_SMALL_SHIELD_DOME => array(
|
||||
'name' => 'Dôme bouclier',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/small-shield-dome.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_DEFENSE_LARGE_SHIELD_DOME => array(
|
||||
'name' => 'Grand bouclier planétaire',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/large-shield-dome.png'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SPECIAL_ANTIBALLISTIC_MISSILE => array(
|
||||
'name' => 'Missile anti-balistique',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/antiballistic-missile.png'
|
||||
),
|
||||
// }}}
|
||||
|
||||
//
|
||||
// Special labels
|
||||
// {{{
|
||||
Legacies_Empire::ID_SPECIAL_INTERPLANETARY_MISSILE => array(
|
||||
'name' => 'Missile stratégique',
|
||||
'description' => '',
|
||||
'image' => 'graphics/defenses/interplanetary-missile.png'
|
||||
)
|
||||
// }}}
|
||||
);
|
||||
|
|
@ -2,70 +2,17 @@
|
|||
//
|
||||
// Buildings production
|
||||
// {{{
|
||||
Legacies_Empire::ID_BUILDING_METAL_MINE => array(
|
||||
Legacies_Empire::RESOURCE_METAL => 40,
|
||||
Legacies_Empire::RESOURCE_CRISTAL => 10,
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
|
||||
Legacies_Empire::RESOURCE_ENERGY => 0,
|
||||
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
|
||||
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_MetalMine'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array(
|
||||
Legacies_Empire::RESOURCE_METAL => 30,
|
||||
Legacies_Empire::RESOURCE_CRISTAL => 15,
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
|
||||
Legacies_Empire::RESOURCE_ENERGY => 0,
|
||||
Legacies_Empire::RESOURCE_MULTIPLIER => 1.6,
|
||||
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_CristalMine'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array(
|
||||
Legacies_Empire::RESOURCE_METAL => 150,
|
||||
Legacies_Empire::RESOURCE_CRISTAL => 50,
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
|
||||
Legacies_Empire::RESOURCE_ENERGY => 0,
|
||||
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
|
||||
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_DeuteriumSynthetiser'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_SOLAR_PLANT => array(
|
||||
Legacies_Empire::RESOURCE_METAL => 50,
|
||||
Legacies_Empire::RESOURCE_CRISTAL => 20,
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
|
||||
Legacies_Empire::RESOURCE_ENERGY => 0,
|
||||
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
|
||||
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_SolarPlant'
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_BUILDING_FUSION_REACTOR => array(
|
||||
Legacies_Empire::RESOURCE_METAL => 500,
|
||||
Legacies_Empire::RESOURCE_CRISTAL => 200,
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => 100,
|
||||
Legacies_Empire::RESOURCE_ENERGY => 0,
|
||||
Legacies_Empire::RESOURCE_MULTIPLIER => 1.8,
|
||||
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_FusionReactor'
|
||||
),
|
||||
Legacies_Empire::ID_BUILDING_METAL_MINE => 'Legacies_Empire_Model_Planet_Building_MetalMine',
|
||||
Legacies_Empire::ID_BUILDING_CRISTAL_MINE => 'Legacies_Empire_Model_Planet_Building_CristalMine',
|
||||
Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => 'Legacies_Empire_Model_Planet_Building_DeuteriumSynthetiser',
|
||||
Legacies_Empire::ID_BUILDING_SOLAR_PLANT => 'Legacies_Empire_Model_Planet_Building_SolarPlant',
|
||||
Legacies_Empire::ID_BUILDING_FUSION_REACTOR => 'Legacies_Empire_Model_Planet_Building_FusionReactor',
|
||||
// }}}
|
||||
|
||||
//
|
||||
// Ships production
|
||||
// {{{
|
||||
Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => array(
|
||||
Legacies_Empire::RESOURCE_METAL => 0,
|
||||
Legacies_Empire::RESOURCE_CRISTAL => 2000,
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => 500,
|
||||
Legacies_Empire::RESOURCE_ENERGY => 0,
|
||||
Legacies_Empire::RESOURCE_MULTIPLIER => 0.5,
|
||||
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Ship_SolarSatellite'
|
||||
),
|
||||
Legacies_Empire::ID_SHIP_SUPERNOVA => array(
|
||||
Legacies_Empire::RESOURCE_METAL => 0,
|
||||
Legacies_Empire::RESOURCE_CRISTAL => 2000,
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => 500,
|
||||
Legacies_Empire::RESOURCE_ENERGY => 0,
|
||||
Legacies_Empire::RESOURCE_MULTIPLIER => 0.5,
|
||||
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Ship_Supernova'
|
||||
)
|
||||
Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => 'Legacies_Empire_Model_Planet_Ship_SolarSatellite',
|
||||
Legacies_Empire::ID_SHIP_SUPERNOVA => 'Legacies_Empire_Model_Planet_Ship_Supernova'
|
||||
// }}}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -114,6 +114,10 @@
|
|||
Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE => 3
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_ORE_MINING => array(
|
||||
Legacies_Empire::ID_BUILDING_RESEARCH_LAB => 2
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => array(
|
||||
Legacies_Empire::ID_BUILDING_RESEARCH_LAB => 12
|
||||
),
|
||||
|
|
@ -207,6 +211,13 @@
|
|||
Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY => 14,
|
||||
Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => 3
|
||||
),
|
||||
|
||||
Legacies_Empire::ID_SHIP_ORE_MININER => array(
|
||||
Legacies_Empire::ID_BUILDING_SHIPYARD => 12,
|
||||
Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE => 8,
|
||||
Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => 1,
|
||||
Legacies_Empire::ID_RESEARCH_LASER_TECHNOLOGY => 16
|
||||
),
|
||||
// }}}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@
|
|||
Legacies_Empire::ID_RESEARCH_PLASMA_TECHNOLOGY,
|
||||
Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK,
|
||||
Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY,
|
||||
Legacies_Empire::ID_RESEARCH_ORE_MINING,
|
||||
Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY
|
||||
),
|
||||
// }}}
|
||||
|
|
@ -97,7 +98,8 @@
|
|||
Legacies_Empire::ID_SHIP_DESTRUCTOR,
|
||||
Legacies_Empire::ID_SHIP_DEATH_STAR,
|
||||
Legacies_Empire::ID_SHIP_BATTLECRUISER,
|
||||
Legacies_Empire::ID_SHIP_SUPERNOVA
|
||||
Legacies_Empire::ID_SHIP_SUPERNOVA,
|
||||
Legacies_Empire::ID_SHIP_ORE_MININER
|
||||
),
|
||||
// }}}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,60 +14,64 @@ Last revision: 13/07/11
|
|||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
includeLang('fleet');
|
||||
includeLang('fleet');
|
||||
|
||||
$BoxTitle = $lang['fl_error'];
|
||||
$TxtColor = "red";
|
||||
$BoxMessage = $lang['fl_notback'];
|
||||
if ( is_numeric($_POST['fleetid']) ) {
|
||||
$fleetid = intval($_POST['fleetid']);
|
||||
$BoxTitle = $lang['fl_error'];
|
||||
$TxtColor = "red";
|
||||
$BoxMessage = $lang['fl_notback'];
|
||||
if (isset($_POST['fleetid']) && is_numeric($_POST['fleetid'])) {
|
||||
$fleetid = intval($_POST['fleetid']);
|
||||
|
||||
$FleetRow = doquery("SELECT * FROM {{table}} WHERE `fleet_id` = '". $fleetid ."';", 'fleets', true);
|
||||
$i = 0;
|
||||
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write');
|
||||
$FleetRow = $readAdapter->select()
|
||||
->from(array('fleet' => $readAdapter->getTable('fleets')))
|
||||
->where('fleet_id', $fleetid)
|
||||
->prepare()
|
||||
->fetch()
|
||||
;
|
||||
$i = 0;
|
||||
|
||||
if ($FleetRow['fleet_owner'] == $user['id']) {
|
||||
if ($FleetRow['fleet_mess'] == 0 || $FleetRow['fleet_mess'] == 2) {
|
||||
if ($FleetRow['fleet_end_stay'] != 0) {
|
||||
// Faut calculer le temps reel de retour
|
||||
if ($FleetRow['fleet_start_time'] > time()) {
|
||||
// On a pas encore entamé le stationnement
|
||||
// Il faut calculer la parcelle de temps ecoulée depuis le lancement de la flotte
|
||||
$CurrentFlyingTime = time() - $FleetRow['start_time'];
|
||||
} else {
|
||||
// On est deja en stationnement
|
||||
// Il faut donc directement calculer la durée d'un vol aller ou retour
|
||||
$CurrentFlyingTime = $FleetRow['fleet_start_time'] - $FleetRow['start_time'];
|
||||
}
|
||||
} else {
|
||||
// C'est quoi le stationnement ??
|
||||
// On calcule sagement la parcelle de temps ecoulée depuis le depart
|
||||
$CurrentFlyingTime = time() - $FleetRow['start_time'];
|
||||
}
|
||||
// Allez houste au bout du compte y a la maison !! (E.T. phone home.............)
|
||||
$ReturnFlyingTime = $CurrentFlyingTime + time();
|
||||
if ($FleetRow['fleet_owner'] == $user['id']) {
|
||||
if ($FleetRow['fleet_mess'] == 0 || $FleetRow['fleet_mess'] == 2) {
|
||||
if ($FleetRow['fleet_end_stay'] != 0) {
|
||||
// Faut calculer le temps reel de retour
|
||||
if ($FleetRow['fleet_start_time'] > time()) {
|
||||
// On a pas encore entamé le stationnement
|
||||
// Il faut calculer la parcelle de temps ecoulée depuis le lancement de la flotte
|
||||
$CurrentFlyingTime = time() - $FleetRow['start_time'];
|
||||
} else {
|
||||
// On est deja en stationnement
|
||||
// Il faut donc directement calculer la durée d'un vol aller ou retour
|
||||
$CurrentFlyingTime = $FleetRow['fleet_start_time'] - $FleetRow['start_time'];
|
||||
}
|
||||
} else {
|
||||
// C'est quoi le stationnement ??
|
||||
// On calcule sagement la parcelle de temps ecoulée depuis le depart
|
||||
$CurrentFlyingTime = time() - $FleetRow['start_time'];
|
||||
}
|
||||
$ReturnFlyingTime = $CurrentFlyingTime + time();
|
||||
|
||||
$QryUpdateFleet = "UPDATE {{table}} SET ";
|
||||
$QryUpdateFleet .= "`fleet_start_time` = '". (time() - 1) ."', ";
|
||||
$QryUpdateFleet .= "`fleet_end_stay` = '0', ";
|
||||
$QryUpdateFleet .= "`fleet_end_time` = '". ($ReturnFlyingTime + 1) ."', ";
|
||||
$QryUpdateFleet .= "`fleet_target_owner` = '". $user['id'] ."', ";
|
||||
$QryUpdateFleet .= "`fleet_mess` = '1' ";
|
||||
$QryUpdateFleet .= "WHERE ";
|
||||
$QryUpdateFleet .= "`fleet_id` = '" . $fleetid . "';";
|
||||
doquery( $QryUpdateFleet, 'fleets');
|
||||
$writeAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write');
|
||||
$writeAdapter->update()
|
||||
->into($writeAdapter->getTable('fleets'))
|
||||
->set('fleet_start_time', time())
|
||||
->set('fleet_end_stay', 0)
|
||||
->set('fleet_end_time', $ReturnFlyingTime)
|
||||
->set('fleet_target_owner', $user->getId())
|
||||
->set('fleet_mess', 1)
|
||||
->where('fleet_id', $fleetid)
|
||||
->execute()
|
||||
;
|
||||
|
||||
$BoxTitle = $lang['fl_sback'];
|
||||
$TxtColor = "lime";
|
||||
$BoxMessage = $lang['fl_isback'];
|
||||
} elseif ($FleetRow['fleet_mess'] == 1) {
|
||||
$BoxMessage = $lang['fl_notback'];
|
||||
}
|
||||
} else {
|
||||
$BoxMessage = $lang['fl_onlyyours'];
|
||||
}
|
||||
}
|
||||
$BoxTitle = $lang['fl_sback'];
|
||||
$TxtColor = "lime";
|
||||
$BoxMessage = $lang['fl_isback'];
|
||||
} elseif ($FleetRow['fleet_mess'] == 1) {
|
||||
$BoxMessage = $lang['fl_notback'];
|
||||
}
|
||||
} else {
|
||||
$BoxMessage = $lang['fl_onlyyours'];
|
||||
}
|
||||
}
|
||||
|
||||
message ("<font color=\"".$TxtColor."\">". $BoxMessage ."</font>", $BoxTitle, "fleet.". PHPEXT, 2);
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
?>
|
||||
message ($BoxMessage, $BoxTitle, "fleet.". PHPEXT, 2);
|
||||
|
|
|
|||
|
|
@ -255,14 +255,15 @@ $page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_myplanets'] ."</td>";
|
|||
$page .= "</tr>";
|
||||
|
||||
// Gestion des raccourcis vers ses propres colonies ou planetes
|
||||
$kolonien = SortUserPlanets ( $user );
|
||||
$currentplanet = doquery("SELECT * FROM {{table}} WHERE id = '" . $user['current_planet'] . "'", 'planets', true);
|
||||
$kolonien = $user->getPlanetCollection();
|
||||
$currentplanet = $user->getCurrentPlanet();
|
||||
|
||||
if ($kolonien->rowCount() > 1) {
|
||||
$i = 0;
|
||||
$w = 0;
|
||||
$tr = true;
|
||||
while ($row = $kolonien->fetch(PDO::FETCH_BOTH)) {
|
||||
foreach ($user->getPlanetCollection() as $userPlanet) {
|
||||
/** @var Wootook_Empire_Model_Planet $userPlanet */
|
||||
if ($w == 0 && $tr) {
|
||||
$page .= "<tr height=\"20\">";
|
||||
$tr = false;
|
||||
|
|
@ -273,17 +274,13 @@ if ($kolonien->rowCount() > 1) {
|
|||
$tr = true;
|
||||
}
|
||||
|
||||
if ($row['planet_type'] == 3) {
|
||||
$row['name'] .= " ". $lang['fl_shrtcup3'];
|
||||
$name = $userPlanet->getName();
|
||||
if ($userPlanet->getType() == Wootook_Empire_Model_Planet::TYPE_MOON) {
|
||||
$name .= " " . $lang['fl_shrtcup3'];
|
||||
}
|
||||
|
||||
if ($currentplanet['galaxy'] == $row['galaxy'] &&
|
||||
$currentplanet['system'] == $row['system'] &&
|
||||
$currentplanet['planet'] == $row['planet'] &&
|
||||
$currentplanet['planet_type'] == $row['planet_type'] ) {
|
||||
// $page .= '<th><a href="javascript:setTarget('.$row['galaxy'].','.$row['system'].','.$row['planet'].','.$row['planet_type'].'); shortInfo();">'.$row['name'].' '.$row['galaxy'].':'.$row['system'].':'.$row['planet'].'</a></th>';
|
||||
} else {
|
||||
$page .= "<th><a href=\"javascript:setTarget(". $row['galaxy'] .",". $row['system'] .",". $row['planet'] .",". $row['planet_type'] ."); shortInfo();\">". $row['name'] ." ". $row['galaxy'] .":". $row['system'] .":". $row['planet'] ."</a></th>";
|
||||
if ($currentplanet->getId() != $userPlanet->getId()) {
|
||||
$page .= "<th><a href=\"javascript:setTarget(". $userPlanet->getGalaxy() .",". $userPlanet->getSystem() .",". $userPlanet->getPosition() .",". $userPlanet->getType() ."); shortInfo();\">". $name . " ". $userPlanet->getCoords() ."</a></th>";
|
||||
$w++;
|
||||
$i++;
|
||||
}
|
||||
|
|
@ -315,9 +312,14 @@ $maxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHN
|
|||
$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();
|
||||
$ExpeditionEnCours = $readAdapter->select()
|
||||
->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)'))
|
||||
->from(array('fleet' => $readAdapter->getTable('fleets')))
|
||||
->where('fleet_owner', $user->getId())
|
||||
->where('fleet_mission', Legacies_Empire::ID_MISSION_EXPEDITION)
|
||||
->prepare()
|
||||
->fetchColumn()
|
||||
;
|
||||
|
||||
$EnvoiMaxExpedition = 1 + floor($maxExpedition / 3);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,21 +182,30 @@ if ($planetrow->isPlanet()) {
|
|||
$TableTitle = "{$planetrow->getCoords()} - {$lang['fl_moon']}";
|
||||
}
|
||||
|
||||
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read');
|
||||
$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();
|
||||
$ExpeditionEnCours = $readAdapter->select()
|
||||
->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)'))
|
||||
->from(array('fleet' => $readAdapter->getTable('fleets')))
|
||||
->where('fleet_owner', $user->getId())
|
||||
->where('fleet_mission', Legacies_Empire::ID_MISSION_EXPEDITION)
|
||||
->prepare()
|
||||
->fetchColumn()
|
||||
;
|
||||
|
||||
$EnvoiMaxExpedition = 1 + floor($maxExpedition / 3);
|
||||
$EnvoiMaxExpedition = 1 + floor(sqrt($maxExpedition));
|
||||
}
|
||||
|
||||
$maxfleet = doquery("SELECT 1 FROM {{table}} WHERE `fleet_owner` = '".$user['id']."';", 'fleets');
|
||||
|
||||
$MaxFlyingFleets = $maxfleet->rowCount();
|
||||
$maxfleet->closeCursor();
|
||||
$MaxFlyingFleets = $readAdapter->select()
|
||||
->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)'))
|
||||
->from(array('fleet' => $readAdapter->getTable('fleets')))
|
||||
->where('fleet_owner', $user->getId())
|
||||
->prepare()
|
||||
->fetchColumn()
|
||||
;
|
||||
|
||||
$page = "<script type=\"text/javascript\" src=\"scripts/flotten.js\">\n</script>";
|
||||
$page .= "<script type=\"text/javascript\">\n";
|
||||
|
|
@ -277,13 +286,14 @@ if ($planet == (Wootook::getGameConfig('engine/universe/positions') + 1)) {
|
|||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th colspan=\"3\">";
|
||||
$page .= "<select name=\"expeditiontime\" >";
|
||||
$page .= "<option value=\"1\">1</option>";
|
||||
$page .= "<option value=\"2\">2</option>";
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$page .= "<option value=\"{$i}\">{$i}h</option>";
|
||||
}
|
||||
$page .= "</select>";
|
||||
$page .= $lang['fl_expe_hours'];
|
||||
$page .= "</th>";
|
||||
$page .= "</tr>";
|
||||
} else if (!isset($missionTypes[Legacies_Empire::ID_MISSION_STATION_ALLY])) {
|
||||
} else if (isset($missionTypes[Legacies_Empire::ID_MISSION_STATION_ALLY]) || isset($missionTypes[Legacies_Empire::ID_MISSION_ORE_MINING])) {
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td class=\"c\" colspan=\"3\">". $lang['fl_expe_staytime'] ."</td>";
|
||||
$page .= "</tr>";
|
||||
|
|
@ -291,12 +301,9 @@ if ($planet == (Wootook::getGameConfig('engine/universe/positions') + 1)) {
|
|||
$page .= "<th colspan=\"3\">";
|
||||
$page .= "<select name=\"holdingtime\" >";
|
||||
$page .= "<option value=\"0\">0</option>";
|
||||
$page .= "<option value=\"1\">1</option>";
|
||||
$page .= "<option value=\"2\">2</option>";
|
||||
$page .= "<option value=\"4\">4</option>";
|
||||
$page .= "<option value=\"8\">8</option>";
|
||||
$page .= "<option value=\"16\">16</option>";
|
||||
$page .= "<option value=\"32\">32</option>";
|
||||
for ($i = 1; $i <= 32; $i++) {
|
||||
$page .= "<option value=\"{$i}\">{$i}h</option>";
|
||||
}
|
||||
$page .= "</select>";
|
||||
$page .= $lang['fl_expe_hours'];
|
||||
$page .= "</th>";
|
||||
|
|
|
|||
422
src/floten3.php
422
src/floten3.php
|
|
@ -39,10 +39,6 @@ $session = Wootook::getSession('fleet');
|
|||
$user = Wootook_Player_Model_Session::getSingleton()->getPlayer();
|
||||
$planet = $user->getCurrentPlanet();
|
||||
|
||||
$galaxy = isset($_POST['galaxy']) ? intval($_POST['galaxy']) : 0;
|
||||
$system = isset($_POST['system']) ? intval($_POST['system']) : 0;
|
||||
$position = isset($_POST['planet']) ? intval($_POST['planet']) : 0;
|
||||
$type = isset($_POST['planettype']) ? intval($_POST['planettype']) : 0;
|
||||
$mission = isset($_POST['mission']) ? intval($_POST['mission']) : 0;
|
||||
$galaxy = isset($session['galaxy']) ? $session['galaxy'] : 0;
|
||||
$system = isset($session['system']) ? $session['system'] : 0;
|
||||
|
|
@ -51,23 +47,28 @@ $type = isset($session['type']) ? $session['type'] : 0;
|
|||
$speed = isset($session['speed']) ? $session['speed'] : 10;
|
||||
|
||||
$protection = Wootook::getGameConfig('game/noob-protection/active');
|
||||
$protectiontime = Wootook::getGameConfig('game/noob-protection/points-cap');
|
||||
$protectionmulti = Wootook::getGameConfig('game/noob-protection/multiplier');
|
||||
$protectionPointsCap = Wootook::getGameConfig('game/noob-protection/points-cap');
|
||||
$protectionMultiplier = Wootook::getGameConfig('game/noob-protection/multiplier');
|
||||
|
||||
if ($protectiontime < 1) {
|
||||
$protectiontime = 0x7FFFFFFF;
|
||||
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()
|
||||
->getConnection('core_read');
|
||||
$writeAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()
|
||||
->getConnection('core_write');
|
||||
|
||||
if ($protectionPointsCap < 1) {
|
||||
$protectionPointsCap = 0x7FFFFFFF;
|
||||
}
|
||||
|
||||
$fleetArray = $session['fleet'];
|
||||
|
||||
if (!is_array($fleetArray)) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet.php", 2);
|
||||
message($lang['fl_fleet_err'], $lang['fl_error'], "fleet.php", 2);
|
||||
}
|
||||
|
||||
// On verifie s'il y a assez de vaisseaux sur la planete !
|
||||
foreach ($fleetArray as $shipId => $count) {
|
||||
if ($Count > $planet->getElement($shipId)) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet.php", 2);
|
||||
if ($count > $planet->getElement($shipId)) {
|
||||
message($lang['fl_fleet_err'], $lang['fl_error'], "fleet.php", 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -77,14 +78,14 @@ $allowedPlanetTypes = array(
|
|||
Wootook_Empire_Model_Planet::TYPE_MOON
|
||||
);
|
||||
if (!in_array($type, $allowedPlanetTypes)) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_fleet_err_pl'] ."</b></font>", $lang['fl_error'], "fleet.php", 2);
|
||||
message($lang['fl_fleet_err_pl'], $lang['fl_error'], "fleet.php", 2);
|
||||
}
|
||||
|
||||
if ($planet->getGalaxy() == $galaxy &&
|
||||
$planet->getSystem() == $system &&
|
||||
$planet->getPosition() == $position &&
|
||||
$planet->getType() == $type) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_ownpl_err'] ."</b></font>", $lang['fl_error'], "fleet.php", 2);
|
||||
message($lang['fl_ownpl_err'], $lang['fl_error'], "fleet.php", 2);
|
||||
}
|
||||
|
||||
$YourPlanet = false;
|
||||
|
|
@ -104,26 +105,32 @@ if ($mission == Legacies_Empire::ID_MISSION_RECYCLE) {
|
|||
if ($mission != Legacies_Empire::ID_MISSION_EXPEDITION) {
|
||||
if (!$destination->getId()) {
|
||||
if ($mission != Legacies_Empire::ID_MISSION_SETTLE_COLONY) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_unknow_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message($lang['fl_unknow_target'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
} else if ($mission == Legacies_Empire::ID_MISSION_DESTROY) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_used_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message($lang['fl_used_target'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
} else if ($mission == Legacies_Empire::ID_MISSION_DESTROY && !$destination->isMoon()) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_used_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message($lang['fl_used_target'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
} else {
|
||||
$EnvoiMaxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY);
|
||||
$Expedition = 0;
|
||||
if ($EnvoiMaxExpedition > 0) {
|
||||
$maxexpde = doquery("SELECT 1 FROM {{table}} WHERE `fleet_owner` = '".$user['id']."' AND `fleet_mission` = '15';", 'fleets');
|
||||
$Expedition = $maxexpde->rowCount();
|
||||
$maxexpde->closeCursor();
|
||||
$statement = $readAdapter->select()
|
||||
->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)'))
|
||||
->from(array('fleet' => $readAdapter->getTable('fleets')))
|
||||
->where('fleet_owner', new Wootook_Core_Database_Sql_Placeholder_Param('player', $user->getId()))
|
||||
->where('fleet_mission', Legacies_Empire::ID_MISSION_EXPEDITION)
|
||||
->prepare()
|
||||
;
|
||||
|
||||
$Expedition = $statement->fetchColumn();
|
||||
}
|
||||
|
||||
if ($EnvoiMaxExpedition == 0 ) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_expe_notech'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_expe_notech'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
} else if ($Expedition >= $EnvoiMaxExpedition ) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_expe_max'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_expe_max'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +152,10 @@ if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) {
|
|||
}
|
||||
} else if ($type == Wootook_Empire_Model_Planet::TYPE_PLANET) {
|
||||
if (isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0 && !$UsedPlanet) {
|
||||
$missionTypes[Legacies_Empire::ID_MISSION_SETTLE_COLONY] = $lang['type_mission'][7];
|
||||
$missionTypes[Legacies_Empire::ID_MISSION_SETTLE_COLONY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_SETTLE_COLONY];
|
||||
}
|
||||
if (isset($fleetArray[Legacies_Empire::ID_SHIP_ORE_MININER]) && $fleetArray[Legacies_Empire::ID_SHIP_ORE_MININER] > 0 && !$UsedPlanet) {
|
||||
$missionTypes[Legacies_Empire::ID_MISSION_ORE_MINING] = $lang['type_mission'][Legacies_Empire::ID_MISSION_ORE_MINING];
|
||||
}
|
||||
} else if ($type == Wootook_Empire_Model_Planet::TYPE_MOON) {
|
||||
if (((isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) ||
|
||||
|
|
@ -153,6 +163,9 @@ if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) {
|
|||
!$YourPlanet && $UsedPlanet) {
|
||||
$missionTypes[Legacies_Empire::ID_MISSION_DESTROY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_DESTROY];
|
||||
}
|
||||
if (isset($fleetArray[Legacies_Empire::ID_SHIP_ORE_MININER]) && $fleetArray[Legacies_Empire::ID_SHIP_ORE_MININER] > 0 && !$YourPlanet) {
|
||||
$missionTypes[Legacies_Empire::ID_MISSION_ORE_MINING] = $lang['type_mission'][Legacies_Empire::ID_MISSION_ORE_MINING];
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($type, array(Wootook_Empire_Model_Planet::TYPE_MOON, Wootook_Empire_Model_Planet::TYPE_PLANET))) {
|
||||
|
|
@ -194,7 +207,7 @@ if (isset($fleetArray[Legacies_Empire::ID_SHIP_SOLAR_SATELLITE])) {
|
|||
}
|
||||
|
||||
if (!isset($missionTypes[$mission])) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_bad_mission'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message($lang['fl_bad_mission'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
|
||||
if (!$destination->getId()) {
|
||||
|
|
@ -203,16 +216,30 @@ if (!$destination->getId()) {
|
|||
$destinationUser = $destination->getUser();
|
||||
}
|
||||
|
||||
$userPoints = doquery("SELECT total_points FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner`='{$user->getId()}'", 'statpoints', true);
|
||||
$myGameLevel = $userPoints['total_points'];
|
||||
$myGameLevel = $readAdapter->select()
|
||||
->column('total_points')
|
||||
->from(array('statpoints' => $readAdapter->getTable('statpoints')))
|
||||
->where('stat_type', 1)
|
||||
->where('stat_code', 1)
|
||||
->where('id_owner', new Wootook_Core_Database_Sql_Placeholder_Param('player', $user->getId()))
|
||||
->prepare()
|
||||
->fetchColumn()
|
||||
;
|
||||
if ($destinationUser->getId()) {
|
||||
$destinationPoints = doquery("SELECT total_points FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '{$destinationUser->getId()}';", 'statpoints', true);
|
||||
$hisGameLevel = $destinationPoints['total_points'];
|
||||
$hisGameLevel = $readAdapter->select()
|
||||
->column('total_points')
|
||||
->from(array('statpoints' => $readAdapter->getTable('statpoints')))
|
||||
->where('stat_type', 1)
|
||||
->where('stat_code', 1)
|
||||
->where('id_owner', new Wootook_Core_Database_Sql_Placeholder_Param('player', $destinationUser->getId()))
|
||||
->prepare()
|
||||
->fetchColumn()
|
||||
;
|
||||
} else {
|
||||
$hisGameLevel = 0;
|
||||
}
|
||||
|
||||
$vacationMode = $destinationUser['urlaubs_modus'];
|
||||
$vacationMode = $destinationUser->isVacation();
|
||||
|
||||
if ($protection) {
|
||||
$protectedMissions = array(
|
||||
|
|
@ -222,23 +249,20 @@ if ($protection) {
|
|||
Legacies_Empire::ID_MISSION_SPY,
|
||||
Legacies_Empire::ID_MISSION_DESTROY
|
||||
);
|
||||
|
||||
if ($myGameLevel > ($hisGameLevel * $protectionmulti) && $destinationUser->getId() &&
|
||||
in_array($mission, $protectedMissions) && $hisGameLevel < ($protectiontime * 1000)) {
|
||||
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
|
||||
if (($myGameLevel * $protectionmulti) < $hisGameLevel && $destinationUser->getId() &&
|
||||
in_array($mission, $protectedMissions) && $myGameLevel < ($protectiontime * 1000)) {
|
||||
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||
if ($destinationUser->getId() && in_array($mission, $protectedMissions)) {
|
||||
if ($myGameLevel > ($hisGameLevel * $protectionMultiplier) && $hisGameLevel < ($protectionPointsCap * 1000)) {
|
||||
message($lang['fl_noob_mess_n'], $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||
} else if (($myGameLevel * $protectionMultiplier) < $hisGameLevel && $myGameLevel < ($protectionPointsCap * 1000)) {
|
||||
message($lang['fl_noob_mess_n'], $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($vacationMode && $mission != Legacies_Empire::ID_MISSION_RECYCLE) {
|
||||
message("<font color=\"lime\"><b>".$lang['fl_vacation_pla']."</b></font>", $lang['fl_vacation_ttl'], "fleet." . PHPEXT, 2);
|
||||
message($lang['fl_vacation_pla'], $lang['fl_vacation_ttl'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
|
||||
$currentFleets = $user->getFleets()->count();
|
||||
$currentFleets = $user->getFleets()->getSize();
|
||||
|
||||
if (($user->getElement(Legacies_Empire::ID_RESEARCH_COMPUTER_TECHNOLOGY) + 1) <= $currentFleets) {
|
||||
message("Pas de slot disponible", "Erreur", "fleet." . PHPEXT, 1);
|
||||
|
|
@ -261,25 +285,25 @@ if ($mission != Legacies_Empire::ID_MISSION_EXPEDITION) {
|
|||
Legacies_Empire::ID_MISSION_SPY
|
||||
);
|
||||
if (!$destination->getUserId() && in_array($mission, $userMissions)) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_bad_planet01'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_bad_planet01'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
if ($destination->getId() && $mission == Legacies_Empire::ID_MISSION_SETTLE_COLONY) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_bad_planet02'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_bad_planet02'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
if ($destination->getId() != $planet->getId() && $mission == Legacies_Empire::ID_MISSION_STATION) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_dont_stay_here'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_dont_stay_here'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
if ($destination->getElement(Legacies_Empire::ID_BUILDING_ALLIANCE_DEPOT) < 1 && $destinationUser->getId() != $user->getId() && $mission == Legacies_Empire::ID_MISSION_STATION_ALLY) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_no_allydeposit'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_no_allydeposit'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
if ($destinationUser->getId() == $user->getId() && ($mission == Legacies_Empire::ID_MISSION_ATTACK)) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_no_self_attack'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_no_self_attack'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
if ($destinationUser->getId() == $user->getId() && ($mission == Legacies_Empire::ID_MISSION_SPY)) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_no_self_spy'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_no_self_spy'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
if ($destinationUser->getId() != $user->getId() && $mission == Legacies_Empire::ID_MISSION_STATION) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_only_stay_at_home'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_only_stay_at_home'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -290,7 +314,7 @@ $SpeedFactor = GetGameSpeedFactor();
|
|||
$MaxFleetSpeed = min($AllFleetSpeed);
|
||||
|
||||
if (!in_array($speed, $possibleSpeeds)) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_cheat_speed'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message ($lang['fl_cheat_speed'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
|
|
@ -309,193 +333,173 @@ if ($position > (Wootook::getGameConfig('engine/universe/positions') + 1) || $po
|
|||
}
|
||||
|
||||
if ($error > 0) {
|
||||
message ("<font color=\"red\"><ul>" . $errorlist . "</ul></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message($errorlist, $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
|
||||
if (!isset($fleetArray)) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_no_fleetarray'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
message($lang['fl_no_fleetarray'], $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
|
||||
$distance = GetTargetDistance($planet->getGalaxy(), $galaxy, $planet->getSystem(), $system, $planet->getPosition(), $position);
|
||||
$duration = GetMissionDuration($speed, $MaxFleetSpeed, $distance, $SpeedFactor);
|
||||
$consumption = GetFleetConsumption($fleetArray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user);
|
||||
|
||||
/***************/
|
||||
$fleet['start_time'] = $duration + time();
|
||||
if ($mission == Legacies_Empire::ID_MISSION_EXPEDITION) {
|
||||
$StayDuration = $_POST['expeditiontime'] * 3600;
|
||||
$StayTime = $fleet['start_time'] + $_POST['expeditiontime'] * 3600;
|
||||
} elseif ($_POST['mission'] == 5) {
|
||||
$StayDuration = $_POST['holdingtime'] * 3600;
|
||||
$StayTime = $fleet['start_time'] + $_POST['holdingtime'] * 3600;
|
||||
} else {
|
||||
$StayDuration = 0;
|
||||
$StayTime = 0;
|
||||
}
|
||||
$fleet['end_time'] = $StayDuration + (2 * $duration) + time();
|
||||
$FleetStorage = 0;
|
||||
$FleetShipCount = 0;
|
||||
$fleet_array = "";
|
||||
$FleetSubQRY = "";
|
||||
$startTime = time() + $duration;
|
||||
if ($mission == Legacies_Empire::ID_MISSION_EXPEDITION && isset($_POST['expeditiontime']) && is_int($_POST['expeditiontime'])
|
||||
&& ($expeditionTime = intval($_POST['expeditiontime'])) >= 1 && $expeditionTime <= 10) {
|
||||
$StayDuration = $expeditionTime * 3600;
|
||||
$StayTime = $startTime + $expeditionTime * 3600;
|
||||
} elseif ($mission == Legacies_Empire::ID_MISSION_STATION_ALLY || $mission == Legacies_Empire::ID_MISSION_EXPLOIT && is_int($_POST['holdingtime'])
|
||||
&& ($holdingTime = intval($_POST['holdingtime'])) >= 1 && $holdingTime <= 10) {
|
||||
$StayDuration = $holdingTime * 3600;
|
||||
$StayTime = $startTime + $holdingTime * 3600;
|
||||
} else {
|
||||
$StayDuration = 0;
|
||||
$StayTime = 0;
|
||||
}
|
||||
|
||||
foreach ($fleetArray as $Ship => $Count) {
|
||||
$FleetStorage += $pricelist[$Ship]["capacity"] * $Count;
|
||||
$FleetShipCount += $Count;
|
||||
$fleet_array .= $Ship .",". $Count .";";
|
||||
$FleetSubQRY .= "`".$resource[$Ship] . "` = `" . $resource[$Ship] . "` - " . $Count . " , ";
|
||||
}
|
||||
/* END Refactoring */
|
||||
$endTime = $StayDuration + (2 * $duration) + time();
|
||||
$FleetStorage = 0;
|
||||
$FleetShipCount = sum($fleetArray);
|
||||
$serializedFleetArray = '';
|
||||
|
||||
$FleetStorage -= $consumption;
|
||||
$StorageNeeded = 0;
|
||||
if ($_POST['resource1'] < 1) {
|
||||
$TransMetal = 0;
|
||||
} else {
|
||||
$TransMetal = $_POST['resource1'];
|
||||
$StorageNeeded += $TransMetal;
|
||||
}
|
||||
if ($_POST['resource2'] < 1) {
|
||||
$TransCrystal = 0;
|
||||
} else {
|
||||
$TransCrystal = $_POST['resource2'];
|
||||
$StorageNeeded += $TransCrystal;
|
||||
}
|
||||
if ($_POST['resource3'] < 1) {
|
||||
$TransDeuterium = 0;
|
||||
} else {
|
||||
$TransDeuterium = $_POST['resource3'];
|
||||
$StorageNeeded += $TransDeuterium;
|
||||
}
|
||||
foreach ($fleetArray as $shipId => $count) {
|
||||
$FleetStorage += $pricelist[$shipId]["capacity"] * $count;
|
||||
$serializedFleetArray .= $shipId .",". $count .";";
|
||||
$planet->setElement($shipId, $planet->getElement($shipId) - $count);
|
||||
}
|
||||
|
||||
$StockMetal = $planet['metal'];
|
||||
$StockCrystal = $planet['cristal'];
|
||||
$StockDeuterium = $planet['deuterium'];
|
||||
$StockDeuterium -= $consumption;
|
||||
$StockMetal = $planet['metal'];
|
||||
$StockCrystal = $planet['cristal'];
|
||||
$StockDeuterium = $planet['deuterium'] - $consumption;
|
||||
|
||||
$StockOk = false;
|
||||
if ($StockMetal >= $TransMetal) {
|
||||
if ($StockCrystal >= $TransCrystal) {
|
||||
if ($StockDeuterium >= $TransDeuterium) {
|
||||
$StockOk = true;
|
||||
}
|
||||
}
|
||||
$FleetStorage -= $consumption;
|
||||
$StorageNeeded = 0;
|
||||
if (!isset($_POST['resource1']) || intval($_POST['resource1']) < 1) {
|
||||
$TransMetal = 0;
|
||||
} else {
|
||||
$TransMetal = intval($_POST['resource1']);
|
||||
if ($StockMetal < $TransMetal) {
|
||||
$TransMetal = $StockMetal;
|
||||
}
|
||||
if ( !$StockOk ) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_noressources'] . pretty_number($consumption) ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
$StorageNeeded += $TransMetal;
|
||||
}
|
||||
if (!isset($_POST['resource2']) || intval($_POST['resource2']) < 1) {
|
||||
$TransCrystal = 0;
|
||||
} else {
|
||||
$TransCrystal = intval($_POST['resource2']);
|
||||
if ($StockCrystal < $TransCrystal) {
|
||||
$TransCrystal = $StockCrystal;
|
||||
}
|
||||
|
||||
if ( $StorageNeeded > $FleetStorage) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_nostoragespa'] . pretty_number($StorageNeeded - $FleetStorage) ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
$StorageNeeded += $TransCrystal;
|
||||
}
|
||||
if (!isset($_POST['resource3']) || intval($_POST['resource3']) < 1) {
|
||||
$TransDeuterium = 0;
|
||||
} else {
|
||||
$TransDeuterium = intval($_POST['resource3']);
|
||||
if ($StockDeuterium < $TransDeuterium) {
|
||||
$TransDeuterium = $StockDeuterium;
|
||||
}
|
||||
$StorageNeeded += $TransDeuterium;
|
||||
}
|
||||
|
||||
if ($destination['id_level'] > $user['authlevel']) {
|
||||
$Allowed = true;
|
||||
switch ($_POST['mission']){
|
||||
case 1:
|
||||
case 2:
|
||||
case 6:
|
||||
case 9:
|
||||
$Allowed = false;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 7:
|
||||
case 8:
|
||||
case 15:
|
||||
break;
|
||||
default:
|
||||
}
|
||||
if ($Allowed == false) {
|
||||
message ("<font color=\"red\"><b>". $lang['fl_adm_attak'] ."</b></font>", $lang['fl_warning'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
if ($StorageNeeded > $FleetStorage) {
|
||||
message($lang['fl_nostoragespa'] . pretty_number($StorageNeeded - $FleetStorage), $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
|
||||
if ($destinationUser['authlevel'] > $user['authlevel']) {
|
||||
$specialMissions = array(
|
||||
Legacies_Empire::ID_MISSION_ATTACK,
|
||||
Legacies_Empire::ID_MISSION_GROUP_ATTACK,
|
||||
Legacies_Empire::ID_MISSION_SPY,
|
||||
Legacies_Empire::ID_MISSION_DESTROY
|
||||
);
|
||||
|
||||
if (in_array($mission, $specialMissions)) {
|
||||
message($lang['fl_adm_attak'], $lang['fl_warning'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
}
|
||||
|
||||
// ecriture de l'enregistrement de flotte (a partir de l<>, y a quelque chose qui vole et c'est toujours sur la planete d'origine)
|
||||
$QryInsertFleet = "INSERT INTO {{table}} SET ";
|
||||
$QryInsertFleet .= "`fleet_owner` = '". $user['id'] ."', ";
|
||||
$QryInsertFleet .= "`fleet_mission` = '". $_POST['mission'] ."', ";
|
||||
$QryInsertFleet .= "`fleet_amount` = '". $FleetShipCount ."', ";
|
||||
$QryInsertFleet .= "`fleet_array` = '". $fleet_array ."', ";
|
||||
$QryInsertFleet .= "`fleet_start_time` = '". $fleet['start_time'] ."', ";
|
||||
$QryInsertFleet .= "`fleet_start_galaxy` = '". intval($_POST['thisgalaxy']) ."', ";
|
||||
$QryInsertFleet .= "`fleet_start_system` = '". intval($_POST['thissystem']) ."', ";
|
||||
$QryInsertFleet .= "`fleet_start_planet` = '". intval($_POST['thisplanet']) ."', ";
|
||||
$QryInsertFleet .= "`fleet_start_type` = '". intval($_POST['thisplanettype']) ."', ";
|
||||
$QryInsertFleet .= "`fleet_end_time` = '". $fleet['end_time'] ."', ";
|
||||
$QryInsertFleet .= "`fleet_end_stay` = '". $StayTime ."', ";
|
||||
$QryInsertFleet .= "`fleet_end_galaxy` = '". intval($_POST['galaxy']) ."', ";
|
||||
$QryInsertFleet .= "`fleet_end_system` = '". intval($_POST['system']) ."', ";
|
||||
$QryInsertFleet .= "`fleet_end_planet` = '". intval($_POST['planet']) ."', ";
|
||||
$QryInsertFleet .= "`fleet_end_type` = '". intval($_POST['planettype']) ."', ";
|
||||
$QryInsertFleet .= "`fleet_resource_metal` = '". intval($TransMetal) ."', ";
|
||||
$QryInsertFleet .= "`fleet_resource_cristal` = '". intval($TransCrystal) ."', ";
|
||||
$QryInsertFleet .= "`fleet_resource_deuterium` = '". intval($TransDeuterium) ."', ";
|
||||
$QryInsertFleet .= "`fleet_target_owner` = '". $destination['id_owner'] ."', ";
|
||||
$QryInsertFleet .= "`start_time` = '". time() ."';";
|
||||
doquery( $QryInsertFleet, 'fleets');
|
||||
/* BEGIN Refactoring */
|
||||
try {
|
||||
$writeAdapter->beginTransaction();
|
||||
|
||||
$writeAdapter->insert()
|
||||
->into($writeAdapter->getTable('fleets'))
|
||||
->set('fleet_owner', $user->getId())
|
||||
->set('fleet_mission', $mission)
|
||||
->set('fleet_amount', $FleetShipCount)
|
||||
->set('fleet_array', $fleet_array)
|
||||
->set('fleet_start_time', $startTime)
|
||||
->set('fleet_start_galaxy', $planet->getGalaxy())
|
||||
->set('fleet_start_system', $planet->getSystem())
|
||||
->set('fleet_start_planet', $planet->getPosition())
|
||||
->set('fleet_start_type', $planet->getType())
|
||||
->set('fleet_end_time', $endTime)
|
||||
->set('fleet_end_stay', $user->getId())
|
||||
->set('fleet_end_stay', $user->getId())
|
||||
->set('fleet_end_galaxy', $galaxy)
|
||||
->set('fleet_end_system', $system)
|
||||
->set('fleet_end_planet', $planet)
|
||||
->set('fleet_end_type', $type)
|
||||
->set('fleet_resource_metal', intval($TransMetal))
|
||||
->set('fleet_resource_cristal', intval($TransCrystal))
|
||||
->set('fleet_resource_deuterium', intval($TransDeuterium))
|
||||
->set('fleet_target_owner', $destination['id_owner'])
|
||||
->set('start_time', time())
|
||||
->execute()
|
||||
;
|
||||
|
||||
$planet["metal"] = $planet["metal"] - $TransMetal;
|
||||
$planet["cristal"] = $planet["cristal"] - $TransCrystal;
|
||||
$planet["deuterium"] = $planet["deuterium"] - $TransDeuterium;
|
||||
$planet["deuterium"] = $planet["deuterium"] - $consumption;
|
||||
$planet["deuterium"] = $planet["deuterium"] - $TransDeuterium - $consumption;
|
||||
$planet->save();
|
||||
|
||||
$QryUpdatePlanet = "UPDATE {{table}} SET ";
|
||||
$QryUpdatePlanet .= $FleetSubQRY;
|
||||
$QryUpdatePlanet .= "`metal` = '". $planet["metal"] ."', ";
|
||||
$QryUpdatePlanet .= "`cristal` = '". $planet["cristal"] ."', ";
|
||||
$QryUpdatePlanet .= "`deuterium` = '". $planet["deuterium"] ."' ";
|
||||
$QryUpdatePlanet .= "WHERE ";
|
||||
$QryUpdatePlanet .= "`id` = '". $planet['id'] ."'";
|
||||
$writeAdapter->commit();
|
||||
} catch (Exception $e) {
|
||||
Wootook_Core_ErrorProfiler::getSingleton()->addException($e);
|
||||
$writeAdapter->rollback();
|
||||
message($errorlist, $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||
}
|
||||
/* END Refactoring */
|
||||
|
||||
// Mise a jours de l'enregistrement de la planete de depart (a partir de là, y a quelque chose qui vole et ce n'est plus sur la planete de depart)
|
||||
doquery("LOCK TABLE {{table}} WRITE", 'planets');
|
||||
doquery ($QryUpdatePlanet, "planets");
|
||||
doquery("UNLOCK TABLES", '');
|
||||
// doquery("FLUSH TABLES", '');
|
||||
$page = "<br><div><center>";
|
||||
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"519\">";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td class=\"c\" colspan=\"2\"><span class=\"success\">". $lang['fl_fleet_send'] ."</span></td>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_mission'] ."</th>";
|
||||
$page .= "<th>". $missionTypes[$mission] ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_dist'] ."</th>";
|
||||
$page .= "<th>". pretty_number($distance) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_speed'] ."</th>";
|
||||
$page .= "<th>". pretty_number($_POST['speedallsmin']) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
|
||||
$page .= "<th>". pretty_number($consumption) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_from'] ."</th>";
|
||||
$page .= "<th>". $_POST['thisgalaxy'] .":". $_POST['thissystem']. ":". $_POST['thisplanet'] ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_dest'] ."</th>";
|
||||
$page .= "<th>". $galaxy .":". $system .":". $planet ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_time_go'] ."</th>";
|
||||
$page .= "<th>". date("M D d H:i:s", $startTime) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_time_back'] ."</th>";
|
||||
$page .= "<th>". date("M D d H:i:s", $endTime) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<td class=\"c\" colspan=\"2\">". $lang['fl_title'] ."</td>";
|
||||
|
||||
// Un peu de blabla pour l'utilisateur, affichage d'un joli tableau de la flotte expedi<64>e
|
||||
$page = "<br><div><center>";
|
||||
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"519\">";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td class=\"c\" colspan=\"2\"><span class=\"success\">". $lang['fl_fleet_send'] ."</span></td>";
|
||||
foreach ($fleetArray as $Ship => $Count) {
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_mission'] ."</th>";
|
||||
$page .= "<th>". $missionTypes[$_POST['mission']] ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_dist'] ."</th>";
|
||||
$page .= "<th>". pretty_number($distance) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_speed'] ."</th>";
|
||||
$page .= "<th>". pretty_number($_POST['speedallsmin']) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
|
||||
$page .= "<th>". pretty_number($consumption) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_from'] ."</th>";
|
||||
$page .= "<th>". $_POST['thisgalaxy'] .":". $_POST['thissystem']. ":". $_POST['thisplanet'] ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_dest'] ."</th>";
|
||||
$page .= "<th>". $_POST['galaxy'] .":". $_POST['system'] .":". $_POST['planet'] ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_time_go'] ."</th>";
|
||||
$page .= "<th>". date("M D d H:i:s", $fleet['start_time']) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_time_back'] ."</th>";
|
||||
$page .= "<th>". date("M D d H:i:s", $fleet['end_time']) ."</th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<td class=\"c\" colspan=\"2\">". $lang['fl_title'] ."</td>";
|
||||
$page .= "<th>". $lang['tech'][$Ship] ."</th>";
|
||||
$page .= "<th>". pretty_number($Count) ."</th>";
|
||||
}
|
||||
$page .= "</tr></table></div></center>";
|
||||
|
||||
foreach ($fleetArray as $Ship => $Count) {
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['tech'][$Ship] ."</th>";
|
||||
$page .= "<th>". pretty_number($Count) ."</th>";
|
||||
}
|
||||
$page .= "</tr></table></div></center>";
|
||||
|
||||
// Provisoire
|
||||
sleep (1);
|
||||
|
||||
$planetrow = doquery ("SELECT * FROM {{table}} WHERE `id` = '". $planet['id'] ."';", 'planets', true);
|
||||
|
||||
display($page, $lang['fl_title']);
|
||||
display($page, $lang['fl_title']);
|
||||
|
|
|
|||
|
|
@ -671,3 +671,47 @@ function ResetThisFuckingCheater($userId)
|
|||
$user->save();
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routine Affichage d'un message avec saut vers une autre page si souhaité
|
||||
* @deprecated
|
||||
*/
|
||||
function message($message, $title = 'Error', $dest = null, $time = '3', $color = 'orange')
|
||||
{
|
||||
defined('DEPRECATION') || Wootook_Core_ErrorProfiler::getSingleton()->addException(new Wootook_Core_Exception_Deprecated(sprintf('Function "%s" is deprecated', __FUNCTION__)));
|
||||
|
||||
$layout = Deprecated::getLayout(false);
|
||||
$layout->load('message');
|
||||
|
||||
$messageBlock = $layout->getBlock('message');
|
||||
if (!$messageBlock instanceof Wootook_Core_Mvc_View_View) {
|
||||
exit(0);
|
||||
}
|
||||
$messageBlock['title'] = $title;
|
||||
$messageBlock['message'] = $message;
|
||||
|
||||
echo $layout->render();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Routine Affichage d'un message administrateur avec saut vers une autre page si souhaité
|
||||
* @deprecated
|
||||
*/
|
||||
function AdminMessage($message, $title = 'Error', $dest = null, $time = '3', $color = 'orange')
|
||||
{
|
||||
defined('DEPRECATION') || Wootook_Core_ErrorProfiler::getSingleton()->addException(new Wootook_Core_Exception_Deprecated(sprintf('Function "%s" is deprecated', __FUNCTION__)));
|
||||
|
||||
$layout = Deprecated::getLayout(false);
|
||||
$layout->load('message');
|
||||
|
||||
$messageBlock = $layout->getBlock('message');
|
||||
if (!$messageBlock instanceof Wootook_Core_Mvc_View_View) {
|
||||
exit(0);
|
||||
}
|
||||
$messageBlock['title'] = $title;
|
||||
$messageBlock['message'] = $message;
|
||||
|
||||
echo $layout->render();
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,30 +55,3 @@ function is_email($email) {
|
|||
return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i", $email));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Routine Affichage d'un message administrateur avec saut vers une autre page si souhait<69>
|
||||
//
|
||||
function AdminMessage ($mes, $title = 'Error', $dest = '', $time = '3', $color= 'red') {
|
||||
$parse['color'] = $color;
|
||||
$parse['title'] = $title;
|
||||
$parse['mes'] = $mes;
|
||||
|
||||
$page = parsetemplate(gettemplate('admin/message_body'), $parse);
|
||||
|
||||
display ($page, $title, false, (($dest != "") ? "<meta http-equiv=\"refresh\" content=\"$time;URL={$dest}\">" : ""), true);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Routine Affichage d'un message avec saut vers une autre page si souhait<69>
|
||||
//
|
||||
function message($mes, $title = 'Error', $dest = "", $time = "3", $color = 'orange') {
|
||||
$parse['color'] = $color;
|
||||
$parse['title'] = $title;
|
||||
$parse['mes'] = $mes;
|
||||
|
||||
$page = parsetemplate(gettemplate('admin/message_body'), $parse);
|
||||
|
||||
display ($page, $title, false, (($dest != "") ? "<meta http-equiv=\"refresh\" content=\"$time;URL={$dest}\">" : ""), true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,106 +52,7 @@ $lang['type_mission'][8] = "Recycler";
|
|||
$lang['type_mission'][9] = "Détruire";
|
||||
$lang['type_mission'][15] = "Expéditions";
|
||||
|
||||
// Short names for fight report
|
||||
$lang['tech_rc'] = array (
|
||||
202 => 'P.transp.',
|
||||
203 => 'G.transp.',
|
||||
204 => 'Ch.léger',
|
||||
205 => 'Ch.lourd',
|
||||
206 => 'Croiseur',
|
||||
207 => 'V.bataille',
|
||||
208 => 'V.colo.',
|
||||
209 => 'Recycleur',
|
||||
210 => 'Sonde',
|
||||
211 => 'Bombardier',
|
||||
212 => 'Sat.sol.',
|
||||
213 => 'Destr.',
|
||||
214 => 'Rip',
|
||||
215 => 'Traqueur',
|
||||
216 => 'Supernova',
|
||||
|
||||
401 => 'Missile',
|
||||
402 => 'L.léger.',
|
||||
403 => 'L.lourd',
|
||||
404 => 'Can.Gauss',
|
||||
405 => 'Art.ions',
|
||||
406 => 'Lanc.plasma',
|
||||
407 => 'P.bouclier',
|
||||
408 => 'G.bouclier',
|
||||
);
|
||||
|
||||
$lang['tech'] = array(
|
||||
0 => "Bâtiments",
|
||||
1 => "Mine de métal",
|
||||
2 => "Mine de cristal",
|
||||
3 => "Synthétiseur de deutérium",
|
||||
4 => "Centrale électrique solaire",
|
||||
12 => "Centrale électrique de fusion",
|
||||
14 => "Usine de robots",
|
||||
15 => "Usine de nanites",
|
||||
21 => "Chantier spatial",
|
||||
22 => "Hangar de métal",
|
||||
23 => "Hangar de cristal",
|
||||
24 => "Réservoir de deutérium",
|
||||
31 => "Laboratoire de recherche",
|
||||
33 => "Terraformeur",
|
||||
34 => "Dépôt de ravitaillement",
|
||||
|
||||
40 => 'Bâtiments spéciaux',
|
||||
41 => 'Base lunaire',
|
||||
42 => 'Phalange de capteur',
|
||||
43 => 'Porte de saut spatial',
|
||||
|
||||
44 => "Silo de missiles",
|
||||
|
||||
// Technologies
|
||||
100 => 'Recherches',
|
||||
106 => 'Technologie Espionnage',
|
||||
108 => 'Technologie Ordinateur',
|
||||
109 => 'Technologie Armes',
|
||||
110 => 'Technologie Bouclier',
|
||||
111 => 'Technologie Protection des vaisseaux spatiaux',
|
||||
113 => 'Technologie Energie',
|
||||
114 => 'Technologie Hyperespace',
|
||||
115 => 'Réacteur à combustion',
|
||||
117 => 'Réacteur à impulsion',
|
||||
118 => 'Propulsion hyperespace',
|
||||
120 => 'Technologie Laser',
|
||||
121 => 'Technologie Ions',
|
||||
122 => 'Technologie Plasma',
|
||||
123 => 'Réseau de recherche intergalactique',
|
||||
124 => 'Technologie Expéditions',
|
||||
199 => 'Technologie Graviton',
|
||||
|
||||
200 => 'Vaisseaux',
|
||||
202 => 'Petit transporteur',
|
||||
203 => 'Grand transporteur',
|
||||
204 => 'Chasseur léger',
|
||||
205 => 'Chasseur lourd',
|
||||
206 => 'Croiseur',
|
||||
207 => 'Vaisseau de bataille',
|
||||
208 => 'Vaisseau de colonisation',
|
||||
209 => 'Recycleur',
|
||||
210 => 'Sonde espionnage',
|
||||
211 => 'Bombardier',
|
||||
212 => 'Satellite solaire',
|
||||
213 => 'Destructeur',
|
||||
214 => 'Etoile de la mort',
|
||||
215 => 'Traqueur',
|
||||
216 => 'Supernova',
|
||||
|
||||
400 => 'Défense',
|
||||
401 => 'Lanceur de missiles',
|
||||
402 => 'Artillerie laser légère',
|
||||
403 => 'Artillerie laser lourde',
|
||||
404 => 'Canon de Gauss',
|
||||
405 => 'Artillerie à ions',
|
||||
406 => 'Lanceur de plasma',
|
||||
407 => 'Petit bouclier',
|
||||
408 => 'Grand bouclier',
|
||||
502 => 'Missile Interception',
|
||||
503 => 'Missile Interplanétaire',
|
||||
|
||||
600 => "Officier",
|
||||
601 => "Géologue",
|
||||
602 => "Amiral",
|
||||
|
|
@ -168,13 +69,9 @@ $lang['tech'] = array(
|
|||
613 => "General",
|
||||
614 => "Raideur",
|
||||
615 => "Empereur"
|
||||
|
||||
);
|
||||
|
||||
$lang['res']['descriptions'] = array(
|
||||
1 => "Principal fournisseur de matières premières pour la construction de structures portantes et de vaisseaux.",
|
||||
2 => "Fournisseur principal de ressources pour les installations électroniques et pour les alliages.",
|
||||
3 => "Extrait la petite quantité de deutérium de l'eau d'une planète.",
|
||||
4 => "Les centrales électriques solaires transforment les rayons de soleil en énergie. Presque tous les bâtiments ont besoin d'énergie pour fonctionner.",
|
||||
12 => "La centrale électrique de fusion produit de l'énergie en fusionnant 2 atomes d'hydrogène en un atome d'hélium.",
|
||||
14 => "Les usines de robots produisent des robots ouvriers qui servent à la construction de l'infrastructure planétaire. Chaque niveau augmente la vitesse de construction des différents bâtiments.",
|
||||
|
|
@ -237,4 +134,4 @@ $lang['res']['descriptions'] = array(
|
|||
|
||||
);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -62,26 +62,24 @@ $textColor = array(
|
|||
);
|
||||
|
||||
$db = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection(Wootook_Core_Database_ConnectionManager::DEFAULT_CONNECTION_NAME);
|
||||
$sql = <<<EOF
|
||||
SELECT
|
||||
users.username AS username,
|
||||
planets.name AS planet_name,
|
||||
stats.build_points AS build_points,
|
||||
stats.fleet_points AS fleet_points,
|
||||
stats.tech_points AS tech_points,
|
||||
stats.total_points AS total_points
|
||||
FROM {{table}}users AS users
|
||||
LEFT JOIN {{table}}statpoints AS stats ON stats.id_owner=users.id
|
||||
LEFT JOIN {{table}}planets AS planets ON planets.id_owner=users.id
|
||||
WHERE users.id={$id}
|
||||
EOF;
|
||||
$statement = $db->select()
|
||||
->column(array('username' => 'username'), 'user')
|
||||
->column(array('planet_name' => 'name'), 'planet')
|
||||
->column(array('build_points' => 'build_points', 'fleet_points' => 'fleet_points', 'tech_points' => 'tech_points', 'total_points' => 'total_points'), 'stats')
|
||||
->from(array('user' => $db->getTable('users')))
|
||||
->joinLeft(array('stats' => $db->getTable('statpoints')), 'stats.id_owner=users.id')
|
||||
->joinLeft(array('planet' => $db->getTable('planets')), 'planet.id_owner=users.id')
|
||||
->where('user.id', $id)
|
||||
->prepare()
|
||||
;
|
||||
|
||||
|
||||
$data = array_merge(
|
||||
array(
|
||||
'game_name' => Wootook::getGameConfig('game/general/name'),
|
||||
'date' => date('d M Y')
|
||||
),
|
||||
doquery($sql, '', true)
|
||||
$statement->fetch()
|
||||
);
|
||||
|
||||
$image = new Wootook_Core_Model_Image_Png();
|
||||
|
|
|
|||
Loading…
Reference in a new issue