diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index 580d46cb..43ef7980 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -37,7 +37,7 @@ $vues['enigmePage'] = 'View/src/pages/Enigme/EnigmePage.php'; $BUFFER_SIZE = 1024; $serverAdress = "82.165.180.114"; $port= "3000"; -$playerNumberPerGame=3; +$playerNumberPerGame = 3; //modules $modules = 'node_module/'; diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index 7098f692..e7d3368c 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -173,6 +173,12 @@ class UserController { try { global $rep, $vues, $error; + $model = new UserModel(); + $utilisateur = $_SESSION['utilisateur']; + $reponse = $model->addToQueue($utilisateur->getEmail()); + $etat = $reponse[1]; + $idPartie = $reponse[0]; + $lesJoueurs = $model->getLesJoueurs($idPartie); require($rep . $vues['queue']); } catch (Exception $e) { $error = $e->getMessage(); @@ -183,16 +189,10 @@ class UserController try { global $rep, $vues, $error; $model = new UserModel(); - $utilisateur = $_SESSION['utilisateur']; - $reponse = $model->addToQueue($utilisateur->getEmail()); - $etat = $reponse[1]; - echo $etat. " etat\n"; - $idPartie = $reponse[0]; - echo $idPartie . " idPartie\n"; + $etat = $_GET['etat']; + $idPartie = $_GET['idPartie']; if($etat == 1){ // header("Location: index.php?action=launchGame"); - $lesJoeurs = $model->getLesJoueurs($idPartie); - sleep(30); header("Location: index.php?action=goToPresentation"); } else{ diff --git a/WEB/View/src/pages/Multijoueur/FileAttente.php b/WEB/View/src/pages/Multijoueur/FileAttente.php index ff335743..c7497ba9 100644 --- a/WEB/View/src/pages/Multijoueur/FileAttente.php +++ b/WEB/View/src/pages/Multijoueur/FileAttente.php @@ -42,46 +42,56 @@
- ' . $_SESSION['utilisateur']->getPseudo().'

'; ?> + ".$lesJoeurs[0]->getPseudo()."

"; + } + else{ + echo "

Player 1

"; + } + ?>
- ' . $lesJoeurs[1]->getPseudo().'

'; - } - else{ - echo '

Player 2

'; - } + + ".$lesJoueurs[1]->getPseudo()."

"; + } + else{ + echo "

Player 2

"; + } ?>
- ' . $lesJoeurs[2]->getPseudo().'

'; - } - else{ - echo '

Player 2

'; - } + + ".$lesJoueurs[2]->getPseudo()."

"; + } + else{ + echo "

Player 3

"; + } ?>
- ' . $lesJoeurs[3]->getPseudo().'

'; - } - else{ - echo '

Player 2

'; - } + + ".$lesJoueurs[3]->getPseudo()."

"; + } + else{ + echo "

Player 3

"; + } ?>