This commit is contained in:
4 files changed
+10
-10
No files matched your search
@@ -138,7 +138,7 @@ class GameFlowController implements IAuthenticationRequired
|
||||
// if the last round was played ($currentPlace == null) or history is explicitly requested (for initializing)
|
||||
if (!isset($currentPlace) || $withHistory) {
|
||||
|
||||
$withRelations = [User::class, PlaceInChallenge::class, Place::class];
|
||||
$withRelations = ['user', 'place_in_challange', 'place'];
|
||||
foreach ($this->guessRepository->getAllInChallenge($challenge, $withRelations) as $guess) {
|
||||
$round = $guess->getPlaceInChallenge()->getRound();
|
||||
|
||||
@@ -187,7 +187,7 @@ class GameFlowController implements IAuthenticationRequired
|
||||
|
||||
$prevRound = $currentRound - 1;
|
||||
if ($prevRound >= 0) {
|
||||
foreach ($this->guessRepository->getAllInChallengeByRound($prevRound, $challenge, [User::class]) as $guess) {
|
||||
foreach ($this->guessRepository->getAllInChallengeByRound($prevRound, $challenge, ['user']) as $guess) {
|
||||
if ($guess->getUser()->getId() != $userId) {
|
||||
$response['allResults'][] = [
|
||||
'userName' => $guess->getUser()->getDisplayName(),
|
||||
@@ -216,7 +216,7 @@ class GameFlowController implements IAuthenticationRequired
|
||||
$session = \Container::$request->session();
|
||||
$userId = $session->get('userId');
|
||||
$challengeToken_str = \Container::$request->query('challengeToken');
|
||||
$userInChallenge = $this->userInChallengeRepository->getByUserIdAndToken($userId, $challengeToken_str, [Challenge::class]);
|
||||
$userInChallenge = $this->userInChallengeRepository->getByUserIdAndToken($userId, $challengeToken_str, ['challenge']);
|
||||
|
||||
if (!isset($userInChallenge)) {
|
||||
return new JsonContent(['error' => 'game_not_found']);
|
||||
@@ -337,7 +337,7 @@ class GameFlowController implements IAuthenticationRequired
|
||||
$session = \Container::$request->session();
|
||||
$userId = $session->get('userId');
|
||||
$challengeToken_str = \Container::$request->query('challengeToken');
|
||||
$userInChallenge = $this->userInChallengeRepository->getByUserIdAndToken($userId, $challengeToken_str, [Challenge::class]);
|
||||
$userInChallenge = $this->userInChallengeRepository->getByUserIdAndToken($userId, $challengeToken_str, ['challenge']);
|
||||
|
||||
if (!isset($userInChallenge)) {
|
||||
return new JsonContent(['error' => 'game_not_found']);
|
||||
@@ -345,7 +345,7 @@ class GameFlowController implements IAuthenticationRequired
|
||||
|
||||
$challenge = $userInChallenge->getChallenge();
|
||||
$currentRound = $userInChallenge->getCurrentRound();
|
||||
$currentPlaceInChallenge = $this->placeInChallengeRepository->getByRoundInChallenge($currentRound, $challenge, [Place::class, Map::class]);
|
||||
$currentPlaceInChallenge = $this->placeInChallengeRepository->getByRoundInChallenge($currentRound, $challenge, ['place', 'map']);
|
||||
$currentPlace = $currentPlaceInChallenge->getPlace();
|
||||
$map = $currentPlace->getMap();
|
||||
|
||||
|
||||
Reference in new issue
Block a user