test
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent 83f79700c2
commit 9bf6f40aa5

@ -37,6 +37,7 @@ $vues['modifOrdre'] = 'View/src/pages/Admin/ModifOrdre.php';
//Mulijoueur
$vues['partie'] = 'View/src/pages/Multijoueur/Partie.php';
$vues['queue'] = 'View/src/pages/Multijoueur/FileAttente.php';
$vues['lobby'] = 'View/src/pages/Multijoueur/Lobby.php';
$vues['lobbyEnd'] = 'View/src/pages/Multijoueur/LobbyEnd.php';
$vues['gameEnd'] = 'View/src/pages/Multijoueur/GameEnd.php';

@ -37,8 +37,8 @@ class UserController
case "enigmeMultiEnded":
$this->enigmeMultiEnded();
break;
case "goToQueue":
$this->goToQueue();
case "goToLobby":
$this->goToLobby();
break;
case "waiting":
$this->waiting();
@ -204,11 +204,11 @@ class UserController
require($rep . $vues['erreur']);
}
}
public function goToQueue()
public function goToLobby()
{
try {
global $rep, $vues, $error;
require($rep . $vues['queue']);
require($rep . $vues['lobby']);
} catch (Exception $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);
@ -241,6 +241,7 @@ class UserController
$utilisateur = $_SESSION['utilisateur'];
$idPartie = $model->addToQueue($utilisateur->getEmail());
$_SESSION['idPartie'] = $idPartie;
require($rep . $vues['queue']);
} catch (Exception $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);

@ -178,7 +178,7 @@
<a class="cssbuttons-io"
<?php
if (isset($_SESSION['role']) && $_SESSION['role'] == 'user' || isset($_SESSION['role']) && $_SESSION['role'] == 'admin'){
echo 'href="index.php?action=goToQueue"';
echo 'href="index.php?action=goToLobby"';
}
else{
echo 'href="index.php?action=goToLogin"';

@ -36,7 +36,7 @@
<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">Ready ?</h3>
<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">
@ -56,41 +56,12 @@
<p class="pt-3">Player 4</p>
</div>
</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="#" onclick="waiting()">
<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>
</div>
</div>
</body>
<script>
function displayWaiting(){
document.getElementById("waiting").innerHTML = "Waiting for Coders...";
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);
@ -103,11 +74,9 @@
};
xhr.send(null);
}
window.addEventListener("load", waiting);
function waiting(){
displayWaiting();
addToQueue();
var countdownTimer = setInterval('checkIsReady()', 1000);
var countdownTimer = setInterval('checkIsReady()', 1000);
}
</script>
</html>

@ -0,0 +1,80 @@
<!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">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Fuga magni voluptatibus, inventore asperiores reprehenderit laudantium possimus ut distinctio dignissimos laboriosam quia. Natus vero velit ut. Sint commodi perferendis aliquid asperiores.</p>
</div>
<div class="row pt-5">
<h3 class="text-center" id="waiting">Ready ?</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">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">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">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">Player 4</p>
</div>
</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=addToQueu">
<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>
</div>
</div>
</body>
</html>
Loading…
Cancel
Save