From c4a74ff1816fe199692e9a5ade57243ed8a4b1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Thu, 12 Jan 2023 07:00:46 +0100 Subject: [PATCH] =?UTF-8?q?test=20stoper=20partie=20si=20temps=20=C3=A9cou?= =?UTF-8?q?l=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Config/Config.php | 2 +- WEB/Controller/UserController.php | 8 ---- WEB/View/src/pages/Multijoueur/LobbyEnd.php | 2 +- WEB/View/src/pages/Multijoueur/Partie.php | 48 +++++++++++++-------- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index 20cb0f74..7f20e771 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -51,6 +51,6 @@ $error = ""; // Server $serverAdress = "82.165.180.114"; $playerNumberPerGame = 2; -$nbEnigmePerGame = 2; +$nbEnigmePerGame = 1; diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index 112a7d99..282812d5 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -221,14 +221,6 @@ class UserController $idPartie = $_SESSION['idPartie']; $etat = $model->getEtatPartie($idPartie); echo $etat; - // if($etat == 1){ - // // $model->launchGame($idPartie); - // $echo = "1"; - // // header("Location: index.php?action=goToGame&idPartie=" . $idPartie . "&index=1"); - // } - // else{ - // $echo = "0"; - // } } catch (Exception $e) { $error = $e->getMessage(); require($rep . $vues['erreur']); diff --git a/WEB/View/src/pages/Multijoueur/LobbyEnd.php b/WEB/View/src/pages/Multijoueur/LobbyEnd.php index 3670a72a..21808a02 100644 --- a/WEB/View/src/pages/Multijoueur/LobbyEnd.php +++ b/WEB/View/src/pages/Multijoueur/LobbyEnd.php @@ -59,7 +59,7 @@ document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes"; if (seconds == 0) { clearInterval(countdown); - document.getElementById('countdown').innerHTML = "Expired"; + window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame' } else { seconds--; } diff --git a/WEB/View/src/pages/Multijoueur/Partie.php b/WEB/View/src/pages/Multijoueur/Partie.php index 584cb44e..ebd45ddf 100644 --- a/WEB/View/src/pages/Multijoueur/Partie.php +++ b/WEB/View/src/pages/Multijoueur/Partie.php @@ -32,25 +32,16 @@
+
+

Temps restant :

+ modify('+'. $_SESSION['tpsMaxPartie'] .'seconds'); + $now = new DateTime(); + $interval = $now->diff($end_time); + $remaining_seconds = $interval->days * 24 * 60 * 60 + $interval->h * 60 * 60 + $interval->i * 60 + $interval->s; + ?> +
-