Implement instant websocket room updates

This commit is contained in:
2026-08-25 22:23:38 +02:00
parent bfc93dceba
commit d6e5455e90
18 changed files with 303 additions and 130 deletions
+7
View File
@@ -11,6 +11,10 @@ use Illuminate\Validation\ValidationException;
class RoundService
{
public function __construct(
private readonly RoomRealtimeStateService $realtimeState,
) {}
public function reset(Room $room): void
{
$stateVersion = DB::transaction(function () use ($room): int {
@@ -38,6 +42,7 @@ class RoundService
$room->id,
$stateVersion,
RoomStateChange::VotesReset,
$this->realtimeState->for($room),
);
}
@@ -69,6 +74,7 @@ class RoundService
$room->id,
$stateVersion,
RoomStateChange::CardsRevealed,
$this->realtimeState->for($room),
);
}
@@ -101,6 +107,7 @@ class RoundService
$room->id,
$stateVersion,
RoomStateChange::NextRound,
$this->realtimeState->for($room),
);
}