Pass tiers restructure (Dallas, Marty approved 2026-10-22): Explorer $19.99 (1999 credits) and Champion $39.99 (3999) for 30 days, new Sovereign $99.99 (9999, 30 days) and Legend $249.99 (24999, 365 days, the yearly pass). One table (gamepass.js TIER_DEFS: rank, names, settings stem, defaults, member-card perks); settings gamePassSovereign*/gamePassLegend* with kill switches; flag()/partner player/hand-off token carry sovereign/legend; buy, waiting orders ($100/$250 package copy), extend from max(now, until), comp/revoke, admin By pass tier table and comp options; chatbot tier fact says coming soon while sovTiers is off. All behind sovTiers (still 0): weekly Game Pass price, length and caps unchanged. Tests: sov-passes store + local extended (all pass), member QA 0 bugs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-22 10:26:58 -05:00
parent 32eefae473
commit 839c867595
11 changed files with 259 additions and 77 deletions
+42 -23
View File
@@ -215,33 +215,52 @@ sales. If the POL rate is unavailable the tick retries next hour.
- Settings pass through `/api/admin/site` like every other site setting (that endpoint accepts any key; the defaults above make the
Game Pass keys show in the Site settings form).
## Pass tiers: Explorer and Champion (IAP side, 2026-10-18)
## Pass tiers: Explorer, Champion, Sovereign, Legend (IAP side, 2026-10-18; restructured 2026-10-22)
Spec: `ultima-rpg/docs/IAP-PASSES-SPEC.md`. Marty approved the safe form: paid tiers add Shards of Valor islands and looks, never
power, never more POL. The weekly pass is unchanged.
Spec: `ultima-rpg/docs/IAP-PASSES-SPEC.md`. Marty approved the safe form on 2026-10-18 (never more POL) and Dallas's new structure
on 2026-10-22 (prices below, plus Sovereign and the yearly Legend). The weekly pass is unchanged. Everything above weekly stays
switched off for members (`sovTiers` 0) until Marty flips it.
- **Tiers**: `weekly` (500 credits, 7 days), `explorer` (2000, 30 days), `champion` (4000, 30 days). Every tier is a Game Pass
holder everywhere with exactly the pass caps; `polgrant` keeps answering `pass: true` (a boolean).
- **Store**: `record.tiers = { weekly: { until }, explorer: { until }, champion: { until } }`, the legacy `until` mirrors the weekly
tier, bought rows carry `tier` (missing = weekly), waiting orders carry `tier` (missing = weekly). Lazy migration: a record
without `tiers` reads its `until` as the weekly tier.
- **Wire**: `flag()` = `{ active, until, tier, tiers }` (`tier` = highest active, `until` = that tier's end). The hand-off token
carries `gamePass: { active, until, tier }`; `GET /api/partner/player` carries `pass: { active, until, tier, tiers }`.
- **Buy**: `POST /api/my/gamepass/buy { tier }` (missing = weekly). Explorer/Champion need `sovTiers` on (and the weekly pass on);
while off, only the `ADMIN_EMAIL` account sees and can buy them (admin preview on the card). Short of purchased credits: a
| Tier | Name | Price | Length | In Shards of Valor (each includes everything below) |
|---|---|---|---|---|
| `weekly` | Game Pass | 500 credits ($5) | 7 days | the Game Pass in all nine games, the Sunless Vault, weapons unlocked |
| `explorer` | Explorer | 1999 ($19.99) | 30 days | weapons, gear, 2 DLC islands |
| `champion` | Champion | 3999 ($39.99) | 30 days | weapons, gear, 4 DLC islands of your choice, the Druid hero, level cap 30 |
| `sovereign` | Sovereign | 9999 ($99.99) | 30 days | weapons, gear, all DLC islands, the Necromancer hero, level cap 40 |
| `legend` | Legend | 24999 ($249.99) | 365 days | weapons, gear, all DLC islands, every hero including the Archer, level cap 40 |
- **One table**: `gamepass.js` `TIER_DEFS` holds the rank, wire key, display name, settings stem, default price/length and the
member-card list for every tier. Rename a tier there (the card, admin pane, charge label and chatbot all read it).
- **Rank**: weekly < explorer < champion < sovereign < legend. Every tier is a Game Pass holder everywhere with exactly the pass
caps; `polgrant` keeps answering `pass: true` (a boolean).
- **Store**: `record.tiers = { weekly: { until }, explorer: { until }, champion: { until }, sovereign: { until }, legend: { until } }`,
the legacy `until` mirrors the weekly tier, bought rows carry `tier` (missing = weekly), waiting orders carry `tier` (missing =
weekly). Lazy migration: a record without `tiers` reads its `until` as the weekly tier.
- **Wire**: `flag()` = `{ active, until, tier, tiers }` (`tier` = highest active, `until` = that tier's end; `tiers` has all five
keys). The hand-off token carries `gamePass: { active, until, tier }`; `GET /api/partner/player` carries
`pass: { active, until, tier, tiers }`, so Shards of Valor sees `sovereign` / `legend`.
- **Buy**: `POST /api/my/gamepass/buy { tier }` (missing = weekly). Every tier above weekly needs `sovTiers` on (and the weekly pass
on); while off, only the `ADMIN_EMAIL` account sees and can buy them (admin preview on the card). Short of purchased credits: a
waiting order per tier; a package of at least the tier price fulfils the highest-priced order it covers (one pass per purchase,
each tx once). There is no $40 package, so Champion's copy names the $50 one.
- **Renew / expiry**: no auto-renew, no proration. Buying again extends that tier from `max(now, until)`. Tiers run side by side;
when a higher one ends the next one shows through. Admin comp takes a tier; `POST /api/admin/gamepass/revoke { email, tier, why }`
ends one tier now (support refunds only, credits are not returned by it).
- **Tournament**: any tier holds a seat; only weekly sales feed the pool unless `passTournamentTierSales` is `1`.
- **Settings**: `sovTiers` 0, `gamePassExplorerEnabled` 1 / `gamePassChampionEnabled` 1 (a `0` stops one tier),
`gamePassExplorerPriceCredits` 2000, `gamePassChampionPriceCredits` 4000, `gamePassExplorerDays` / `gamePassChampionDays` 30,
`passTournamentTierSales` 0.
- **Member UI**: the Games tab card shows the three tiers side by side (end dates in Central time); `/my#passes` opens it (the
each tx once). Copy names the package that covers the price: $20 (Explorer), $50 (Champion, there is no $40 one), $100
(Sovereign), $250 (Legend).
- **Renew / expiry**: no auto-renew, no proration. Buying again extends that tier from `max(now, until)` by its length (Legend: 365
days). Tiers run side by side; when a higher one ends the next one shows through. Admin comp takes a tier;
`POST /api/admin/gamepass/revoke { email, tier, why }` ends one tier now (support refunds only, credits are not returned by it).
- **Tournament**: any tier holds a seat; only weekly sales feed the pool unless `passTournamentTierSales` is `1` (then every tier's
sales do).
- **Settings** (defaults): `sovTiers` 0; kill switches `gamePassExplorerEnabled` / `gamePassChampionEnabled` /
`gamePassSovereignEnabled` / `gamePassLegendEnabled` 1 (a `0` stops one tier); `gamePassExplorerPriceCredits` 1999,
`gamePassChampionPriceCredits` 3999, `gamePassSovereignPriceCredits` 9999, `gamePassLegendPriceCredits` 24999;
`gamePassExplorerDays` / `gamePassChampionDays` / `gamePassSovereignDays` 30, `gamePassLegendDays` 365;
`passTournamentTierSales` 0. A value saved in the site settings file wins over these defaults.
- **Chatbot**: while `sovTiers` is off the assistant only says more passes are coming soon (no prices, no contents, no date); once
on, its fact lists each tier on sale with the live price, length and contents.
- **Member UI**: the Games tab card shows the tiers side by side (end dates in Central time); `/my#passes` opens it (the
Shards of Valor Buy button). **Admin**: Game Pass pane "By pass tier" table, comp per tier, end-a-tier button.
- **Tests**: `bash qa/run.sh sov-passes` (store unit checks + a local copy where the admin buys Explorer through the real
`ads.gamePurchase(purchasedOnly)` path with credits seeded by `qa/sov-passes-stub.cjs`).
- **Tests**: `bash qa/run.sh sov-passes` (store unit checks + a local copy where the admin buys Explorer and Sovereign through the
real `ads.gamePurchase(purchasedOnly)` path with credits seeded by `qa/sov-passes-stub.cjs`, and a Legend order is fulfilled by
a $250 package).
## Games: as built (2026-10-16, local commits only, nothing deployed)