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()) {