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 cc90d0d202

@ -38,6 +38,8 @@ $vues['chuckNorris'] = 'View/src/pages/Enigme/ChuckNorris.html';
$vues['hanoi'] = 'View/src/pages/Enigme/Hanoi.html';
$vues['trianglePascal'] = 'View/src/pages/Enigme/TrianglePascal.html';
$vues['doubleElement'] = 'View/src/pages/Enigme/DoubleElement.html';
// Server
$server = 'server.js';
//Error
$vues['erreur'] = 'View/src/pages/Erreur.php';

@ -5,9 +5,10 @@ class UserController
function __construct()
{
try {
global $dsn, $rep, $vues, $error;
global $dsn, $rep, $vues, $error, $server;
$action = $_REQUEST['action'];
echo $action;
require $rep . $server;
switch ($action) {
case NULL:
$this->goToHome();
@ -206,12 +207,8 @@ class UserController
$model = new UserModel();
$model->addToQueue();
$userGroup = $model->findUserGroup();
echo '
<script>
const socket = io();
io.to("'.$userGroup.'").emit("launchGame", {});
</script>
';
$io = get_io();
$io->to($userGroup)->emit("launchGame");
} catch (Exception $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 2.9 MiB

@ -20,7 +20,9 @@ io.on('launchGame' , function () {
location.reload();
})
module.exports = {
io : io
};
get_io: function() {
return io;
}
};
console.log('iolisten');
Loading…
Cancel
Save