Stacks Wars

Game registration

Metadata, server registration, and frontend modules.

1. Metadata (GameMetadata)

Set in your GameFactory::metadata():

  • id — kebab slug, stable forever (my-game)
  • name, description
  • min_players / max_players
  • categoriesGameCategory variants
  • feeFeeConfig::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

  1. Publish (or path-depend) your crate.
  2. Add the dependency on sw-server.
  3. Register the factory in backend/crates/sw-server/src/games.rs:
registry
    .register(MyGameFactory::arc())
    .context("register my-game")?;
  1. Restart sw-server. Confirm GET /games lists your game.

3. Frontend registration

  1. Add frontend/games/my-game/ with registerGame({ gameId: "my-game", Room }).
  2. Import it from frontend/games/boot.ts.
  3. Add the id to PLAYABLE_GAME_IDS in frontend/games/playable.ts.
  4. Optional: art under public/games/my-game.png.

gameId strings must match the Rust GameId exactly.

4. Exposing UI

ExportRole
RoomIn-match UI when lobby is in progress
LobbyPanelExtra waiting-room UI
PageCustom /games/[id] page
createActionsTyped helpers over the game channel
onMatchFinishedClient celebration / overlays

No prior platform knowledge required beyond implementing these seams and registering both sides.

On this page