feat(place): final end time + destruction wave

This commit is contained in:
2026-10-25 12:55:24 +01:00
parent 1844b973e9
commit 73b279d7fe
14 changed files with 372 additions and 39 deletions
+6 -2
View File
@@ -35,10 +35,14 @@ HEADER_FORMAT = "<HH"
@decorate_view(require_game_enabled(path="place"))
def canvas(request: HttpRequest, event_path: str):
"""The one-time full-grid load. Every placement after that arrives as a
single websocket message, never a re-fetch."""
single websocket message, never a re-fetch. Once placement is over the
board is shown wiped (Redis keeps the real final board, see tasks.py)."""
place_settings = PlaceSettings.current(request.event)
header = struct.pack(HEADER_FORMAT, place_settings.width, place_settings.height)
pixels = read_canvas(event_path, place_settings.width, place_settings.height)
if place_settings.placement_ended:
pixels = bytes(place_settings.width * place_settings.height)
else:
pixels = read_canvas(event_path, place_settings.width, place_settings.height)
return HttpResponse(header + pixels, content_type="application/octet-stream")