- JavaScript 97.4%
- Handlebars 2.6%
The site no longer uses it: link previews take the Game's own description, written for the site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| scripts | ||
| templates | ||
| .gitignore | ||
| module.json | ||
| README.md | ||
Seitime Bridge
A Foundry VTT v14 module (dnd5e) that sends a world's characters to the Seitime site: who owns each actor, each assigned character's sheet and portrait, and the world's active modules for the site's credits. From 0.5.0 it also sets up characters players create on the site. It only ever calls the site; the site never calls into Foundry.
The site does the rest: it sorts actors into characters and companions,
assigns them to players, pairs them with their death clocks, and logs sheet
changes made outside a session. See apps/st/docs/plans/foundry-bridge-rework.md
in the st app.
Setting up a world
- On the site, create the world's Foundry World record in Desk, with the
world's id (Foundry's
game.world.id) and its default character type. - Install and enable this module in the world.
- In Configure Settings → Seitime Bridge, check the Site URL, and paste the world's token (on the site: the world's record, Token → Show Token). The token is kept in this browser only, so paste it on every browser you GM from. Players never receive it. Each world keeps its own token, so switching worlds in the same browser doesn't lose it.
- Open the Seitime tab (the cloud icon in the sidebar's icon strip on the right, GMs only) and click Test Connection.
- On the site, fill in each Foundry user's Discord ID and tick the stream account. Players are linked on their first sign-in to the site.
What it sends, and when
Only one client sends: the connected GM with a token whose user id sorts first. Nothing is sent while no such GM is connected; edits made meanwhile are caught up when one connects.
- On connecting, and every Sync Interval minutes: the user list, the actor list (PCs, plus NPCs in the world's companion folder), and the sheets and portraits the site asks for.
- When an assigned character is edited: its sheet, a few seconds after the last edit.
- When an actor is created, deleted, renamed, moved or given to someone, or its portrait changes, or a user changes: the lists again.
Each sheet also carries the numbers Foundry works out when it prepares the actor (AC, ability modifiers, saves, skill totals, attack bonuses, spell DC and slots), for the character book on the site. From 0.4.2 the site asks once for every sheet it stored before these were sent.
A portrait (the actor's image, read from this Foundry server) goes on the
character's card when the card has no picture, or when the one it has came
from Foundry and the actor's image has changed. A picture put on the card by
hand on the site is never replaced. Stock art (icons/, systems/) and SVGs
aren't sent.
- Send to Seitime (the button in the Seitime sidebar tab, the settings
window, or the macro
seitimeBridge.send()): everything, including the module list, then a summary whispered to the GMs.seitimeBridge.endSession()still works and does the same.
The Seitime tab also shows whether this browser has the token and which GM's browser is doing the sending.
Module versions are never sent: the credits page may be public, and dependency versions help attackers.
Characters made on the site (0.5.0)
Players create Arena characters on the site (free, or PLUS bought through Stripe). The site queues each one; a GM client in the world collects it and, for each:
- Makes the Foundry user (Player role) with the username and password the player chose on the site, or uses their existing user if they have one.
- Finds or makes the folders
Active Players / <Name> / Characters. The player's folder is the one already holding actors they own, else one named like their username, else a new one. A new Characters folder gets the colour set on the site, or else matches an existing Characters folder. - Copies the template (Arena Default Actor, or Arena Default Actor PLUS), named for the character on the actor and its token, with no "(Copy)", owned by the player and the stream accounts.
- Tells the site the user and actor ids, then sends the lists, so the character's card fills in.
Everything made is flagged with the job id, so a job that's run again after a failure finds what it already made rather than making a second user or actor. The password is used once, for the new user, and is never shown or logged. Templates, folder names and the colour are set on the world's Foundry World record on the site.
While you're running a game
The GM client that does the sending checks the site every 30 seconds. When characters are waiting it asks:
Can I take a moment of your time to create a character please?
- Accept pauses the game (unless it's already paused), sets them up in your browser in a few seconds, unpauses if it paused, and whispers you what was made.
- Later asks again in 30 minutes. If you log off first, the setup bot does it.
The setup bot
seitime-setup-bot (a separate service on the Foundry server) logs in as a
dedicated GM, CharacterCreatorGM, only when there's work, the Arena world is
up, and no person's GM client is connected. In its browser
globalThis.SEITIME_SETUP_BOT is set, so the bridge does nothing on its own:
the service sets the world token and calls seitimeBridge.runSetupQueue(),
which runs everything queued without asking and answers
{done: [...], failed: [...]}. seitimeBridge.runSetupQueue() also works
from the console or a macro in a GM's browser.
Upgrading from 0.2
The shared secret is gone. Paste the world's token instead (step 3 above). The End Session attendance dialog is gone too: sessions and attendance are run from the site.