Trying to add waiting pages

This commit is contained in:
Frank
2026-01-08 19:32:13 +01:00
parent 834f12c40f
commit 4d021e7cf1
7 changed files with 505 additions and 15 deletions
+5 -2
View File
@@ -12,6 +12,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\Update;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
class GameResponseService
{
@@ -22,6 +23,8 @@ class GameResponseService
private HubInterface $hub,
private EntityManagerInterface $entityManager,
private string $projectDir,
#[Autowire('%env(MERCURE_TOPIC_BASE)%')]
private string $mercureTopicBase,
) {
}
@@ -375,7 +378,7 @@ class GameResponseService
$this->entityManager->flush();
// Notify the player that their codes have changed
$topic = $_ENV['MERCURE_TOPIC_BASE'] . '/game/hub-' . $session->getId();
$topic = $this->mercureTopicBase . '/game/hub-' . $session->getId();
$notification = "Security Alert: One of your verify codes was shared and has been regenerated.";
// We send it only to this player (screen)
$this->hub->publish(new Update($topic, json_encode([$screen, $notification])));
@@ -662,7 +665,7 @@ class GameResponseService
$this->entityManager->persist($everyoneVerifiedSetting);
$this->entityManager->flush();
$topic = $_ENV['MERCURE_TOPIC_BASE'] . '/game/hub-' . $session->getId();
$topic = $this->mercureTopicBase . '/game/hub-' . $session->getId();
$message = "Mainframe Help Modus: Agents Doyle, Vega and Lennox rapports have been updated with coded messages.";
$this->hub->publish(new Update($topic, json_encode([0, $message])));
}