From 0acee3ab4298de13325a545cdabc78b3b03aea5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Wed, 11 Jan 2023 20:08:55 +0100 Subject: [PATCH] =?UTF-8?q?4=20=C3=A8me=20essaie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/View/src/pages/Multijoueur/FileAttente.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/WEB/View/src/pages/Multijoueur/FileAttente.php b/WEB/View/src/pages/Multijoueur/FileAttente.php index d46e7ea8..e207b0a6 100644 --- a/WEB/View/src/pages/Multijoueur/FileAttente.php +++ b/WEB/View/src/pages/Multijoueur/FileAttente.php @@ -59,7 +59,7 @@
@@ -81,6 +81,16 @@ document.getElementsByClassName("btn").style.display = "none" } + function addToQueue(){ + var xhr = new XMLHttpRequest(); + xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=addToQueue', true); + xhr.responseType = 'text'; + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + xhr.onload = function () { + }; + xhr.send(null); + } + function checkIsReady() { var xhr = new XMLHttpRequest(); xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=waiting', true); @@ -93,8 +103,10 @@ }; xhr.send(null); } + function waiting(){ displayWaiting(); + addToQueue(); var countdownTimer = setInterval('checkIsReady()', 1000); }