@diffenderfer-games/hub-contract 2.0.0-next.1 → 2.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -5
- package/dist/index.d.ts +2831 -187
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +862 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/catalog-activity.ts +66 -0
- package/src/api/catalog.ts +7 -1
- package/src/api/index.ts +7 -0
- package/src/api/mp/invite-links.ts +42 -0
- package/src/api/mp/parties.ts +5 -0
- package/src/api/mp/rooms.ts +34 -2
- package/src/api/mp.ts +25 -0
- package/src/api/notify.ts +4 -1
- package/src/api/offline.ts +45 -0
- package/src/api/tournaments/endpoints.ts +102 -0
- package/src/api/tournaments/play-online.ts +71 -0
- package/src/api/tournaments/shapes.ts +202 -0
- package/src/api/tournaments.ts +7 -0
- package/src/errors/codes/multiplayer.ts +14 -1
- package/src/limits.ts +25 -0
- package/src/manifest/game.ts +7 -0
- package/src/manifest/index.ts +1 -0
- package/src/manifest/labels.ts +99 -0
- package/src/manifest/multiplayer.ts +8 -0
- package/src/realtime/events/multiplayer.ts +3 -2
- package/src/realtime/events/rooms.ts +6 -2
- package/src/realtime/events/social.ts +2 -2
- package/src/realtime/events/tournaments.ts +12 -0
- package/src/realtime/ops/rooms.ts +21 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
# @diffenderfer-games/hub-contract
|
|
1
|
+
# @diffenderfer-games/hub-contract
|
|
2
|
+
|
|
3
|
+
## 2.0.0-next.3
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
No changes in this release.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
## 2.0.0-next.2
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 3944819: `game.labels`: say what kind of game yours is, from a fixed vocabulary (`GAME_LABELS`, with display names in `GAME_LABEL_TITLES`, grouped in `GAME_LABEL_GROUPS`): genre (`cards`, `board`, `puzzle`, `arcade`, `platformer`, `real-time-strategy`, `physics`, `typing`, `word`, `sports`, `racing`), look (`2d`, `3d`), where it plays (`phone`, `controller`, `desktop`) and players (`multiplayer`, `single-player`). The home page filters by them. An unknown label is a `hub-doctor` warning, not an error.
|
|
12
|
+
|
|
13
|
+
New endpoints: `GET /catalog/players` (how many accounts and guests have each game open right now: counts only) and `GET /games/:slug/me/activity` (the signed-in player's plays and minutes in a game). The `lobbyOpen` notification preference now means "tell me when people want to play": an open public lobby or race, or a tournament opening.
|
|
14
|
+
- 937d61e: Explicit offline replay. Writes made offline now go into a typed operation outbox in `localStorage`: each op has a kind whose handler performs it (several dependent calls can be one op), ops replay in order with backoff when the hub is back and after a reload, one tab replays at a time, and the outbox is capped. Saves, stats, scores, the profile, daily completions, inventory grants and house exchanges, and starring a game all queue offline. Games add their own kinds with `hub.offline.define(kind, handler)`, queue them with `hub.offline.enqueue(kind, payload)`, list them with `hub.offline.pending()`, and hear `queued`, `replayed` and `failed` through `hub.offline.on(...)` (and `hub:offline-*` window events). An offline `hub.daily.complete()` resolves `null`, fires `hub:daily-queued`, and replays later. The contract marks the endpoints that may be replayed (`OFFLINE_REPLAY_ENDPOINTS`); each replayed call carries an operation key (`x-hub-op`) and the hub runs it once per key. `SyncConflict.op` is now the dropped outbox op.
|
|
15
|
+
- ed68402: Invite links and resilient online games (batch 2026-10, R13 and R14).
|
|
16
|
+
|
|
17
|
+
- **Invite links:** `hub.mp.inviteLink()` makes (or reuses) a shareable link to the room the player is in; `hub.mp.revokeInviteLink(token)` revokes it. Opening `/<slug>/<lobby>?hub_link=<token>` arrives as an ordinary `join` or `watch` launch with `via: 'link'`. Contract: `POST /mp/links`, `GET /mp/links`, `DELETE /mp/links/:token`, `POST /mp/links/:token/open`, the `InviteLink` shape and the `link_invalid`, `link_room_gone` and `too_many_links` error codes.
|
|
18
|
+
- **Resilient rooms:** the new `room.seat` event (`room.on('seat', …)`: `away` with `graceEndsAt`, `back`, `gone` with `reason`), `room.seats()`, `hub.rooms.reclaim()` (socket op `room.reclaim`), seats' `graceEndsAt`, and `Launch.via` (`'link' | 'rejoin'`). The host role now passes on instead of the room closing with `host_left`: once the host's seat is freed by default, or as soon as the host drops with `hub.rooms.create({ hostMigration: 'drop' })`.
|
|
19
|
+
- The realtime feature version is 3; on an older runtime the new methods reject with `OfflineError` asking for a reload.
|
|
20
|
+
- 5b68831: Tournaments (docs/multiplayer.md §15). `game.multiplayer.tournaments: true` says a game plays 1v1 tournament matches and reports their winner; race games need nothing. A ready match reaches the game as an ordinary `host`/`guest` launch with the new `launch.tournament` (`{ id, title, match, opponent }`); a hub-room game ends it with `room.end({ winnerId })`, an own-server game posts results with `tournament: { id, match }`.
|
|
21
|
+
|
|
22
|
+
New endpoints: `GET /play-online` (lobbies waiting for a player, invites, my tournaments, open ones coming up), `GET|POST /tournaments`, `GET|DELETE /tournaments/:id`, `POST /tournaments/:id/join|leave|start|invites`, `PUT|DELETE /tournaments/:id/follow` and `POST /tournaments/:id/matches/:match/launch`; the `tournament` socket event; the `tournament` notice kind; `GameInfo.tournaments`; `TOURNAMENT_LIMITS`. `hub.social.openPlayOnline()` opens the hub's Play online window (realtime feature version 4).
|
|
23
|
+
|
|
24
|
+
## 2.0.0-next.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Follow-ups from the Bubble Pop pilot. `hub-doctor` gives up after `--timeout` ms (default 10 s) and fails with `hub unreachable at <url>` instead of hanging. A v1 vendored singleton adopted on the page is now recorded in `window.__DG__` as `{ version: 'v1' }`. The README covers exact pins for prereleases, sharing the page with the host's `/_hub/hub.js`, and testing against the hub.
|