Private
Public Access
1
0

chg: dev: replace the legacy gos/web-socket-bundle & replace it with Mercure protocol #4

This commit is contained in:
2026-04-09 22:00:53 +02:00
parent b55c223d8a
commit 7219471a86
33 changed files with 1198 additions and 2324 deletions

View File

@@ -12,7 +12,6 @@ namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
/**
@@ -29,8 +28,11 @@ class GameController extends AbstractController
{
public function __construct(
#[Autowire(env: 'APP_ENV')]
private readonly string $env,
private readonly RequestStack $request,
private readonly string $env,
#[Autowire(env: 'MERCURE_PUBLIC_URL')]
private readonly string $mercurePublicUrl,
#[Autowire(env: 'MERCURE_SUBSCRIBER_JWT')]
private readonly string $mercureSubscriberJwt,
) {
}
@@ -42,8 +44,9 @@ class GameController extends AbstractController
public function play(): Response
{
return $this->render('Game/play.html.twig', [
'env' => $this->env,
'ssl' => $this->request->getCurrentRequest()->isSecure() ? 'true' : 'false',
'env' => $this->env,
'mercure_hub_url' => $this->mercurePublicUrl,
'mercure_subscriber_jwt' => $this->mercureSubscriberJwt,
]);
}