feature/MAPG-235-basic-challenge-mode #48

Merged
balazs merged 43 commits from feature/MAPG-235-basic-challenge-mode into develop 2021-05-28 20:41:09 +02:00
Showing only changes of commit 4520d11559 - Show all commits

View File

@ -388,14 +388,14 @@ class GameFlowController
// save user relevant state of challenge
$userInChallenge->setCurrentRound($nextRound);
if ($this->request->post('timeLeft')) {
$userInChallenge->setTimeLeft(intval($this->request->post('timeLeft')));
$timeLeft = $this->request->post('timeLeft');
if (isset($timeLeft)) {
$userInChallenge->setTimeLeft(intval($timeLeft));
}
$this->pdm->saveToDb($userInChallenge);
if ($challenge->getTimeLimitType() === 'game' && $this->request->post('timeLeft')) {
$timeLimit = max(10, intval($this->request->post('timeLeft')));
if ($challenge->getTimeLimitType() === 'game' && isset($timeLeft)) {
$timeLimit = max(10, intval($timeLeft));
$response['restrictions']['timeLimit'] = $timeLimit * 1000;
}