diff --git a/src/add_declare.php b/src/add_declare.php index 08a8348..b2d6eaf 100644 --- a/src/add_declare.php +++ b/src/add_declare.php @@ -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); - - -?> \ No newline at end of file diff --git a/src/annonce.php b/src/annonce.php index c4fe5b9..9c0b506 100644 --- a/src/annonce.php +++ b/src/annonce.php @@ -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 .= << @@ -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 = "
La mine de métal 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.
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.
", + 'image' => 'graphics/buildings/metal-mine.png' + ), + + Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array( + 'name' => 'Mine de cristal', + 'description' => "La mine de cristal développe l'exploitation des minéraux entrant dans la comosition des systèmes électroniques.
Ces matériaux vous permettront d'augmenter la capacité de calculs de vos laboratoires ainsi que de ceux de vos systèmes de combat.
", + 'image' => 'graphics/buildings/cristal-mine.png' + ), + + Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array( + 'name' => "Synthétiseur de deutérium", + 'description' => "Le synthétiseur de deutérium 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.
", + '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' + ) +// }}} +); diff --git a/src/application/gamedata/legacies/default/production.php b/src/application/gamedata/legacies/default/production.php index 125faa4..545dcde 100644 --- a/src/application/gamedata/legacies/default/production.php +++ b/src/application/gamedata/legacies/default/production.php @@ -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' // }}} ); diff --git a/src/application/gamedata/legacies/default/requirements.php b/src/application/gamedata/legacies/default/requirements.php index 838a930..2ed5430 100644 --- a/src/application/gamedata/legacies/default/requirements.php +++ b/src/application/gamedata/legacies/default/requirements.php @@ -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 + ), // }}} // diff --git a/src/application/gamedata/legacies/default/types.php b/src/application/gamedata/legacies/default/types.php index 76c773d..c67c74d 100644 --- a/src/application/gamedata/legacies/default/types.php +++ b/src/application/gamedata/legacies/default/types.php @@ -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 ), // }}} diff --git a/src/fleetback.php b/src/fleetback.php index d82571b..4075674 100644 --- a/src/fleetback.php +++ b/src/fleetback.php @@ -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 ("". $BoxMessage ."", $BoxTitle, "fleet.". PHPEXT, 2); - -// ----------------------------------------------------------------------------------------------------------- -?> +message ($BoxMessage, $BoxTitle, "fleet.". PHPEXT, 2); diff --git a/src/floten1.php b/src/floten1.php index a3c0816..4ad8c27 100644 --- a/src/floten1.php +++ b/src/floten1.php @@ -255,14 +255,15 @@ $page .= "