From b1e1cc611784d61fa301320d9adc1bb30b601c2d Mon Sep 17 00:00:00 2001 From: Nigel Sheldon Date: Wed, 27 Jan 2021 10:51:17 +0100 Subject: [PATCH 01/15] =?UTF-8?q?l'envoi=20de=20flotte=20=C3=A9tait=20d?= =?UTF-8?q?=C3=A9sactiv=C3=A9,=20on=20le=20r=C3=A9active?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/ajax_flotte.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/htdocs/ajax_flotte.php b/htdocs/ajax_flotte.php index 3ab42e3..a2ae9ed 100644 --- a/htdocs/ajax_flotte.php +++ b/htdocs/ajax_flotte.php @@ -9,25 +9,26 @@ require_once("Class/JSON.php"); require_once("Class/flotte.php"); require_once("Class/planete.php"); -if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connected'] && !empty($SESS->values['id']) && !empty($SESS->level) && !empty($SESS->values['idPlan'])) { +if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connected'] && !empty($SESS->values['id']) && !empty($SESS->values['idPlan'])) { $idPrep = gpc("cds_temp", "post"); $json = new Services_JSON(); $nbtrajet = 2; - if (empty($config['flottes']) && $SESS->level <= 1) { - $datas = array( - 'root' => array( - 'destination' => '::', - 'temps' => '-', - 'deblok' => 'Les flottes sont désactivés pour le moment.', - 'conso' => '-', - 'tactique' => '', - 'places' => '' - ) - ); - header("X-JSON: ".$json->encode($datas)); - exit; - } + // Décommenter pour bloquer l'envoi de flotte a toute personne non admin + // if (empty($config['flottes']) && $SESS->level <= 1) { + // $datas = array( + // 'root' => array( + // 'destination' => '::', + // 'temps' => '-', + // 'deblok' => 'Les flottes sont désactivés pour le moment.', + // 'conso' => '-', + // 'tactique' => '', + // 'places' => '' + // ) + // ); + // header("X-JSON: ".$json->encode($datas)); + // exit; + // } $destin = gpc('fav_dest', 'post'); -- 2.45.2 From e4219f493d267656a4408ba34dcc6964ecdf0ed9 Mon Sep 17 00:00:00 2001 From: Nigel Sheldon Date: Wed, 27 Jan 2021 11:25:27 +0100 Subject: [PATCH 02/15] =?UTF-8?q?Mise=20=C3=A0=20jour=20des=20ID=20de=20la?= =?UTF-8?q?=20liste=20des=20missions,=20pour=20que=20=C3=A7a=20corresponde?= =?UTF-8?q?=20=C3=A0=20la=20r=C3=A9alit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/ajax_flotte.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/ajax_flotte.php b/htdocs/ajax_flotte.php index a2ae9ed..ebbb0e4 100644 --- a/htdocs/ajax_flotte.php +++ b/htdocs/ajax_flotte.php @@ -108,7 +108,8 @@ if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connecte $places -= ($met+$cri+$hyd); } $tactique = ''; - if ($_POST['mission'] == '1') { + // si la mission est une mission d'attaque + if ($_POST['mission'] == '3') { $tactique = '::', - // 'temps' => '-', - // 'deblok' => 'Les flottes sont désactivés pour le moment.', - // 'conso' => '-', - // 'tactique' => '', - // 'places' => '' - // ) - // ); - // header("X-JSON: ".$json->encode($datas)); - // exit; - // } + if (empty($VAR['flottes']) && $SESS->level <= 1) { + $datas = array( + 'root' => array( + 'destination' => '::', + 'temps' => '-', + 'deblok' => 'Les flottes sont désactivés pour le moment.', + 'conso' => '-', + 'tactique' => '', + 'places' => '' + ) + ); + header("X-JSON: ".$json->encode($datas)); + exit; + } $destin = gpc('fav_dest', 'post'); diff --git a/onyx2/include/Class/Donnees/spatial.php b/onyx2/include/Class/Donnees/spatial.php index 668845d..f7c32da 100644 --- a/onyx2/include/Class/Donnees/spatial.php +++ b/onyx2/include/Class/Donnees/spatial.php @@ -1528,5 +1528,4 @@ class dSpatial implements Donnees //On tient compte des bonus return $armature; } - } diff --git a/onyx2/include/Class/flotte.php b/onyx2/include/Class/flotte.php index ed6457d..2753972 100644 --- a/onyx2/include/Class/flotte.php +++ b/onyx2/include/Class/flotte.php @@ -562,6 +562,26 @@ class Flotte } + public function attaquer() + { + //Si la planète d'arrivé n'est pas chargée, on charge les planètes + if (is_numeric($this->end_planete)) { + $this->load_planete(); + } + + //On charge la classe des combats + + //On réalise le combat + + //On envoit le résultat + + //On update la flotte avec les pertes et gains + + //On dis à la flotte de rentrer + $this->statut = 1; + $this->addModifFlotte("statut"); + } + public function espionner() { //Si la planète d'arrivé n'est pas chargée, on charge les planètes diff --git a/onyx2/include/game/flottes/restaure.php b/onyx2/include/game/flottes/restaure.php index bc4d865..f28d72d 100644 --- a/onyx2/include/game/flottes/restaure.php +++ b/onyx2/include/game/flottes/restaure.php @@ -23,7 +23,8 @@ if ($SESS->values["prepFlottes"][$idPrep]['type'] == 1) { if ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'][2]) { $missions[2] = "Coloniser"; } -if ($planete->technologies[7]& 16 && $VAR["attaques"]) { +//Stratégie millitaire est nécessaire +if ($planete->technologies[3]& 4096 && $VAR["attaques"]) { $missions[3] = "Attaquer"; } if ($SESS->values["prepFlottes"][$idPrep]['type'] == 1 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][3]) { -- 2.45.2