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 host: sancy.iut.uca.fr
username: lafourcade username: lafourcade
target: public_html/Scripted target: public_html/Scripted
source: index.php ./View ./Model source: View/* index.php
key: key:
from_secret: DEPLOY_KEY from_secret: DEPLOY_KEY
secrets: secrets:

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

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

@ -5,8 +5,7 @@
<title>Scripted</title> <title>Scripted</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <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" <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">
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
</head> </head>
<body> <body>
@ -22,7 +21,7 @@
<p>Votre score est de : <?php echo $points ?> points.</p> <p>Votre score est de : <?php echo $points ?> points.</p>
<p>Temps restant avant la fin de la partie :</p> <p>Temps restant avant la fin de la partie :</p>
<?php <?php
$end_time = $dateDebut->modify('+'. $_SESSION['tpsMaxPartie'] .'seconds'); $end_time = $dateDebut->modify('+' . $_SESSION['tpsMaxPartie'] . 'seconds');
$now = new DateTime(); $now = new DateTime();
$interval = $now->diff($end_time); $interval = $now->diff($end_time);
$remaining_seconds = $interval->days * 24 * 60 * 60 + $interval->h * 60 * 60 + $interval->i * 60 + $interval->s; $remaining_seconds = $interval->days * 24 * 60 * 60 + $interval->h * 60 * 60 + $interval->i * 60 + $interval->s;
@ -37,7 +36,7 @@
xhr.open('POST', 'http://82.165.180.114/Scripted/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/index.php?action=endGame' window.location.href = 'http://82.165.180.114/Scripted/index.php?action=endGame'
} }
@ -45,13 +44,14 @@
xhr.send(null); xhr.send(null);
} }
var seconds = <?php echo $remaining_seconds; ?>; var seconds = <?php echo $remaining_seconds; ?>;
function countdown() { function countdown() {
checkIsEnd(); checkIsEnd();
var days = Math.floor(seconds/24/60/60); var days = Math.floor(seconds / 24 / 60 / 60);
var hoursLeft = Math.floor((seconds) - (days*86400)); var hoursLeft = Math.floor((seconds) - (days * 86400));
var hours = Math.floor(hoursLeft/3600); var hours = Math.floor(hoursLeft / 3600);
var minutesLeft = Math.floor((hoursLeft) - (hours*3600)); var minutesLeft = Math.floor((hoursLeft) - (hours * 3600));
var minutes = Math.floor(minutesLeft/60); var minutes = Math.floor(minutesLeft / 60);
var remainingSeconds = seconds % 60; var remainingSeconds = seconds % 60;
if (remainingSeconds < 10) { if (remainingSeconds < 10) {
remainingSeconds = "0" + remainingSeconds; remainingSeconds = "0" + remainingSeconds;
@ -67,12 +67,10 @@
var countdownTimer = setInterval('countdown()', 1000); var countdownTimer = setInterval('countdown()', 1000);
</script> </script>
<!-- Bootstrap JavaScript Libraries --> <!-- Bootstrap JavaScript Libraries -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous">
integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous">
</script> </script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous">
integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous">
</script> </script>
</body> </body>

Loading…
Cancel
Save