diff --git a/onyx2/include/Class/Donnees/technologies.php b/onyx2/include/Class/Donnees/technologies.php index f6b9db0..1864ca9 100644 --- a/onyx2/include/Class/Donnees/technologies.php +++ b/onyx2/include/Class/Donnees/technologies.php @@ -1617,9 +1617,6 @@ class dTechnologies implements Donnees array("technologies", 1, 0), array('batiments', 6, 2) ), - array( - array("technologies", 8, 0) - ), array( array("technologies", 8, 1) ), @@ -1671,6 +1668,9 @@ class dTechnologies implements Donnees array( array("technologies", 8, 17) ), + array( + array("technologies", 8, 18) + ), ); break; default: diff --git a/onyx2/include/admin/alliance.php b/onyx2/include/admin/alliance.php index ceb4cca..e6e54d2 100644 --- a/onyx2/include/admin/alliance.php +++ b/onyx2/include/admin/alliance.php @@ -12,7 +12,7 @@ if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') { $pagea = 'print_key'; $id_plan = $_GET['id']; $key = $_GET['key']; - $chapeau = new BDD(); + $chapeau->connexion(); $chapeau->escape($id_plan); $chapeau->escape($key); $reqA = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';"); @@ -27,20 +27,20 @@ if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') { if (isset($_POST['key']) && isset($_POST['mod'])) { $key = $_POST['key']; $mod = $_POST['mod']; - $chapeau = new BDD(); + $chapeau->connexion(); $chapeau->escape($mod); $chapeau->escape($id_plan); $chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';"); $chapeau->deconnexion(); } - $chapeau = new BDD(); + $chapeau->connexion(); $req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';"); $chapeau->deconnexion(); $template->assign('tableau', $req); $template->assign('idPlan', $id_plan); } elseif (!empty($_GET['name'])) { $name = $_GET['name']; - $chapeau = new BDD(); + $chapeau->connexion(); $chapeau->escape($name); $req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';"); $chapeau->deconnexion(); diff --git a/onyx2/include/admin/planete.php b/onyx2/include/admin/planete.php index cbac82d..a31fd20 100644 --- a/onyx2/include/admin/planete.php +++ b/onyx2/include/admin/planete.php @@ -65,9 +65,5 @@ if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] == 'hash_planete header('Location: '.$VAR["menu"]["vplanetes"].'&id='.$req['id']); exit; } else { - $bdd = new BDD(); - $req = $bdd->query("SELECT planete.id, nom_planete, pseudo, galaxie, ss, position FROM planete LEFT JOIN user ON (id_user=user.id) LIMIT 1000;"); - $bdd->deconnexion(); - $template->assign('planetes', $req); $pagea = 'print_choixP'; } diff --git a/onyx2/include/game/flottes/details.php b/onyx2/include/game/flottes/details.php index c7464d3..b1773f2 100644 --- a/onyx2/include/game/flottes/details.php +++ b/onyx2/include/game/flottes/details.php @@ -28,18 +28,16 @@ if (!defined('INDEX')) { if ($flotteN->mission == '6') { erreur('Votre flotte est déjà en train de revenir !', 'red', '?p=flotte&n='.$idN, 1500); } elseif ($flotteN->end_time > $tpsDD) { - $bdd = new BDD(); - $bdd->query("UPDATE $table_flottes SET mission = '6', end_time = $tpsDD, end_planete = start_planete WHERE id_user = ".$planete->id_user." AND id = $idN;"); - $bdd->deconnexion(); + $bdd->query("UPDATE $table_flottes SET mission = '6', effectue = '1', end_time = $tpsDD, end_galaxie = start_galaxie, end_ss = start_ss, end_position = start_position WHERE id_user = ".$planete->id_user." AND id = $idN;"); redirection("?p=flotte&n=".$idN); } else { erreur('Impossible d\'annuler la mission, elle a déjà commencée.', "red", '?p=flotte&n='.$idN, 1500); } } - + $SESS->values['ret_fleet'] = md5('HB.fleet_'.rand().'☺ß☻'); $SESS->put(); - + $template->assign('ret_fleet', $SESS->values['ret_fleet']); $template->assign('flotte', $flotteN); $page = 'flotten'; diff --git a/onyx2/include/game/flottes/envoyer.php b/onyx2/include/game/flottes/envoyer.php index ac75b7b..401f0b7 100644 --- a/onyx2/include/game/flottes/envoyer.php +++ b/onyx2/include/game/flottes/envoyer.php @@ -4,8 +4,6 @@ if (!defined('INDEX')) { exit; } -require_once("Class/class.donnee.php"); - //Récupération des informations envoyées $idPrep = gpc("cds", "post"); @@ -59,18 +57,6 @@ if ($mission == 2) { erreur('Fonder d\'abord une alliance avant de coloniser un astéroide !', "red", $VAR["menu"]["flotte"]); } } - - // on vérifie que le joueur n'essaye pas de coloniser plus de planète que sa techno expansion lui permet - $bdd->reconnexion(); - $resultat = $bdd->unique_query("SELECT COUNT(id) as nb_planete FROM $table_planete WHERE id_user = ".$planete->id_user.";"); - $bdd->deconnexion(); - $nb_planete = $resultat["nb_planete"]; - $branche = 8; - $idTechnologie = $nb_planete; - $neededTechnologies = Donnee::donneeTechnologie($branche, $idTechnologie, "needed", $planete); - if (((int)$planete->technologies[$branche]& $neededTechnologies) != $neededTechnologies) { - erreur('Vous ne pouvez pas coloniser plus de planète que votre niveau d\'expansion'); - } } //On vérifie que les attaques soient bien activées diff --git a/onyx2/tpl/admin/print_choixP.tpl b/onyx2/tpl/admin/print_choixP.tpl index 0089143..b3c6605 100644 --- a/onyx2/tpl/admin/print_choixP.tpl +++ b/onyx2/tpl/admin/print_choixP.tpl @@ -37,22 +37,4 @@ -
-

Liste des planètes existantes

- - - - - - - - {foreach from=$planetes item=planete} - - - - - - - {/foreach} -
PlanèteJoueurPosition
{$planete.nom_planete}{$planete.pseudo}{$planete.galaxie}:{$planete.ss}:{$planete.position}
-{include file='game/footer.tpl'} +{include file='game/footer.tpl'} \ No newline at end of file