From 03a05b7223cee91ffba7ad731897ec8e6143e384 Mon Sep 17 00:00:00 2001 From: johan Date: Tue, 3 Jan 2023 17:29:40 +0100 Subject: [PATCH] petites corrections --- WEB/Controller/UserController.php | 4 ++++ WEB/Model/UserModel.php | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index a2c28017..eab6b1cb 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -224,6 +224,10 @@ class UserController $model->launchGame(); require($rep . $vues['partie']); } + catch (Exception $e) { + $error = $e->getMessage(); + require($rep . $vues['erreur']); + } } public function logout() { diff --git a/WEB/Model/UserModel.php b/WEB/Model/UserModel.php index 9ed671a0..db08600e 100644 --- a/WEB/Model/UserModel.php +++ b/WEB/Model/UserModel.php @@ -26,7 +26,10 @@ class UserModel { echo '1'; if ($this->utilisateur_gateway->isAlreadyInqueue($_SESSION['utilisateur'])) { - return; + if($this->utilisateur_gateway->queueFilled()) + { + $_REQUEST['action']='launchGame'; + } } echo '2'; if (!$this->partie_gateway->partieInQueueExists()) {