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

ServeurDeTest
Noé GARNIER 2 years ago
commit 18c452235b

@ -10,6 +10,7 @@ class UserController
global $dsn, $rep, $vues, $error; global $dsn, $rep, $vues, $error;
$model = new UserModel(); $model = new UserModel();
$action = $_REQUEST['action']; $action = $_REQUEST['action'];
//register_event_handler('add_to_queue',array($this,"onAddToQueue"));
switch ($action) { switch ($action) {
case NULL: case NULL:
$model->goToHome(); $model->goToHome();
@ -60,4 +61,13 @@ class UserController
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
public function onAddToQueue(){
$model=new UserModel;
$model->AddUserToQueueEvent();
$this->goToMulti();
}
/*public function goToMulti(){
}*/
} }

@ -127,15 +127,8 @@ class UserModel
} }
public function addToQueue(){ public function addToQueue(){
echo '1'; echo '1';
$userGroup=$this->utilisateur_gateway->findUsersInQueue();
if($this->utilisateur_gateway->isAlreadyInqueue($_SESSION['utilisateur'])) if($this->utilisateur_gateway->isAlreadyInqueue($_SESSION['utilisateur']))
{ {
if ($this->utilisateur_gateway->queueFilled())
{
echo "Partie is launched";
$this->utilisateur_gateway->launchGame($_SESSION['utilisateur']);
} else
$this->attente();
return; return;
} }
echo '2'; echo '2';
@ -156,16 +149,21 @@ class UserModel
} }
echo '8'; echo '8';
$this->utilisateur_gateway->addToQueue($_SESSION['utilisateur'],$partie); $this->utilisateur_gateway->addToQueue($_SESSION['utilisateur'],$partie);
echo '9'; $userGroup=$this->utilisateur_gateway->findUsersInQueue();
if ($this->utilisateur_gateway->queueFilled()) //trigger_event('add_to_queue',$userGroup);
}
<<<<<<< HEAD
public function AddUserToQueueEvent(){
$userGroup=$this->utilisateur_gateway->findUsersInQueue();
if($userGroup.count()>=4)
{ {
echo "Partie is launched"; $this->utilisateur_gateway->launchGame();
trigger_event('queue_filled',$user_group,$partie,$user_group);
$this->utilisateur_gateway->launchGame($_SESSION['utilisateur']);
} }
$this->attente();
} }
=======
>>>>>>> 146a4b62fc5bc2340e9c08c07650a6efb799c3fb
public function logout() public function logout()
{ {
$_SESSION['role'] = 'visitor'; $_SESSION['role'] = 'visitor';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

@ -13,10 +13,6 @@ body {
color: white; color: white;
scroll-behavior: smooth; scroll-behavior: smooth;
height: 100vh; height: 100vh;
background-position: center center;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-color: #050E15; background-color: #050E15;
} }

@ -4,19 +4,26 @@
color: white; color: white;
scroll-behavior: smooth; scroll-behavior: smooth;
height: 100vh; height: 100vh;
background-image: radial-gradient( background-image: url("../../assets/img/ImgMain.png");
circle, background-position: center center;
#312c42, background-attachment: fixed;
#2e2a3d, background-repeat: no-repeat;
#2a2738, background-size: cover;
#272434, background-color: #000;
#24222f, }
#22202c,
#1f1f29, #imgMain {
#1d1d26, background-image: url("../../assets/img/SecondMainBack.jpg");
#1b1b23, background-position: center center;
#191a21, background-attachment: fixed;
#17181e, background-repeat: no-repeat;
#15161c background-size: cover;
); display: block;
margin: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 85%;
height: 70%;
} }

@ -112,7 +112,7 @@ function check() {
/** /**
* It gets all the elements with the class name "help" and sets their display property to "flex". * It gets all the elements with the class name "help" and sets their display property to "block".
*/ */
function displayHelp() { function displayHelp() {
var help = document.getElementsByClassName("help"); var help = document.getElementsByClassName("help");

@ -23,8 +23,10 @@
<link rel="stylesheet" href="../CSS/Main2.css"> <link rel="stylesheet" href="../CSS/Main2.css">
</head> </head>
<body> <body>
<div class="container align-middle m-auto d-flex" style="background-image: url('../../assets/img/ImgMain.png')"> <div>
<div class="container-fluid" id="imgMain">
<i class="bi bi-list-nested" style="color:white; height:100px; width: 100px;"></i>
</div>
</div> </div>
</body> </body>
</html> </html>

16
package-lock.json generated

@ -6,7 +6,8 @@
"": { "": {
"dependencies": { "dependencies": {
"bootstrap": "^5.2.2", "bootstrap": "^5.2.2",
"bootstrap-icons": "^1.10.2" "bootstrap-icons": "^1.10.2",
"events": "^3.3.0"
} }
}, },
"node_modules/@popperjs/core": { "node_modules/@popperjs/core": {
@ -41,6 +42,14 @@
"version": "1.10.2", "version": "1.10.2",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.2.tgz", "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.2.tgz",
"integrity": "sha512-PTPYadRn1AMGr+QTSxe4ZCc+Wzv9DGZxbi3lNse/dajqV31n2/wl/7NX78ZpkvFgRNmH4ogdIQPQmxAfhEV6nA==" "integrity": "sha512-PTPYadRn1AMGr+QTSxe4ZCc+Wzv9DGZxbi3lNse/dajqV31n2/wl/7NX78ZpkvFgRNmH4ogdIQPQmxAfhEV6nA=="
},
"node_modules/events": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
"engines": {
"node": ">=0.8.x"
}
} }
}, },
"dependencies": { "dependencies": {
@ -60,6 +69,11 @@
"version": "1.10.2", "version": "1.10.2",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.2.tgz", "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.2.tgz",
"integrity": "sha512-PTPYadRn1AMGr+QTSxe4ZCc+Wzv9DGZxbi3lNse/dajqV31n2/wl/7NX78ZpkvFgRNmH4ogdIQPQmxAfhEV6nA==" "integrity": "sha512-PTPYadRn1AMGr+QTSxe4ZCc+Wzv9DGZxbi3lNse/dajqV31n2/wl/7NX78ZpkvFgRNmH4ogdIQPQmxAfhEV6nA=="
},
"events": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="
} }
} }
} }

@ -1,6 +1,7 @@
{ {
"dependencies": { "dependencies": {
"bootstrap": "^5.2.2", "bootstrap": "^5.2.2",
"bootstrap-icons": "^1.10.2" "bootstrap-icons": "^1.10.2",
"events": "^3.3.0"
} }
} }

Loading…
Cancel
Save