feat(place): final end time + destruction wave
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user