MAPG-235 highscores added to the end of challenge

This commit is contained in:
balazs committed 2021-05-22 11:34:55 +02:00
1 parent 599d8bf153
commit b00fe4ebe3
6 files changed
+150 -10

No files matched your search

+8
View File
@@ -193,6 +193,14 @@ class GameFlowController
if (!isset($currentPlace)) { // game finished
$response['finished'] = true;
// list all players who finished the challenge
$response['finishers'] = [];
foreach ($this->userInChallengeRepository->getAllByChallengeWithUsers($challenge) as $userInChallenge) {
if ($userInChallenge->getCurrentRound() == $currentRound && $userInChallenge->getUser()->getId() != $userId) {
$response['finishers'][] = $userInChallenge->getUser()->getDisplayName();
}
}
} else { // continue game
$response['place'] = [
'panoId' => $currentPlace->getPanoIdCached(),