diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index 369324d6..c2c0e7af 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -114,7 +114,8 @@ class UserController $model = new UserModel(); $model->addToQueue(); $userGroup = $model->findUserGroup(); - $io = get_io(); + $io = require '/usr/local/lib/node_modules/socket.io-client'; + $socket = $io('http://82.165.180.114:3000'); $io->to($userGroup)->emit("launchGame"); } catch (Exception $e) { $error = $e->getMessage(); diff --git a/WEB/server.js b/WEB/server.js index 0ed47547..aa174cd1 100644 --- a/WEB/server.js +++ b/WEB/server.js @@ -1,5 +1,3 @@ -//const io = require('socket.io')('http://localhost:3000'); -//modules module = '/usr/local/lib/node_modules/'; console.log('module'); const express = require(module + "express"); @@ -18,10 +16,4 @@ console.log('ioOnConnection'); io.on('launchGame' , function () { console.log('launch the game'); location.reload(); -}) - -module.exports = { - io: io - }; - -console.log('iolisten'); \ No newline at end of file +}) \ No newline at end of file