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