diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 0000000..bbafc6a --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "dmtools", + "runtimeExecutable": "symfony", + "runtimeArgs": ["serve", "--no-tls"], + "port": 8000 + } + ] +} diff --git a/.env b/.env index ff4c98a..8c66219 100644 --- a/.env +++ b/.env @@ -59,3 +59,14 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 ###> symfony/mailer ### MAILER_DSN=null://null ###< symfony/mailer ### + +# Puzzle relay (src/Command/PuzzleRelayCommand.php): a small WebSocket server, +# run separately with `symfony console app:puzzle-relay` (or `php bin/console +# app:puzzle-relay`) alongside symfony serve, that syncs cursors and dragged +# pieces across the shared puzzle screens. No Symfony/Mercure component covers +# this (Mercure needs its own hub process/container); Workerman gives us a +# plain-PHP WebSocket server instead. +# PUZZLE_RELAY_LISTEN is the address the relay process binds to. +PUZZLE_RELAY_LISTEN=0.0.0.0:8091 +# PUZZLE_RELAY_PUBLIC_URL is the address browsers connect to. +PUZZLE_RELAY_PUBLIC_URL=ws://127.0.0.1:8091 diff --git a/assets/controllers/puzzle_room_controller.js b/assets/controllers/puzzle_room_controller.js new file mode 100644 index 0000000..279396d --- /dev/null +++ b/assets/controllers/puzzle_room_controller.js @@ -0,0 +1,270 @@ +import { Controller } from '@hotwired/stimulus'; + +/* + * The shared, no-login puzzle board. Connects to the WebSocket relay + * (src/Command/PuzzleRelayCommand.php) so every open tab on this room sees + * the same piece positions and each other's cursors, live. + * + *
+