Dynamic number of players

This commit is contained in:
Frank
2026-01-08 15:49:47 +01:00
parent f8746207e6
commit 8e933631b2
8 changed files with 204 additions and 114 deletions

View File

@@ -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');