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

ServeurDeTest
johan 2 years ago
parent 1cd7072610
commit 9d0bf46def

@ -66,7 +66,8 @@ class PartieGateway
$query = "SELECT p.id
FROM Partie p, Participer pa
WHERE pa.etat=0
AND pa.partie=p.id";
AND pa.partie=p.id
LIMIT 1";
$this->con->executeQuery($query);
$results = $this->con->getResults();
return $results[0]['id'];

@ -205,11 +205,9 @@ class UserController
require($rep . $vues['queue']);
$model = new UserModel();
$model->addToQueue();
$usergroup = $model->findUserGroup();
echo
'<script>
socket.on("launchGame", () => {
launchGame();
});
io.to($userGroup).emit("launchGame");
<script/>';
} catch (Exception $e) {

@ -57,6 +57,10 @@ class UserModel
</script>';
}
public function findUserGroup() : int {
return $this->partie_gateway->findPartieInQueue();
}
public function launchGame()
{
$this->utilisateur_gateway->launchGame($_SESSION['utilisateur']);

Loading…
Cancel
Save