Maj après suppression de WEB

ServeurDeTest
Noé GARNIER 2 years ago
parent 322f946f49
commit 88d8ac331d

@ -132,7 +132,7 @@ function displayHelp() {
function saveCode() { function saveCode() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
// xhr.open('POST', 'http://localhost/Scripted/WEB/index.php?action=saveCode', true); // xhr.open('POST', 'http://localhost/Scripted/WEB/index.php?action=saveCode', true);
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=saveCode', true); xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=saveCode', true);
xhr.responseType = 'text'; xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () { xhr.onload = function () {

@ -132,7 +132,7 @@ function run() {
function saveCode() { function saveCode() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
// xhr.open('POST', 'http://localhost/Scripted/WEB/index.php?action=saveCodeInCookie', true); // xhr.open('POST', 'http://localhost/Scripted/WEB/index.php?action=saveCodeInCookie', true);
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=saveCodeInCookie', true); xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=saveCodeInCookie', true);
xhr.responseType = 'text'; xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () { xhr.onload = function () {

@ -70,13 +70,13 @@
function checkIsReady() { function checkIsReady() {
console.log("checkIsReady"); console.log("checkIsReady");
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=waiting', true); xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=waiting', true);
xhr.responseType = 'text'; xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () { xhr.onload = function () {
console.log(xhr.responseText); console.log(xhr.responseText);
if (xhr.responseText == "1") { if (xhr.responseText == "1") {
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=goToGame&idPartie=' + <?php echo $_SESSION['idPartie'] ?> + '&index=1' window.location.href = 'http://82.165.180.114/Scripted/index.php?action=goToGame&idPartie=' + <?php echo $_SESSION['idPartie'] ?> + '&index=1'
} }
}; };
xhr.send(null); xhr.send(null);

@ -34,12 +34,12 @@
<script> <script>
function checkIsEnd() { function checkIsEnd() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=getGameEtat', true); xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getGameEtat', true);
xhr.responseType = 'text'; xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () { xhr.onload = function () {
if (xhr.responseText == "2") { if (xhr.responseText == "2") {
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame' window.location.href = 'http://82.165.180.114/Scripted/index.php?action=endGame'
} }
}; };
xhr.send(null); xhr.send(null);
@ -59,7 +59,7 @@
document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes"; document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes";
if (seconds == 0) { if (seconds == 0) {
clearInterval(countdown); clearInterval(countdown);
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame' window.location.href = 'http://82.165.180.114/Scripted/index.php?action=endGame'
} else { } else {
seconds--; seconds--;
} }

@ -171,7 +171,7 @@
var enigmeId = '<?php echo $enigme->getIdEnigme(); ?>'; var enigmeId = '<?php echo $enigme->getIdEnigme(); ?>';
console.log("[Savecode]index : " + index, "[Savecode]enigmeId : " + enigmeId); console.log("[Savecode]index : " + index, "[Savecode]enigmeId : " + enigmeId);
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=saveCodeMulti', true); xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=saveCodeMulti', true);
xhr.responseType = 'text'; xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () { xhr.onload = function () {
@ -196,7 +196,7 @@
document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes"; document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes";
if (seconds == 0) { if (seconds == 0) {
clearInterval(countdown); clearInterval(countdown);
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame' window.location.href = 'http://82.165.180.114/Scripted/index.php?action=endGame'
} else { } else {
seconds--; seconds--;
} }

Loading…
Cancel
Save