diff --git a/WEB/Controller/PartieGateway.php b/WEB/Controller/PartieGateway.php index a2104c37..a71716f3 100644 --- a/WEB/Controller/PartieGateway.php +++ b/WEB/Controller/PartieGateway.php @@ -266,6 +266,9 @@ class PartieGateway ); $results = $this->con->getResults(); foreach ($results as $row){ + if($row['etat'] == 2){ + return 2; + } if($row['etat'] == 1){ return 1; } diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index af80c93a..e6ea56bd 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -46,9 +46,6 @@ class UserController case "logout": $this->logout(); break; - case "launchGame": - $this->launchGame(); - break; case "saveCode": $this->saveCode(); break; @@ -58,6 +55,9 @@ class UserController case "saveCodeInCookie": $this->saveCodeInCookie(); break; + case "getGameEtat": + $this->getGameEtat(); + break; default: $error = "Action non valide"; require($rep . $vues['erreur']); @@ -331,6 +331,20 @@ class UserController } } + public function getGameEtat(){ + try { + global $rep, $vues, $error; + $model = new UserModel(); + $idPartie = $_SESSION['idPartie']; + $etat = $model->getEtatPartie($idPartie); + echo $etat; + } + catch (Exception $e) { + $error = $e->getMessage(); + require($rep . $vues['erreur']); + } + } + // A appeler après avoir vérifié que la partie est finie public function endGame(){ try { diff --git a/WEB/View/src/pages/Multijoueur/GameEnd.php b/WEB/View/src/pages/Multijoueur/GameEnd.php index dc1981ac..4ec81d12 100644 --- a/WEB/View/src/pages/Multijoueur/GameEnd.php +++ b/WEB/View/src/pages/Multijoueur/GameEnd.php @@ -23,7 +23,7 @@