ajout d'un export de la variable io pour déclencher un
continuous-integration/drone/push Build is passing Details

événement depuis le code php
ServeurDeTest
johan 2 years ago
parent 897c7ff13d
commit 5055040fe7

@ -206,6 +206,12 @@ class UserController
$model = new UserModel();
$model->addToQueue();
$userGroup = $model->findUserGroup();
echo '
<script>
const socket = io();
io.to("'.$userGroup.'").emit("launchGame", {});
</script>
';
} catch (Exception $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);

@ -19,4 +19,8 @@ io.on('launchGame' , function () {
console.log('launch the game');
location.reload();
})
module.exports = {
io : io
};
console.log('iolisten');
Loading…
Cancel
Save