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); }