feature/avoid-repeating-places-in-game #38

Merged
balazs merged 14 commits from feature/avoid-repeating-places-in-game into develop 2021-05-09 10:58:54 +02:00
Showing only changes of commit 7143c7ec63 - Show all commits

View File

@ -152,7 +152,16 @@ class GameFlowController
$session->set('state', $state); $session->set('state', $state);
$this->saveVisit($last);
return new JsonContent($response, $last);
}
// save the selected place for the round in UserPlayedPlace // save the selected place for the round in UserPlayedPlace
private function saveVisit($last): void
{
$session = $this->request->session();
$userId = $session->get('userId'); $userId = $session->get('userId');
if(isset($userId)) { if(isset($userId)) {
$placeId = $last['placeId']; $placeId = $last['placeId'];
@ -167,8 +176,6 @@ class GameFlowController
$userPlayedPlace->setLastTimeDate(new DateTime()); $userPlayedPlace->setLastTimeDate(new DateTime());
$this->pdm->saveToDb($userPlayedPlace); $this->pdm->saveToDb($userPlayedPlace);
} }
return new JsonContent($response);
} }
public function multiGuess(): IContent public function multiGuess(): IContent