Dynamic number of players
This commit is contained in:
@@ -70,6 +70,17 @@ final class GameController extends AbstractController
|
||||
$this->addFlash('error', 'Could not leave session (game might have started).');
|
||||
}
|
||||
}
|
||||
} elseif ($request->request->has('start_session')) {
|
||||
$sessionId = $request->request->get('session_id');
|
||||
$session = $sessionRepository->find($sessionId);
|
||||
|
||||
if ($session) {
|
||||
if ($dashboardService->startSession($session)) {
|
||||
$this->addFlash('success', 'Session started! Screens have been assigned.');
|
||||
} else {
|
||||
$this->addFlash('error', 'Could not start session. Make sure all players have joined.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('game_dashboard');
|
||||
|
||||
Reference in New Issue
Block a user