fix : score if player not connected
continuous-integration/drone/push Build is passing Details

pull/37/head
Yvan CALATAYUD 1 year ago
parent 5eb99e060f
commit c2217039c1

@ -282,17 +282,13 @@ class ControllerUser
'idplayer' => $_SESSION["idPlayerConnected"],
'maxscore' => $_SESSION["Score"]
];
// var_dump($jouer);
// var_dump($this->mdPlayer->verifyJouer($jouer));
// var_dump($this->mdPlayer->getMaxScoreByPlayerAndChapter($jouer));
// var_dump($jouer['maxscore']);
// var_dump($jouer['maxscore'] <= $this->mdPlayer->getMaxScoreByPlayerAndChapter($jouer));
// var_dump($jouer['maxscore'] >= $this->mdPlayer->getMaxScoreByPlayerAndChapter($jouer));
if ($this->mdPlayer->verifyJouer($jouer) == null) {
$this->mdPlayer->addJouer($jouer);
} else if ($jouer['maxscore'] <= $this->mdPlayer->getMaxScoreByPlayerAndChapter($jouer)) {
$this->mdPlayer->updateJouer($jouer);
if($_SESSION["idPlayerConnected"] != null){
if ($this->mdPlayer->verifyJouer($jouer) == null) {
$this->mdPlayer->addJouer($jouer);
} else if ($jouer['maxscore'] <= $this->mdPlayer->getMaxScoreByPlayerAndChapter($jouer)) {
$this->mdPlayer->updateJouer($jouer);
}
}
echo $this->twig->render($this->vues["viewScore"], [
@ -344,10 +340,12 @@ class ControllerUser
'maxscore' => $_SESSION["Score"]
];
if ($this->mdPlayer->verifyJouer($jouer) == null) {
$this->mdPlayer->addJouer($jouer);
} else if ($jouer['maxscore'] <= $this->mdPlayer->getMaxScoreByPlayerAndChapter($jouer)) {
$this->mdPlayer->updateJouer($jouer);
if($_SESSION["idPlayerConnected"] != null){
if ($this->mdPlayer->verifyJouer($jouer) == null) {
$this->mdPlayer->addJouer($jouer);
} else if ($jouer['maxscore'] <= $this->mdPlayer->getMaxScoreByPlayerAndChapter($jouer)) {
$this->mdPlayer->updateJouer($jouer);
}
}
echo $this->twig->render($this->vues["viewScore"], [

Loading…
Cancel
Save