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['hanoi'] = 'View/src/pages/Enigme/Hanoi.html';
$vues['trianglePascal'] = 'View/src/pages/Enigme/TrianglePascal.html'; $vues['trianglePascal'] = 'View/src/pages/Enigme/TrianglePascal.html';
$vues['doubleElement'] = 'View/src/pages/Enigme/DoubleElement.html'; $vues['doubleElement'] = 'View/src/pages/Enigme/DoubleElement.html';
// Server
$server = 'server.js';
//Error //Error
$vues['erreur'] = 'View/src/pages/Erreur.php'; $vues['erreur'] = 'View/src/pages/Erreur.php';

@ -5,9 +5,10 @@ class UserController
function __construct() function __construct()
{ {
try { try {
global $dsn, $rep, $vues, $error; global $dsn, $rep, $vues, $error, $server;
$action = $_REQUEST['action']; $action = $_REQUEST['action'];
echo $action; echo $action;
require $rep . $server;
switch ($action) { switch ($action) {
case NULL: case NULL:
$this->goToHome(); $this->goToHome();
@ -206,12 +207,8 @@ class UserController
$model = new UserModel(); $model = new UserModel();
$model->addToQueue(); $model->addToQueue();
$userGroup = $model->findUserGroup(); $userGroup = $model->findUserGroup();
echo ' $io = get_io();
<script> $io->to($userGroup)->emit("launchGame");
const socket = io();
io.to("'.$userGroup.'").emit("launchGame", {});
</script>
';
} catch (Exception $e) { } catch (Exception $e) {
$error = $e->getMessage(); $error = $e->getMessage();
require($rep . $vues['erreur']); 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(); location.reload();
}) })
module.exports = { module.exports = {
io : io get_io: function() {
return io;
}
}; };
console.log('iolisten'); console.log('iolisten');
Loading…
Cancel
Save