task/20210226/various_fix #21
@ -1617,6 +1617,9 @@ class dTechnologies implements Donnees
|
|||||||
array("technologies", 1, 0),
|
array("technologies", 1, 0),
|
||||||
array('batiments', 6, 2)
|
array('batiments', 6, 2)
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
array("technologies", 8, 0)
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
array("technologies", 8, 1)
|
array("technologies", 8, 1)
|
||||||
),
|
),
|
||||||
@ -1668,9 +1671,6 @@ class dTechnologies implements Donnees
|
|||||||
array(
|
array(
|
||||||
array("technologies", 8, 17)
|
array("technologies", 8, 17)
|
||||||
),
|
),
|
||||||
array(
|
|
||||||
array("technologies", 8, 18)
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -12,7 +12,7 @@ if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') {
|
|||||||
$pagea = 'print_key';
|
$pagea = 'print_key';
|
||||||
$id_plan = $_GET['id'];
|
$id_plan = $_GET['id'];
|
||||||
$key = $_GET['key'];
|
$key = $_GET['key'];
|
||||||
$chapeau->connexion();
|
$chapeau = new BDD();
|
||||||
$chapeau->escape($id_plan);
|
$chapeau->escape($id_plan);
|
||||||
$chapeau->escape($key);
|
$chapeau->escape($key);
|
||||||
$reqA = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
$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'])) {
|
if (isset($_POST['key']) && isset($_POST['mod'])) {
|
||||||
$key = $_POST['key'];
|
$key = $_POST['key'];
|
||||||
$mod = $_POST['mod'];
|
$mod = $_POST['mod'];
|
||||||
$chapeau->connexion();
|
$chapeau = new BDD();
|
||||||
$chapeau->escape($mod);
|
$chapeau->escape($mod);
|
||||||
$chapeau->escape($id_plan);
|
$chapeau->escape($id_plan);
|
||||||
$chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';");
|
$chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';");
|
||||||
$chapeau->deconnexion();
|
$chapeau->deconnexion();
|
||||||
}
|
}
|
||||||
$chapeau->connexion();
|
$chapeau = new BDD();
|
||||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||||
$chapeau->deconnexion();
|
$chapeau->deconnexion();
|
||||||
$template->assign('tableau', $req);
|
$template->assign('tableau', $req);
|
||||||
$template->assign('idPlan', $id_plan);
|
$template->assign('idPlan', $id_plan);
|
||||||
} elseif (!empty($_GET['name'])) {
|
} elseif (!empty($_GET['name'])) {
|
||||||
$name = $_GET['name'];
|
$name = $_GET['name'];
|
||||||
$chapeau->connexion();
|
$chapeau = new BDD();
|
||||||
$chapeau->escape($name);
|
$chapeau->escape($name);
|
||||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';");
|
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';");
|
||||||
$chapeau->deconnexion();
|
$chapeau->deconnexion();
|
||||||
|
@ -65,5 +65,9 @@ if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] == 'hash_planete
|
|||||||
header('Location: '.$VAR["menu"]["vplanetes"].'&id='.$req['id']);
|
header('Location: '.$VAR["menu"]["vplanetes"].'&id='.$req['id']);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} 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';
|
$pagea = 'print_choixP';
|
||||||
}
|
}
|
||||||
|
@ -28,16 +28,18 @@ if (!defined('INDEX')) {
|
|||||||
if ($flotteN->mission == '6') {
|
if ($flotteN->mission == '6') {
|
||||||
erreur('Votre flotte est déjà en train de revenir !', 'red', '?p=flotte&n='.$idN, 1500);
|
erreur('Votre flotte est déjà en train de revenir !', 'red', '?p=flotte&n='.$idN, 1500);
|
||||||
} elseif ($flotteN->end_time > $tpsDD) {
|
} elseif ($flotteN->end_time > $tpsDD) {
|
||||||
$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;");
|
$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();
|
||||||
redirection("?p=flotte&n=".$idN);
|
redirection("?p=flotte&n=".$idN);
|
||||||
} else {
|
} else {
|
||||||
erreur('Impossible d\'annuler la mission, elle a déjà commencée.', "red", '?p=flotte&n='.$idN, 1500);
|
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->values['ret_fleet'] = md5('HB.fleet_'.rand().'☺ß☻');
|
||||||
$SESS->put();
|
$SESS->put();
|
||||||
|
|
||||||
$template->assign('ret_fleet', $SESS->values['ret_fleet']);
|
$template->assign('ret_fleet', $SESS->values['ret_fleet']);
|
||||||
$template->assign('flotte', $flotteN);
|
$template->assign('flotte', $flotteN);
|
||||||
$page = 'flotten';
|
$page = 'flotten';
|
||||||
|
@ -4,6 +4,8 @@ if (!defined('INDEX')) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once("Class/class.donnee.php");
|
||||||
|
|
||||||
//Récupération des informations envoyées
|
//Récupération des informations envoyées
|
||||||
$idPrep = gpc("cds", "post");
|
$idPrep = gpc("cds", "post");
|
||||||
|
|
||||||
@ -57,6 +59,18 @@ if ($mission == 2) {
|
|||||||
erreur('Fonder d\'abord une alliance avant de coloniser un astéroide !', "red", $VAR["menu"]["flotte"]);
|
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
|
//On vérifie que les attaques soient bien activées
|
||||||
|
@ -37,4 +37,22 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
{include file='game/footer.tpl'}
|
<br />
|
||||||
|
<h2>Liste des planètes existantes</h2>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Planète</th>
|
||||||
|
<th>Joueur</th>
|
||||||
|
<th>Position</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
{foreach from=$planetes item=planete}
|
||||||
|
<tr>
|
||||||
|
<td>{$planete.nom_planete}</td>
|
||||||
|
<td>{$planete.pseudo}</td>
|
||||||
|
<td>{$planete.galaxie}:{$planete.ss}:{$planete.position}</td>
|
||||||
|
<td><a href="admin.php?p={$linkpage}&id={$planete.id}"><input type="submit" class="submit" value="GO" /></a></td>
|
||||||
|
<tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
{include file='game/footer.tpl'}
|
||||||
|
Loading…
Reference in New Issue
Block a user