Skip to content

fix: sync random pause image across clients (#38)#52

Merged
marcstraube merged 1 commit into
masterfrom
fix/issue-38-random-image
Jul 9, 2026
Merged

fix: sync random pause image across clients (#38)#52
marcstraube merged 1 commit into
masterfrom
fix/issue-38-random-image

Conversation

@marcstraube

@marcstraube marcstraube commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

A random pause image selected from a folder rendered as a broken image for players.

Root cause

The random folder was resolved on every client via FilePicker.browse. Players without the FILES_BROWSE permission (the default for the Player role) are rejected by the server, so the raw folder path (e.g. assets/) was set as the pause icon src → broken image. This hit non-GM users in the browser and players in the desktop client. A single file worked because it needs no browsing.

Fix

  • The GM (who always has FILES_BROWSE) resolves the folder and stores the chosen file in a hidden world setting (selectedImage) that every client reads → all players see the same image.
  • A new random image is rolled on each pause; changing the folder while paused updates it immediately; an already-paused world resolves an empty selection on GM login without changing a valid existing selection.
  • The raw folder path is never rendered anymore (only concrete files), so the broken-image state cannot recur.

Also included

  • Desktop video playback: route through game.video.play so playback respects the Electron autoplay policy.
  • Docs/hints corrected: the desktop app supports H.264 (MP4) and WebM, but not HEVC/H.265 (the old note wrongly claimed MP4 fails in the desktop app). Updated in all 6 languages.

Testing

Verified locally: same image across GM and players, folder and single-file modes, and video playback in the desktop client.

Closes #38

🤖 Generated with Claude Code

Players without the FILES_BROWSE permission could not resolve a random
image folder via FilePicker.browse, so the raw folder path was rendered
as the pause icon src, resulting in a broken image (only in the browser
for non-GM users, or as a player in the desktop client).

Resolve the folder on the GM (who always has FILES_BROWSE) and store the
chosen file in a hidden world setting (selectedImage) that every client
reads, so all players render the same image. A new random image is rolled
on each pause; changing the folder while paused updates it immediately;
and an already-paused world resolves an empty selection on GM login
without changing an existing, valid selection.

Also fix video playback for the desktop client by routing through
game.video.play (respecting the Electron autoplay policy), and correct
the docs/hints: the desktop app supports H.264/WebM but not HEVC/H.265.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@marcstraube
marcstraube marked this pull request as ready for review July 9, 2026 10:09
@github-actions github-actions Bot added the fix label Jul 9, 2026
@marcstraube
marcstraube merged commit 0683045 into master Jul 9, 2026
4 checks passed
@marcstraube
marcstraube deleted the fix/issue-38-random-image branch July 9, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Random image shows broken on browser

1 participant