test
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent 4294b5b021
commit 90a799498b

@ -58,6 +58,9 @@ class UserController
case "getGameEtat":
$this->getGameEtat();
break;
case "endGame":
$this->endGame();
break;
default:
$error = "Action non valide";
require($rep . $vues['erreur']);
@ -345,12 +348,15 @@ class UserController
}
}
// A appeler après avoir vérifié que la partie est finie
public function endGame(){
try {
global $rep, $vues, $error;
$model = new UserModel();
$idPartie = $_SESSION['idPartie'];
$etat = $model->getEtatPartie($idPartie);
if ($etat != 2){
throw new Exception("La partie n'est pas terminée");
}
$lesInfos = $model->getEndGameInfo($idPartie);
$model->endGame($idPartie);
require ($rep . $vues['gameEnd']);

Loading…
Cancel
Save