From 97eb4435ef68b0e132213f20338426610d7ee859 Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Mon, 28 Nov 2022 16:20:14 +0100 Subject: [PATCH] =?UTF-8?q?il=20manque=20la=20cr=C3=A9ation=20d'une=20file?= =?UTF-8?q?=20d'attente=20de=20joueur,=20l'instantiation=20du=20temps=20d'?= =?UTF-8?q?une=20partie=20et=20la=20fa=C3=A7on=20de=20transformer=20le=20t?= =?UTF-8?q?emps=20en=20nombre=20flottant=20et=20la=20passation=20du=20temp?= =?UTF-8?q?s=20=C3=A0=20la=20base=20de=20donner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Controller/UserController.php | 13 +++++++++++++ WEB/Controller/UtilisateurGateway.php | 8 +++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index a1fc969e..bd6b4c53 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -36,6 +36,9 @@ class UserController case "goToEnigme": $this->goToEnigme(); break; + case "goToQueue": + $this->goToQueue(); + break; } } catch (PDOException $e) { @@ -164,4 +167,14 @@ class UserController require($rep.$vues['erreur']); } } + + private function goToQueue() { + global $rep, $vues, $error; + try { + require ($rep.$vues['Queue']); + }catch (Exception $e){ + $error = "404"; + require($rep.$vues['erreur']); + } + } } \ No newline at end of file diff --git a/WEB/Controller/UtilisateurGateway.php b/WEB/Controller/UtilisateurGateway.php index 7304eb32..e9c2ec01 100644 --- a/WEB/Controller/UtilisateurGateway.php +++ b/WEB/Controller/UtilisateurGateway.php @@ -83,7 +83,7 @@ class UtilisateurGateway return $estAdmin; } - public function resoudreEnigmeMulti(string $emailUtilisateur) + /*public function resoudreEnigmeMulti(string $emailUtilisateur) { $query="SELECT c.partie FROM Contenir WHERE c.joueur = :emailUtilisateur @@ -141,7 +141,8 @@ class UtilisateurGateway "partie" => array($idPartie, SQLITE3_INTEGER), "classement" => array($classement, SQLITE3_INTEGER), "index" => array($index, SQLITE3_INTEGER), - "temps" => array($emailUtilisateur, SQLITE3_FLOAT))); + "temps" => array($temps, SQLITE3_FLOAT))); + return array($emailUtilisateur => array($points,$temps)) } else { @@ -155,8 +156,9 @@ class UtilisateurGateway "enigme" => array($idEnigme, SQLITE3_INTEGER), "partie" => array($idPartie, SQLITE3_INTEGER), "classement" => array($classement, SQLITE3_INTEGER))); + return array(); } - } + }*/ public function passerEnigmeMulti(string $emailUtilisateur){ $query="SELECT p.partie FROM Participer