From 67cf80ebe8e330596bd639e6b3a8eeb463e80684 Mon Sep 17 00:00:00 2001 From: "johan.lachenal" Date: Fri, 6 Jan 2023 17:29:44 +0100 Subject: [PATCH 1/2] changement mineure --- WEB/Metier/Partie.php | 2 +- WEB/Model/UserModel.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/WEB/Metier/Partie.php b/WEB/Metier/Partie.php index 53477d75..6564db67 100644 --- a/WEB/Metier/Partie.php +++ b/WEB/Metier/Partie.php @@ -12,7 +12,7 @@ class Partie * @param int $idPartie * @param array $datePartie */ - public function __construct(int $idPartie, array $listeEnigme) + public function __construct(int $idPartie = 0, array $listeEnigme) { $this->idPartie = $idPartie; $this->datePartie = new DateTime(); diff --git a/WEB/Model/UserModel.php b/WEB/Model/UserModel.php index c854da41..3c1ab9df 100644 --- a/WEB/Model/UserModel.php +++ b/WEB/Model/UserModel.php @@ -27,7 +27,6 @@ class UserModel public function addToQueue() { echo '1'; - var_dump($this->utilisateur_gateway->isAlreadyInQueue($_SESSION['utilisateur'])); if ($this->utilisateur_gateway->isAlreadyInqueue($_SESSION['utilisateur'])) { var_dump($this->utilisateur_gateway->queueFilled()); if($this->utilisateur_gateway->queueFilled()) From b8b987cb30431727b29eaa528ea1dada175e5282 Mon Sep 17 00:00:00 2001 From: "johan.lachenal" Date: Fri, 6 Jan 2023 17:31:42 +0100 Subject: [PATCH 2/2] correction launchgame --- WEB/Controller/UtilisateurGateway.php | 2 +- WEB/Factory/PartieFactory.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB/Controller/UtilisateurGateway.php b/WEB/Controller/UtilisateurGateway.php index 64f7dac7..cb7b6bd2 100644 --- a/WEB/Controller/UtilisateurGateway.php +++ b/WEB/Controller/UtilisateurGateway.php @@ -118,7 +118,7 @@ class UtilisateurGateway return False; } - private function launchGame(Utilisateur $utilisateur){ + public function launchGame(Utilisateur $utilisateur){ $query = "UPDATE Participer SET etat=1 WHERE etat=0 AND utilisateur=:utilisateur"; $this->con->executeQuery($query,array( 'utilisateur' => array($utilisateur->getEmail(),SQLITE3_TEXT))); diff --git a/WEB/Factory/PartieFactory.php b/WEB/Factory/PartieFactory.php index ceaf1ef0..6fb85ea6 100644 --- a/WEB/Factory/PartieFactory.php +++ b/WEB/Factory/PartieFactory.php @@ -12,7 +12,7 @@ class PartieFactory{ { $randomNumber=$tabIndex[array_rand($tabIndex)]; $tabEnigmePartie[]=$tabEnigme[$randomNumber]; - $TempsResolutionPartie+=$tabEnigme[$randomNumber]->getTempsDeResolution(); + $tempsResolutionPartie+=$tabEnigme[$randomNumber]->getTempsDeResolution(); unset($tabIndex[$randomNumber]); } $partie=new Partie($newId,$tabEnigme);