diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index e422dc44..700dc2c5 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -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'; diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index 7a8226f1..f45dc2c7 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.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 ' - - '; + $io = get_io(); + $io->to($userGroup)->emit("launchGame"); } catch (Exception $e) { $error = $e->getMessage(); require($rep . $vues['erreur']); diff --git a/WEB/View/assets/img/BGPres.png b/WEB/View/assets/img/BGPres.png index e5b7750b..89fb9820 100644 Binary files a/WEB/View/assets/img/BGPres.png and b/WEB/View/assets/img/BGPres.png differ diff --git a/WEB/View/src/JS/cesarEncrypt.js b/WEB/View/src/JS/CesarEncrypt.js similarity index 100% rename from WEB/View/src/JS/cesarEncrypt.js rename to WEB/View/src/JS/CesarEncrypt.js diff --git a/WEB/server.js b/WEB/server.js index 95726aa4..9622cdac 100644 --- a/WEB/server.js +++ b/WEB/server.js @@ -20,7 +20,9 @@ io.on('launchGame' , function () { location.reload(); }) module.exports = { - io : io -}; + get_io: function() { + return io; + } + }; console.log('iolisten'); \ No newline at end of file