Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
continuous-integration/drone/push Build is failing Details

ServeurDeTest
Noé GARNIER 2 years ago
commit 89bb5e8c24

@ -18,7 +18,7 @@ steps:
host: sancy.iut.uca.fr
username: lafourcade
target: public_html/Scripted
source: index.php ./View ./Model
source: View/* index.php
key:
from_secret: DEPLOY_KEY
secrets:

@ -1,113 +1,106 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scripted</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0"
/>
<link rel="stylesheet" href="./View/src/CSS/Main2.css" />
<link rel="stylesheet" href="./View/src/CSS/FirstTest.css">
</head>
<body>
<div>
<div id="imgMain" style="background: #050E15;">
<div class="grid">
<div class="m-3">
<a class="btn" href="index.php?action=quitQueue">
<span>Quitter</span>
</a>
</div>
<div class="row">
<h2 class="text-center mt-3 mr-5" style="color: #00CCFF; font-weight: 1000;font-style: italic;">SCRIPT</h2>
<h2 class="text-center ml-5" style="color: #D400D4; font-weight:bold ; font-size:4em;font-style: italic;">RUSH</h2>
</div>
<div class="row pt-5">
<h3 class="text-center" id="waiting">Waiting for Coders...</h3>
</div>
<div class="row d-flex ">
<div class="col d-flex flex-column align-items-center">
<div style="background-color: red; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player1">Player 1</p>
</div>
<div class="col d-flex flex-column align-items-center">
<div style="background-color: blue; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player2">Player 2</p>
</div>
<div class="col d-flex flex-column align-items-center">
<div style="background-color: yellow; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player3">Player 3</p>
</div>
<div class="col d-flex flex-column align-items-center">
<div style="background-color: green; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player4">Player 4</p>
</div>
</div>
</div>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scripted</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css" integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js" integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
<link rel="stylesheet" href="./View/src/CSS/Main2.css" />
<link rel="stylesheet" href="./View/src/CSS/FirstTest.css">
</head>
<body>
<div id="imgMain" style="background: #050E15;">
<div class="container-fluid">
<div class="row p-3">
<a class="btn" href="index.php?action=quitQueue">
<span>Quitter</span>
</a>
</div>
<div class="row m-0">
<h2 class="text-center mt-3 pr-5" style="color: #00CCFF; font-weight: 1000;font-style: italic;">SCRIPT</h2>
<h2 class="text-center pl-5" style="color: #D400D4; font-weight:bold ; font-size:4em;font-style: italic;">RUSH</h2>
</div>
<div class="row py-5 m-0">
<h3 class="text-center" id="waiting">Waiting for Coders...</h3>
</div>
<div class="row py-5 d-flex m-0">
<div class="col d-flex flex-column align-items-center">
<div style="background-color: red; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player1">Player 1</p>
</div>
<div class="col d-flex flex-column align-items-center">
<div style="background-color: blue; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player2">Player 2</p>
</div>
<div class="col d-flex flex-column align-items-center">
<div style="background-color: yellow; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player3">Player 3</p>
</div>
<div class="col d-flex flex-column align-items-center">
<div style="background-color: green; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player4">Player 4</p>
</div>
</div>
</div>
</body>
<script>
function checkIsReady() {
console.log("checkIsReady");
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=waiting', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
console.log(xhr.responseText);
if (xhr.responseText == "1") {
window.location.href = 'http://82.165.180.114/Scripted/index.php?action=goToGame&idPartie=' + <?php echo $_SESSION['idPartie'] ?> + '&index=1'
}
};
xhr.send(null);
}
function getPlayer() {
console.log("getPlayer");
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersPseudo', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
var players = JSON.parse(xhr.responseText);
if (players[0] != null) {
document.getElementById("player1").innerHTML = players[0];
}
if (players[1] != null) {
document.getElementById("player2").innerHTML = players[1];
}
if (players[2] != null) {
document.getElementById("player3").innerHTML = players[2];
}
if (players[3] != null) {
document.getElementById("player4").innerHTML = players[3];
}
};
xhr.send(null);
}
window.addEventListener("load", waiting);
function waiting(){
var countdownTimer = setInterval('checkIsReady()', 1000);
setInterval('getPlayer()', 500);
}
</script>
</div>
</body>
<script>
function checkIsReady() {
console.log("checkIsReady");
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=waiting', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function() {
console.log(xhr.responseText);
if (xhr.responseText == "1") {
window.location.href = 'http://82.165.180.114/Scripted/index.php?action=goToGame&idPartie=' + <?php echo $_SESSION['idPartie'] ?> + '&index=1'
}
};
xhr.send(null);
}
function getPlayer() {
console.log("getPlayer");
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersPseudo', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function() {
var players = JSON.parse(xhr.responseText);
if (players[0] != null) {
document.getElementById("player1").innerHTML = players[0];
}
if (players[1] != null) {
document.getElementById("player2").innerHTML = players[1];
}
if (players[2] != null) {
document.getElementById("player3").innerHTML = players[2];
}
if (players[3] != null) {
document.getElementById("player4").innerHTML = players[3];
}
};
xhr.send(null);
}
window.addEventListener("load", waiting);
function waiting() {
var countdownTimer = setInterval('checkIsReady()', 1000);
setInterval('getPlayer()', 500);
}
</script>
</html>

@ -1,67 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scripted</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0"
/>
<link rel="stylesheet" href="./View/src/CSS/Main2.css" />
<link rel="stylesheet" href="./View/src/CSS/FirstTest.css">
</head>
<body>
<div>
<div id="imgMain" style="background: #050E15;">
<div class="grid">
<div class="row">
<h2 class="text-center mt-3 mr-5" style="color: #00CCFF; font-weight: 1000;font-style: italic;">SCRIPT</h2>
<h2 class="text-center ml-5" style="color: #D400D4; font-weight:bold ; font-size:4em;font-style: italic;">RUSH</h2>
</div>
<div class="row pt-5">
<p class="text-center">Bienvenue dans le mode <b>ScriptRush</b> ! Tu es ici dans le mode multijoeur de <b>Scripted</b>.
Dans ce mode tu vas pouvoir affronter d'autres joueur et tenter de gagner le plus de points possible. Pour cela tu vas devoir
résoudre le plus d'énigme de possible en un temps imparti.
Si c'est ta première venue je te conseile de jeter un oeil au mode <b>CodeQuest</b> avant d'aller plus loin.
Pour les plus témaire je vous laisse cliquer sur <b>Lancer</b> pour trouver des adversaire.
Bonne chance et que le meilleur gagne !</p>
</div>
<div class="row pt-5">
<h3 class="text-center" id="waiting">Ready ?</h3>
</div>
<div class="row">
<div class="d-flex justify-content-center ltext-center" style="cursor: pointer; height: 20%">
<div class="m-3">
<a class="btn" href="index.php?action=addToQueue">
<span>LANCER</span>
</a>
</div>
<div class="m-3">
<a class="btn" href="index.php?action=goToHome">
<span>RETOUR</span>
</a>
</div>
</div>
</div>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scripted</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css" integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js" integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
<link rel="stylesheet" href="./View/src/CSS/Main2.css" />
<link rel="stylesheet" href="./View/src/CSS/FirstTest.css">
</head>
<body>
<div id="imgMain" style="background: #050E15;">
<div class="container-fluid">
<div class="row m-0">
<h2 class="text-center mt-3 pr-5" style="color: #00CCFF; font-weight: 1000; font-style: italic;">SCRIPT</h2>
<h2 class="text-center pl-5" style="color: #D400D4; font-weight:bold; font-size:4em; font-style: italic;">RUSH</h2>
</div>
<div class="row pt-5 px-3 m-0">
<p class="text-center">Bienvenue dans le mode <b>ScriptRush</b> ! Tu es ici dans le mode multijoueur de <b>Scripted</b>.
Dans ce mode, tu vas pouvoir affronter d'autres joueurs et tenter de gagner le plus de points possible.
Pour cela, tu vas devoir résoudre le plus d'énigme de possible en un temps imparti.
Si c'est ta première venue, je te conseille de jeter un œil au mode <b>CodeQuest</b> avant d'aller plus loin.
Pour les plus téméraires, je vous laisse cliquer sur <b>Lancer</b> pour trouver des adversaires.
Bonne chance et que le meilleur gagne !</p>
</div>
<div class="row pt-5 m-0">
<h3 class="text-center" id="waiting">Ready ?</h3>
</div>
<div class="row m-0">
<div class="d-flex justify-content-center ltext-center" style="cursor: pointer; height: 20%">
<div class="m-3">
<a class="btn" href="index.php?action=addToQueue">
<span>LANCER</span>
</a>
</div>
<div class="m-3">
<a class="btn" href="index.php?action=goToHome">
<span>RETOUR</span>
</a>
</div>
</div>
</div>
</div>
</body>
</div>
</body>
</html>

@ -5,8 +5,7 @@
<title>Scripted</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
</head>
<body>
@ -22,10 +21,10 @@
<p>Votre score est de : <?php echo $points ?> points.</p>
<p>Temps restant avant la fin de la partie :</p>
<?php
$end_time = $dateDebut->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;
$end_time = $dateDebut->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;
?>
<div id="countdown"></div>
</div>
@ -37,7 +36,7 @@
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getGameEtat', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
xhr.onload = function() {
if (xhr.responseText == "2") {
window.location.href = 'http://82.165.180.114/Scripted/index.php?action=endGame'
}
@ -45,13 +44,14 @@
xhr.send(null);
}
var seconds = <?php echo $remaining_seconds; ?>;
function countdown() {
checkIsEnd();
var days = Math.floor(seconds/24/60/60);
var hoursLeft = Math.floor((seconds) - (days*86400));
var hours = Math.floor(hoursLeft/3600);
var minutesLeft = Math.floor((hoursLeft) - (hours*3600));
var minutes = Math.floor(minutesLeft/60);
var days = Math.floor(seconds / 24 / 60 / 60);
var hoursLeft = Math.floor((seconds) - (days * 86400));
var hours = Math.floor(hoursLeft / 3600);
var minutesLeft = Math.floor((hoursLeft) - (hours * 3600));
var minutes = Math.floor(minutesLeft / 60);
var remainingSeconds = seconds % 60;
if (remainingSeconds < 10) {
remainingSeconds = "0" + remainingSeconds;
@ -67,13 +67,11 @@
var countdownTimer = setInterval('countdown()', 1000);
</script>
<!-- Bootstrap JavaScript Libraries -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js"
integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous">
</script>
</body>
</html>
Loading…
Cancel
Save