Game registration
Metadata, server registration, and frontend modules.
1. Metadata (GameMetadata)
Set in your GameFactory::metadata():
id— kebab slug, stable forever (my-game)name,descriptionmin_players/max_playerscategories—GameCategoryvariantsfee—FeeConfig::new(0..=5)?dev_id— your platform user id from profile Get ID
Invalid or unknown dev_id can zero developer fees at claim time — use the real id from production.
2. Server registration
- Publish (or path-depend) your crate.
- Add the dependency on
sw-server. - Register the factory in
backend/crates/sw-server/src/games.rs:
registry
.register(MyGameFactory::arc())
.context("register my-game")?;- Restart
sw-server. ConfirmGET /gameslists your game.
3. Frontend registration
- Add
frontend/games/my-game/withregisterGame({ gameId: "my-game", Room }). - Import it from
frontend/games/boot.ts. - Add the id to
PLAYABLE_GAME_IDSinfrontend/games/playable.ts. - Optional: art under
public/games/my-game.png.
gameId strings must match the Rust GameId exactly.
4. Exposing UI
| Export | Role |
|---|---|
Room | In-match UI when lobby is in progress |
LobbyPanel | Extra waiting-room UI |
Page | Custom /games/[id] page |
createActions | Typed helpers over the game channel |
onMatchFinished | Client celebration / overlays |
No prior platform knowledge required beyond implementing these seams and registering both sides.