diff --git a/WEB/Model/UserModel.php b/WEB/Model/UserModel.php index d4cae90c..f345eab4 100644 --- a/WEB/Model/UserModel.php +++ b/WEB/Model/UserModel.php @@ -106,11 +106,12 @@ class UserModel } public function enigmeMultiEnded(string $mailUtilisateur, int $enigmeId){ - $end_time = $_SESSION['tpsMaxPartie']; + $idPartie = $_SESSION['idPartie']; + $dateDebut = $this->partie_gateway->getDateDebut($idPartie); + $end_time = $dateDebut->modify('+'. $_SESSION['tpsMaxPartie'] .'seconds'); $now = new DateTime(); $interval = $now->diff($end_time); $tempDeResolution = $interval->days * 24 * 60 * 60 + $interval->h * 60 * 60 + $interval->i * 60 + $interval->s; - $idPartie = $_SESSION['idPartie']; $result = $this->resoudre_gateway->getMaxClassement($enigmeId, $idPartie); if ($result == 0){ $classement = 1;