diff --git a/WEB/Client/Client.php b/WEB/Client/Client.php index 1d413816..575ccb91 100644 --- a/WEB/Client/Client.php +++ b/WEB/Client/Client.php @@ -40,8 +40,10 @@ class Client echo "socket_write a réussi.\n"; } $response = ""; - while (strcmp($response, "launchGame") != 0) { + $i = 0; + while ($i != 2) { $response = socket_read($socket, $BUFFER_SIZE); + echo $response; if ($response != false) { echo "socket_read a réussi.\n"; if (strcmp($response, "refreshQueue") == 0) { @@ -53,6 +55,8 @@ class Client echo "socket_read a échoué : " . socket_strerror(socket_last_error()) . "\n"; break; } + sleep(5); + $i++; } } } diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index 37a0878d..5755ed37 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -173,9 +173,9 @@ class UserController $model = new UserModel(); // $model->addToQueue(); $client = Client::getInstance(); - require($rep . $vues['queue']); // new Queuing(); $client->Queuing(); + require($rep . $vues['queue']); } catch (Exception $e) { $error = $e->getMessage(); require($rep . $vues['erreur']);