@diffenderfer-games/hub 2.0.0-next.3 → 2.0.0-next.4
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 +11 -0
- package/dist/auto.d.ts +2 -2
- package/dist/auto.js +2 -2
- package/dist/doctor/cli.mjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/rooms.js +1 -1
- package/dist/shared/client-version.gen.js +1 -1
- package/dist/shared/daily.d.ts +13 -4
- package/dist/shared/daily.d.ts.map +1 -1
- package/dist/shared/daily.js +15 -6
- package/dist/shared/daily.js.map +1 -1
- package/dist/shared/index.d.ts +203 -3
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/rooms.d.ts.map +1 -1
- package/dist/shared/rooms.js +12 -1
- package/dist/shared/rooms.js.map +1 -1
- package/dist/shared/src.js +531 -8
- package/dist/shared/src.js.map +1 -1
- package/package.json +2 -2
- package/src/core/connection.ts +5 -0
- package/src/core/hub.ts +55 -4
- package/src/core/offline/hub-kinds/index.ts +6 -0
- package/src/core/offline/hub-kinds/resume-kind.ts +108 -0
- package/src/core/page.ts +10 -0
- package/src/core/rest/routes.gen.ts +4 -0
- package/src/core/resume/hub-resume.ts +252 -0
- package/src/core/resume/local-resume.ts +130 -0
- package/src/core/resume/resume-list.ts +65 -0
- package/src/core/resume/resume-request.ts +52 -0
- package/src/core/resume/resume-types.ts +64 -0
- package/src/core/version/client-version.gen.ts +1 -1
- package/src/daily/daily-system.ts +14 -5
- package/src/index.ts +3 -1
- package/src/realtime/rooms-forwarder.ts +14 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @diffenderfer-games/hub
|
|
2
2
|
|
|
3
|
+
## 2.0.0-next.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9f993ab: Resume saved games. New `hub.resume` (`save`, `flush`, `clear`, `load`, `get`, `requested`, `blockedBy`, `list`, `discard`): one auto-saved run per player per game that the home page's new Resume card lists, so players pick long single-player runs up again on any device. Saves are kept on the device at once, debounced (3 s), sent when the page hides, and replay offline through the new `hub.resume` outbox kind; they are ignored during races, daily challenges and hub rooms. `hub.resume.requested` is a synchronous `true` when the page was opened from the card (`?hub_resume=1`, taken out of the URL). Games opt in with `game.resumable: true` in the manifest. Contract: `resumeEndpoints` (`getResumeSlot`, `saveResumeSlot`, `clearResumeSlot`, `listMyResumeSlots`), `ResumeSlot`, `ResumeSummary`, `ResumeProgress`, `ResumeWrite`, `RESUME_MAX_STATE_BYTES` (512 KB), `RESUME_TEXT_MAX`, `RESUME_RETENTION_MS` (60 days), `RESUME_REQUEST_PARAM`; `saveResumeSlot` and `clearResumeSlot` join `OFFLINE_REPLAY_ENDPOINTS`. See docs/hub.md "Resume saved games". Daily: `hub.daily.complete()` now ends the daily run at the call (`hub.daily.active` is `null` at once, even if the hub refuses the completion); games must call `hub.daily.cancel()` when the player leaves a daily unfinished, or `hub.resume.save` stays off (it warns once).
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [9f993ab]
|
|
12
|
+
- @diffenderfer-games/hub-contract@2.0.0-next.4
|
|
13
|
+
|
|
3
14
|
## 2.0.0-next.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/auto.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { a as RaceHistoryQuery, c as RaceRuntimeApi, i as RaceEvents, l as RaceS
|
|
|
8
8
|
import { f as raceForwarder } from "./shared/race.js";
|
|
9
9
|
import { n as roomsForwarder } from "./shared/rooms.js";
|
|
10
10
|
import { $ as HubNotifyApi, A as RacerState, B as SuggestionStatus, C as RaceRecord, D as RaceStats, E as RaceState, F as ReportReason, G as REALTIME_READY_EVENT, H as isRealtimeApi, I as RoomInfo, J as RealtimeHubLink, K as REALTIME_SINGLETON_API, L as SocialConfig, M as Relation, N as ReportInput, O as Racer, P as ReportKind, Q as socialForwarder, R as SocialMe, S as RaceParams, T as RaceStatValue, U as REALTIME_FAILED_EVENT, V as findRealtimeApi, W as REALTIME_FEATURE_VERSION, X as notifyForwarder, Y as linkRealtimeToHub, Z as presenceForwarder, _ as PlayerLite, a as ErrorBody, at as SocialCounts, b as PresenceKind, c as JoinInfo, d as Message, et as HubPresenceApi, f as MessagesPage, g as PlayerCard, h as Party, i as Counts, it as PlayerRef, j as RecentPlayer, k as RacerResult, l as Launch, m as NotifyPrefs, n as ChatMode, nt as OpenInviteOptions, o as FriendEntry, ot as SocialEvents, p as NotifyChange, q as RealtimeApi, r as Conversation, rt as PlayOnlineMethods, s as Invite, t as Audience, tt as HubSocialApi, u as LaunchTicket, v as Presence, w as RaceResult, x as RaceOutcome, y as PresenceInput, z as Suggestion } from "./shared/social.js";
|
|
11
|
-
import { $ as
|
|
11
|
+
import { $ as GameLeaderboards, A as SyncConflict, B as OfflineHandler, C as TradeBundle, Ct as EndpointReply, D as AuthResponse, E as TradeNoteOptions, F as OfflineEventName, G as QueueOp, H as ReplayContext, I as OfflineListener, J as BufferedEvent, K as QueueOpInput, L as OfflineOp, M as OfflineApi, N as OUTBOX_FULL_CODE, O as ProfileUpdate, P as OfflineEventDetails, Q as GameInfo, R as OUTBOX_MAX_CHARS, S as GrantBundle, St as EndpointName, T as TradeListOptions, U as CLIENT_VERSION_HEADER, V as OfflineKindDefinition, W as ProfilePatch, X as BoardWithTop, Y as Board, Z as GameAnalytics, _ as ResumeLoadOptions, _t as Stats, a as HubErrorDetails, at as InventorySnapshot, b as ResumeSaveInput, bt as User, c as Hub, ct as LeaderboardResult, d as ClientSupport, dt as Profile, et as GameRecords, f as HubResume, ft as ProfileSummary, g as ResumeEntry, gt as SortDir, h as ResumeBlocker, ht as SnapshotResponse, i as HubErrorCode, it as Inventory, j as SyncResult, k as StatResult, l as createHub, lt as MeResponse, m as RESUME_MAX_STATE_BYTES, mt as SaveMeta, n as ContentRejectedError, nt as HubOptions, o as OfflineError, ot as Json, p as RESUME_DEBOUNCE_MS, pt as Save, q as QueuedScoreOptions, r as HubError, rt as HubStatus, s as UNSUPPORTED_BY_HUB, st as LeaderboardEntry, t as HUB_CLIENT_VERSION, tt as GlobalAnalytics, u as hub, ut as Metrics, v as ResumeProgress, vt as SubmitScoreOptions, w as TradeId, wt as GamePayload, x as HubMenuControl, xt as EndpointFields, y as ResumeRun, yt as SubmitScoreResult, z as OUTBOX_MAX_ENTRIES } from "./shared/index.js";
|
|
12
12
|
//#region src/auto.d.ts
|
|
13
13
|
/** What `window.HubSDK` holds. */
|
|
14
14
|
export interface HubSdkGlobal {
|
|
@@ -32,5 +32,5 @@ declare global {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
35
|
-
export { type Anchor, type Audience, type AuthResponse, type AutoPauseOptions, type AxisDef, type AxisSide, type Board, type BoardWithTop, type BufferedEvent, type BusyOptions, CLIENT_VERSION_HEADER, type ChatMode, type ClientSupport, ContentRejectedError, type Conversation, type Counts, DAILY_SINGLETON_API, DAILY_START_EVENT, type DailyAll, type DailyChallenge, type DailyCompleteResponse, type DailyCompletion, type DailyCompletionMeta, type DailyCompletions, type DailyDefinition, type DailyEventDetail, type DailyGameStatus, type DailyHost, type DailyStartResponse, type DailyStatus, DailySystem, type DraggedSpot, type EdgeOffsets, type EndpointFields, type EndpointName, type EndpointReply, type ErrorBody, FOCUS_RING_SHADOW, type FriendEntry, type GameAnalytics, type GameInfo, type GameLeaderboards, type GamePayload, type GameRecords, type GamepadMapping, type GlobalAnalytics, type GrantBundle, type GroupDef, HUB_CLIENT_VERSION, Hub, HubError, type HubErrorCode, type HubErrorDetails, type HubMenuControl, type HubMpApi, type HubNotifyApi, type HubOptions, type HubPresenceApi, type HubRaceApi, type HubRoom, type HubRoomsApi, type HubSocialApi, type HubStatus, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputModality, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type Inventory, type InventorySnapshot, type Invite, type InviteCreated, type InviteLink, type InviteLinkMethods, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type JoinOptions, type Json, type Launch, type LaunchTicket, type LayoutBox, type LayoutItem, type LayoutOptions, type LeaderboardEntry, type LeaderboardResult, MODALITY_ATTRIBUTE, type MeResponse, type MenuBridge, type Message, type MessagesPage, type Metrics, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, type Notice, type NotifyChange, type NotifyPrefs, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, type OfflineEventDetails, type OfflineEventName, type OfflineHandler, type OfflineKindDefinition, type OfflineListener, type OfflineOp, type OpenInviteOptions, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Party, type PlayOnlineMethods, type PlayerCard, type PlayerLite, type PlayerRef, type Presence, type PresenceInput, type PresenceKind, type Profile, type ProfilePatch, type ProfileSummary, type ProfileUpdate, type QueueOp, type QueueOpInput, type QueuedScoreOptions, type REALTIME_FAILED_EVENT, type REALTIME_FEATURE_VERSION, type REALTIME_READY_EVENT, type REALTIME_SINGLETON_API, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RealtimeApi, type RealtimeErrorShape, type RealtimeHubLink, type RecentPlayer, type Rect, type Relation, type ReplayContext, type ReportInput, type ReportKind, type ReportReason, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomReclaimMethods, type RoomSeat, type RoomSeatChange, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, type Save, type SaveMeta, type SchemaOutput, type ServerEvents, type Snapshot, type SnapshotResponse, type SocialConfig, type SocialCounts, type SocialEvents, type SocialMe, type SortDir, type StatResult, type Stats, type SubmitScoreOptions, type SubmitScoreResult, type Suggestion, type SuggestionStatus, type SyncConflict, type SyncResult, type TouchMapping, type TradeBundle, type TradeId, type TradeListOptions, type TradeNoteOptions, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, type UiStack, type UiStackHandoff, type User, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, createHub, type findRealtimeApi, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, type isRealtimeApi, isUiStack, layoutControls, type linkRealtimeToHub, type multiplayerForwarder as mp, type notifyForwarder as notify, parseInputOverrides, type presenceForwarder as presence, type raceForwarder as race, type roomsForwarder as rooms, type socialForwarder as social, trackInputModality };
|
|
35
|
+
export { type Anchor, type Audience, type AuthResponse, type AutoPauseOptions, type AxisDef, type AxisSide, type Board, type BoardWithTop, type BufferedEvent, type BusyOptions, CLIENT_VERSION_HEADER, type ChatMode, type ClientSupport, ContentRejectedError, type Conversation, type Counts, DAILY_SINGLETON_API, DAILY_START_EVENT, type DailyAll, type DailyChallenge, type DailyCompleteResponse, type DailyCompletion, type DailyCompletionMeta, type DailyCompletions, type DailyDefinition, type DailyEventDetail, type DailyGameStatus, type DailyHost, type DailyStartResponse, type DailyStatus, DailySystem, type DraggedSpot, type EdgeOffsets, type EndpointFields, type EndpointName, type EndpointReply, type ErrorBody, FOCUS_RING_SHADOW, type FriendEntry, type GameAnalytics, type GameInfo, type GameLeaderboards, type GamePayload, type GameRecords, type GamepadMapping, type GlobalAnalytics, type GrantBundle, type GroupDef, HUB_CLIENT_VERSION, Hub, HubError, type HubErrorCode, type HubErrorDetails, type HubMenuControl, type HubMpApi, type HubNotifyApi, type HubOptions, type HubPresenceApi, type HubRaceApi, HubResume, type HubRoom, type HubRoomsApi, type HubSocialApi, type HubStatus, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputModality, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type Inventory, type InventorySnapshot, type Invite, type InviteCreated, type InviteLink, type InviteLinkMethods, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type JoinOptions, type Json, type Launch, type LaunchTicket, type LayoutBox, type LayoutItem, type LayoutOptions, type LeaderboardEntry, type LeaderboardResult, MODALITY_ATTRIBUTE, type MeResponse, type MenuBridge, type Message, type MessagesPage, type Metrics, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, type Notice, type NotifyChange, type NotifyPrefs, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, type OfflineEventDetails, type OfflineEventName, type OfflineHandler, type OfflineKindDefinition, type OfflineListener, type OfflineOp, type OpenInviteOptions, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Party, type PlayOnlineMethods, type PlayerCard, type PlayerLite, type PlayerRef, type Presence, type PresenceInput, type PresenceKind, type Profile, type ProfilePatch, type ProfileSummary, type ProfileUpdate, type QueueOp, type QueueOpInput, type QueuedScoreOptions, type REALTIME_FAILED_EVENT, type REALTIME_FEATURE_VERSION, type REALTIME_READY_EVENT, type REALTIME_SINGLETON_API, RESUME_DEBOUNCE_MS, RESUME_MAX_STATE_BYTES, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RealtimeApi, type RealtimeErrorShape, type RealtimeHubLink, type RecentPlayer, type Rect, type Relation, type ReplayContext, type ReportInput, type ReportKind, type ReportReason, type ResumeBlocker, type ResumeEntry, type ResumeLoadOptions, type ResumeProgress, type ResumeRun, type ResumeSaveInput, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomReclaimMethods, type RoomSeat, type RoomSeatChange, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, type Save, type SaveMeta, type SchemaOutput, type ServerEvents, type Snapshot, type SnapshotResponse, type SocialConfig, type SocialCounts, type SocialEvents, type SocialMe, type SortDir, type StatResult, type Stats, type SubmitScoreOptions, type SubmitScoreResult, type Suggestion, type SuggestionStatus, type SyncConflict, type SyncResult, type TouchMapping, type TradeBundle, type TradeId, type TradeListOptions, type TradeNoteOptions, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, type UiStack, type UiStackHandoff, type User, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, createHub, type findRealtimeApi, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, type isRealtimeApi, isUiStack, layoutControls, type linkRealtimeToHub, type multiplayerForwarder as mp, type notifyForwarder as notify, parseInputOverrides, type presenceForwarder as presence, type raceForwarder as race, type roomsForwarder as rooms, type socialForwarder as social, trackInputModality };
|
|
36
36
|
//# sourceMappingURL=auto.d.ts.map
|
package/dist/auto.js
CHANGED
|
@@ -2,7 +2,7 @@ import { a as DailySystem, i as DAILY_START_EVENT, n as getDaily, r as isDailySy
|
|
|
2
2
|
import { t as HUB_CLIENT_VERSION } from "./shared/client-version.gen.js";
|
|
3
3
|
import { a as isPageInputControl, c as layoutControls, d as MODALITY_ATTRIBUTE, f as trackInputModality, i as parseInputOverrides, l as boxesTouch, n as getInput, o as InputSystem, p as FOCUS_RING_SHADOW, r as isInputSystem, s as Overlay, t as INPUT_SINGLETON_API, u as controlSize } from "./shared/input.js";
|
|
4
4
|
import { n as isUiStack, r as UI_STACK_VERSION, t as getUiStack } from "./shared/page-stack.js";
|
|
5
|
-
import { a as
|
|
5
|
+
import { a as RESUME_DEBOUNCE_MS, c as OUTBOX_FULL_CODE, d as OfflineApi, f as ContentRejectedError, h as UNSUPPORTED_BY_HUB, i as HubResume, l as OUTBOX_MAX_CHARS, m as OfflineError, n as createHub, o as RESUME_MAX_STATE_BYTES, p as HubError, r as hub, s as CLIENT_VERSION_HEADER, t as Hub, u as OUTBOX_MAX_ENTRIES } from "./shared/src.js";
|
|
6
6
|
//#region src/auto.ts
|
|
7
7
|
/**
|
|
8
8
|
* `@diffenderfer-games/hub/auto`: everything the main entry exports, plus a
|
|
@@ -22,6 +22,6 @@ if (typeof window !== "undefined") window.HubSDK = {
|
|
|
22
22
|
ContentRejectedError
|
|
23
23
|
};
|
|
24
24
|
//#endregion
|
|
25
|
-
export { CLIENT_VERSION_HEADER, ContentRejectedError, DAILY_SINGLETON_API, DAILY_START_EVENT, DailySystem, FOCUS_RING_SHADOW, HUB_CLIENT_VERSION, Hub, HubError, INPUT_SINGLETON_API, InputSystem, MODALITY_ATTRIBUTE, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, Overlay, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, boxesTouch, controlSize, createHub, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides, trackInputModality };
|
|
25
|
+
export { CLIENT_VERSION_HEADER, ContentRejectedError, DAILY_SINGLETON_API, DAILY_START_EVENT, DailySystem, FOCUS_RING_SHADOW, HUB_CLIENT_VERSION, Hub, HubError, HubResume, INPUT_SINGLETON_API, InputSystem, MODALITY_ATTRIBUTE, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, Overlay, RESUME_DEBOUNCE_MS, RESUME_MAX_STATE_BYTES, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, boxesTouch, controlSize, createHub, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides, trackInputModality };
|
|
26
26
|
|
|
27
27
|
//# sourceMappingURL=auto.js.map
|
package/dist/doctor/cli.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { parseArgs } from "node:util";
|
|
|
5
5
|
import { GAME_LABELS, GamePackageJson, HubVersion, splitGameLabels } from "@diffenderfer-games/hub-contract";
|
|
6
6
|
//#region src/core/version/client-version.gen.ts
|
|
7
7
|
/** This client's package version, sent as `x-hub-client` on REST calls and `client` in `hello`. */
|
|
8
|
-
const HUB_CLIENT_VERSION = "2.0.0-next.
|
|
8
|
+
const HUB_CLIENT_VERSION = "2.0.0-next.4";
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/core/version/semver.ts
|
|
11
11
|
const VERSION_PATTERN = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ import { a as RaceHistoryQuery, c as RaceRuntimeApi, i as RaceEvents, l as RaceS
|
|
|
8
8
|
import { f as raceForwarder } from "./shared/race.js";
|
|
9
9
|
import { n as roomsForwarder } from "./shared/rooms.js";
|
|
10
10
|
import { $ as HubNotifyApi, A as RacerState, B as SuggestionStatus, C as RaceRecord, D as RaceStats, E as RaceState, F as ReportReason, G as REALTIME_READY_EVENT, H as isRealtimeApi, I as RoomInfo, J as RealtimeHubLink, K as REALTIME_SINGLETON_API, L as SocialConfig, M as Relation, N as ReportInput, O as Racer, P as ReportKind, Q as socialForwarder, R as SocialMe, S as RaceParams, T as RaceStatValue, U as REALTIME_FAILED_EVENT, V as findRealtimeApi, W as REALTIME_FEATURE_VERSION, X as notifyForwarder, Y as linkRealtimeToHub, Z as presenceForwarder, _ as PlayerLite, a as ErrorBody, at as SocialCounts, b as PresenceKind, c as JoinInfo, d as Message, et as HubPresenceApi, f as MessagesPage, g as PlayerCard, h as Party, i as Counts, it as PlayerRef, j as RecentPlayer, k as RacerResult, l as Launch, m as NotifyPrefs, n as ChatMode, nt as OpenInviteOptions, o as FriendEntry, ot as SocialEvents, p as NotifyChange, q as RealtimeApi, r as Conversation, rt as PlayOnlineMethods, s as Invite, t as Audience, tt as HubSocialApi, u as LaunchTicket, v as Presence, w as RaceResult, x as RaceOutcome, y as PresenceInput, z as Suggestion } from "./shared/social.js";
|
|
11
|
-
import { $ as
|
|
12
|
-
export { type Anchor, type Audience, type AuthResponse, type AutoPauseOptions, type AxisDef, type AxisSide, type Board, type BoardWithTop, type BufferedEvent, type BusyOptions, CLIENT_VERSION_HEADER, type ChatMode, type ClientSupport, ContentRejectedError, type Conversation, type Counts, DAILY_SINGLETON_API, DAILY_START_EVENT, type DailyAll, type DailyChallenge, type DailyCompleteResponse, type DailyCompletion, type DailyCompletionMeta, type DailyCompletions, type DailyDefinition, type DailyEventDetail, type DailyGameStatus, type DailyHost, type DailyStartResponse, type DailyStatus, DailySystem, type DraggedSpot, type EdgeOffsets, type EndpointFields, type EndpointName, type EndpointReply, type ErrorBody, FOCUS_RING_SHADOW, type FriendEntry, type GameAnalytics, type GameInfo, type GameLeaderboards, type GamePayload, type GameRecords, type GamepadMapping, type GlobalAnalytics, type GrantBundle, type GroupDef, HUB_CLIENT_VERSION, Hub, HubError, type HubErrorCode, type HubErrorDetails, type HubMenuControl, type HubMpApi, type HubNotifyApi, type HubOptions, type HubPresenceApi, type HubRaceApi, type HubRoom, type HubRoomsApi, type HubSocialApi, type HubStatus, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputModality, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type Inventory, type InventorySnapshot, type Invite, type InviteCreated, type InviteLink, type InviteLinkMethods, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type JoinOptions, type Json, type Launch, type LaunchTicket, type LayoutBox, type LayoutItem, type LayoutOptions, type LeaderboardEntry, type LeaderboardResult, MODALITY_ATTRIBUTE, type MeResponse, type MenuBridge, type Message, type MessagesPage, type Metrics, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, type Notice, type NotifyChange, type NotifyPrefs, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, type OfflineEventDetails, type OfflineEventName, type OfflineHandler, type OfflineKindDefinition, type OfflineListener, type OfflineOp, type OpenInviteOptions, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Party, type PlayOnlineMethods, type PlayerCard, type PlayerLite, type PlayerRef, type Presence, type PresenceInput, type PresenceKind, type Profile, type ProfilePatch, type ProfileSummary, type ProfileUpdate, type QueueOp, type QueueOpInput, type QueuedScoreOptions, type REALTIME_FAILED_EVENT, type REALTIME_FEATURE_VERSION, type REALTIME_READY_EVENT, type REALTIME_SINGLETON_API, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RealtimeApi, type RealtimeErrorShape, type RealtimeHubLink, type RecentPlayer, type Rect, type Relation, type ReplayContext, type ReportInput, type ReportKind, type ReportReason, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomReclaimMethods, type RoomSeat, type RoomSeatChange, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, type Save, type SaveMeta, type SchemaOutput, type ServerEvents, type Snapshot, type SnapshotResponse, type SocialConfig, type SocialCounts, type SocialEvents, type SocialMe, type SortDir, type StatResult, type Stats, type SubmitScoreOptions, type SubmitScoreResult, type Suggestion, type SuggestionStatus, type SyncConflict, type SyncResult, type TouchMapping, type TradeBundle, type TradeId, type TradeListOptions, type TradeNoteOptions, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, type UiStack, type UiStackHandoff, type User, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, createHub, type findRealtimeApi, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, type isRealtimeApi, isUiStack, layoutControls, type linkRealtimeToHub, type multiplayerForwarder as mp, type notifyForwarder as notify, parseInputOverrides, type presenceForwarder as presence, type raceForwarder as race, type roomsForwarder as rooms, type socialForwarder as social, trackInputModality };
|
|
11
|
+
import { $ as GameLeaderboards, A as SyncConflict, B as OfflineHandler, C as TradeBundle, Ct as EndpointReply, D as AuthResponse, E as TradeNoteOptions, F as OfflineEventName, G as QueueOp, H as ReplayContext, I as OfflineListener, J as BufferedEvent, K as QueueOpInput, L as OfflineOp, M as OfflineApi, N as OUTBOX_FULL_CODE, O as ProfileUpdate, P as OfflineEventDetails, Q as GameInfo, R as OUTBOX_MAX_CHARS, S as GrantBundle, St as EndpointName, T as TradeListOptions, U as CLIENT_VERSION_HEADER, V as OfflineKindDefinition, W as ProfilePatch, X as BoardWithTop, Y as Board, Z as GameAnalytics, _ as ResumeLoadOptions, _t as Stats, a as HubErrorDetails, at as InventorySnapshot, b as ResumeSaveInput, bt as User, c as Hub, ct as LeaderboardResult, d as ClientSupport, dt as Profile, et as GameRecords, f as HubResume, ft as ProfileSummary, g as ResumeEntry, gt as SortDir, h as ResumeBlocker, ht as SnapshotResponse, i as HubErrorCode, it as Inventory, j as SyncResult, k as StatResult, l as createHub, lt as MeResponse, m as RESUME_MAX_STATE_BYTES, mt as SaveMeta, n as ContentRejectedError, nt as HubOptions, o as OfflineError, ot as Json, p as RESUME_DEBOUNCE_MS, pt as Save, q as QueuedScoreOptions, r as HubError, rt as HubStatus, s as UNSUPPORTED_BY_HUB, st as LeaderboardEntry, t as HUB_CLIENT_VERSION, tt as GlobalAnalytics, u as hub, ut as Metrics, v as ResumeProgress, vt as SubmitScoreOptions, w as TradeId, wt as GamePayload, x as HubMenuControl, xt as EndpointFields, y as ResumeRun, yt as SubmitScoreResult, z as OUTBOX_MAX_ENTRIES } from "./shared/index.js";
|
|
12
|
+
export { type Anchor, type Audience, type AuthResponse, type AutoPauseOptions, type AxisDef, type AxisSide, type Board, type BoardWithTop, type BufferedEvent, type BusyOptions, CLIENT_VERSION_HEADER, type ChatMode, type ClientSupport, ContentRejectedError, type Conversation, type Counts, DAILY_SINGLETON_API, DAILY_START_EVENT, type DailyAll, type DailyChallenge, type DailyCompleteResponse, type DailyCompletion, type DailyCompletionMeta, type DailyCompletions, type DailyDefinition, type DailyEventDetail, type DailyGameStatus, type DailyHost, type DailyStartResponse, type DailyStatus, DailySystem, type DraggedSpot, type EdgeOffsets, type EndpointFields, type EndpointName, type EndpointReply, type ErrorBody, FOCUS_RING_SHADOW, type FriendEntry, type GameAnalytics, type GameInfo, type GameLeaderboards, type GamePayload, type GameRecords, type GamepadMapping, type GlobalAnalytics, type GrantBundle, type GroupDef, HUB_CLIENT_VERSION, Hub, HubError, type HubErrorCode, type HubErrorDetails, type HubMenuControl, type HubMpApi, type HubNotifyApi, type HubOptions, type HubPresenceApi, type HubRaceApi, HubResume, type HubRoom, type HubRoomsApi, type HubSocialApi, type HubStatus, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputModality, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type Inventory, type InventorySnapshot, type Invite, type InviteCreated, type InviteLink, type InviteLinkMethods, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type JoinOptions, type Json, type Launch, type LaunchTicket, type LayoutBox, type LayoutItem, type LayoutOptions, type LeaderboardEntry, type LeaderboardResult, MODALITY_ATTRIBUTE, type MeResponse, type MenuBridge, type Message, type MessagesPage, type Metrics, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, type Notice, type NotifyChange, type NotifyPrefs, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, type OfflineEventDetails, type OfflineEventName, type OfflineHandler, type OfflineKindDefinition, type OfflineListener, type OfflineOp, type OpenInviteOptions, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Party, type PlayOnlineMethods, type PlayerCard, type PlayerLite, type PlayerRef, type Presence, type PresenceInput, type PresenceKind, type Profile, type ProfilePatch, type ProfileSummary, type ProfileUpdate, type QueueOp, type QueueOpInput, type QueuedScoreOptions, type REALTIME_FAILED_EVENT, type REALTIME_FEATURE_VERSION, type REALTIME_READY_EVENT, type REALTIME_SINGLETON_API, RESUME_DEBOUNCE_MS, RESUME_MAX_STATE_BYTES, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RealtimeApi, type RealtimeErrorShape, type RealtimeHubLink, type RecentPlayer, type Rect, type Relation, type ReplayContext, type ReportInput, type ReportKind, type ReportReason, type ResumeBlocker, type ResumeEntry, type ResumeLoadOptions, type ResumeProgress, type ResumeRun, type ResumeSaveInput, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomReclaimMethods, type RoomSeat, type RoomSeatChange, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, type Save, type SaveMeta, type SchemaOutput, type ServerEvents, type Snapshot, type SnapshotResponse, type SocialConfig, type SocialCounts, type SocialEvents, type SocialMe, type SortDir, type StatResult, type Stats, type SubmitScoreOptions, type SubmitScoreResult, type Suggestion, type SuggestionStatus, type SyncConflict, type SyncResult, type TouchMapping, type TradeBundle, type TradeId, type TradeListOptions, type TradeNoteOptions, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, type UiStack, type UiStackHandoff, type User, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, createHub, type findRealtimeApi, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, type isRealtimeApi, isUiStack, layoutControls, type linkRealtimeToHub, type multiplayerForwarder as mp, type notifyForwarder as notify, parseInputOverrides, type presenceForwarder as presence, type raceForwarder as race, type roomsForwarder as rooms, type socialForwarder as social, trackInputModality };
|
package/dist/index.js
CHANGED
|
@@ -2,5 +2,5 @@ import { a as DailySystem, i as DAILY_START_EVENT, n as getDaily, r as isDailySy
|
|
|
2
2
|
import { t as HUB_CLIENT_VERSION } from "./shared/client-version.gen.js";
|
|
3
3
|
import { a as isPageInputControl, c as layoutControls, d as MODALITY_ATTRIBUTE, f as trackInputModality, i as parseInputOverrides, l as boxesTouch, n as getInput, o as InputSystem, p as FOCUS_RING_SHADOW, r as isInputSystem, s as Overlay, t as INPUT_SINGLETON_API, u as controlSize } from "./shared/input.js";
|
|
4
4
|
import { n as isUiStack, r as UI_STACK_VERSION, t as getUiStack } from "./shared/page-stack.js";
|
|
5
|
-
import { a as
|
|
6
|
-
export { CLIENT_VERSION_HEADER, ContentRejectedError, DAILY_SINGLETON_API, DAILY_START_EVENT, DailySystem, FOCUS_RING_SHADOW, HUB_CLIENT_VERSION, Hub, HubError, INPUT_SINGLETON_API, InputSystem, MODALITY_ATTRIBUTE, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, Overlay, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, boxesTouch, controlSize, createHub, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides, trackInputModality };
|
|
5
|
+
import { a as RESUME_DEBOUNCE_MS, c as OUTBOX_FULL_CODE, d as OfflineApi, f as ContentRejectedError, h as UNSUPPORTED_BY_HUB, i as HubResume, l as OUTBOX_MAX_CHARS, m as OfflineError, n as createHub, o as RESUME_MAX_STATE_BYTES, p as HubError, r as hub, s as CLIENT_VERSION_HEADER, t as Hub, u as OUTBOX_MAX_ENTRIES } from "./shared/src.js";
|
|
6
|
+
export { CLIENT_VERSION_HEADER, ContentRejectedError, DAILY_SINGLETON_API, DAILY_START_EVENT, DailySystem, FOCUS_RING_SHADOW, HUB_CLIENT_VERSION, Hub, HubError, HubResume, INPUT_SINGLETON_API, InputSystem, MODALITY_ATTRIBUTE, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, Overlay, RESUME_DEBOUNCE_MS, RESUME_MAX_STATE_BYTES, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, boxesTouch, controlSize, createHub, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides, trackInputModality };
|
package/dist/rooms.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { n as rooms } from "./shared/rooms.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/core/version/client-version.gen.ts
|
|
2
2
|
/** This client's package version, sent as `x-hub-client` on REST calls and `client` in `hello`. */
|
|
3
|
-
const HUB_CLIENT_VERSION = "2.0.0-next.
|
|
3
|
+
const HUB_CLIENT_VERSION = "2.0.0-next.4";
|
|
4
4
|
//#endregion
|
|
5
5
|
export { HUB_CLIENT_VERSION as t };
|
|
6
6
|
|
package/dist/shared/daily.d.ts
CHANGED
|
@@ -71,8 +71,12 @@ declare const DAILY_START_EVENT = "hub:daily-start";
|
|
|
71
71
|
/** Daily challenges (`hub.daily`). */
|
|
72
72
|
declare class DailySystem {
|
|
73
73
|
/**
|
|
74
|
-
* The challenge in progress
|
|
75
|
-
*
|
|
74
|
+
* The challenge in progress: set when a day starts; cleared the moment the
|
|
75
|
+
* game calls `complete` (whatever the hub answers, and before it answers)
|
|
76
|
+
* or `cancel`. A game's win handler checks it:
|
|
77
|
+
* `if (hub.daily.active) hub.daily.complete(…)`. While it is set the page
|
|
78
|
+
* is in a daily run, so `hub.resume.save` saves nothing: a game whose
|
|
79
|
+
* player leaves a daily unfinished must call `cancel()`.
|
|
76
80
|
*/
|
|
77
81
|
active: DailyChallenge | null;
|
|
78
82
|
private readonly host;
|
|
@@ -100,12 +104,17 @@ declare class DailySystem {
|
|
|
100
104
|
* Resolves with the new completion count and rank, or `null` when no
|
|
101
105
|
* challenge is active, the hub refused, or the hub can't be reached: then
|
|
102
106
|
* the completion is queued (`hub:daily-queued`) and replays when it is
|
|
103
|
-
* back (`hub:daily-complete` follows).
|
|
107
|
+
* back (`hub:daily-complete` follows). The daily run ends at the call,
|
|
108
|
+
* so `active` is `null` at once, even if the hub then refuses it.
|
|
104
109
|
*/
|
|
105
110
|
complete(meta?: DailyCompletionMeta): Promise<DailyCompleteResponse | null>;
|
|
106
111
|
/** Ask the page's other daily systems to start `day` (this one ignores its own event). */
|
|
107
112
|
private relayStart;
|
|
108
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Abandon the active challenge without recording it: the player quit, or
|
|
115
|
+
* left the daily for normal play (another level, a new game). Until then
|
|
116
|
+
* the page counts as in a daily run and `hub.resume.save` saves nothing.
|
|
117
|
+
*/
|
|
109
118
|
cancel(): void;
|
|
110
119
|
/** This game's window and the player's completions. */
|
|
111
120
|
status(): Promise<DailyStatus>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily.d.ts","names":[],"sources":["../../src/daily/types.ts","../../src/daily/daily-system.ts","../../src/daily/page-daily.ts"],"mappings":";;;;KAQK,cAAc,0BAA0B,kBAAkB,qBAAqB,gBAAgB;;KAGxF,cAAc;;KAGd,WAAW;;KAGX,kBAAkB;;KAGlB,qBAAqB;;KAGrB,wBAAwB;;UAGnB;;EAEf;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf,OAAO,WAAW;;;KAIR,sBAAsB,eAAe;;UAGhC;;WAEN;;EAET,UAAU,QAAQ;;EAElB,OAAO,QAAQ;;EAEf,MAAM,cAAc,QAAQ;;EAE5B,SAAS,aAAa,eAAe,MAAM,sBAAsB,QAAQ;;EAEzE,KAAK,cAAc,QAAQ;;;KAIjB;EACN;EAAa;EAAc;;EAC3B;EAAa;EAAe;EAAqB,MAAM;;EACvD;EAAa;EAAc,MAAM;;EACjC;EAAa;;;;;cCnDN;;cA0BA
|
|
1
|
+
{"version":3,"file":"daily.d.ts","names":[],"sources":["../../src/daily/types.ts","../../src/daily/daily-system.ts","../../src/daily/page-daily.ts"],"mappings":";;;;KAQK,cAAc,0BAA0B,kBAAkB,qBAAqB,gBAAgB;;KAGxF,cAAc;;KAGd,WAAW;;KAGX,kBAAkB;;KAGlB,qBAAqB;;KAGrB,wBAAwB;;UAGnB;;EAEf;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf,OAAO,WAAW;;;KAIR,sBAAsB,eAAe;;UAGhC;;WAEN;;EAET,UAAU,QAAQ;;EAElB,OAAO,QAAQ;;EAEf,MAAM,cAAc,QAAQ;;EAE5B,SAAS,aAAa,eAAe,MAAM,sBAAsB,QAAQ;;EAEzE,KAAK,cAAc,QAAQ;;;KAIjB;EACN;EAAa;EAAc;;EAC3B;EAAa;EAAe;EAAqB,MAAM;;EACvD;EAAa;EAAc,MAAM;;EACjC;EAAa;;;;;cCnDN;;cA0BA;;;;;;;;;EASX,QAAQ;mBACS;UACT;UACA;UACA;EAEI,YAAA,MAAM;;MAiBd;;;;;;EASJ,OAAO,YAAY;;;;;;;EAeb,aAAa,cAAc;;;;;;;;;EA0B3B,SAAS,OAAM,sBAA2B,QAAQ;;UAsBhD;;;;;;EAiBR;;EAKA,UAAU,QAAQ;;EAKlB,OAAO,QAAQ;;;;;cClKJ;;iBAIG,cAAc,qBAAqB,aAAa;;;;;;iBAWhD,SAAS,MAAM,YAAY"}
|
package/dist/shared/daily.js
CHANGED
|
@@ -34,8 +34,12 @@ var DailySystem = class {
|
|
|
34
34
|
_defineProperty(
|
|
35
35
|
this,
|
|
36
36
|
/**
|
|
37
|
-
* The challenge in progress
|
|
38
|
-
*
|
|
37
|
+
* The challenge in progress: set when a day starts; cleared the moment the
|
|
38
|
+
* game calls `complete` (whatever the hub answers, and before it answers)
|
|
39
|
+
* or `cancel`. A game's win handler checks it:
|
|
40
|
+
* `if (hub.daily.active) hub.daily.complete(…)`. While it is set the page
|
|
41
|
+
* is in a daily run, so `hub.resume.save` saves nothing: a game whose
|
|
42
|
+
* player leaves a daily unfinished must call `cancel()`.
|
|
39
43
|
*/
|
|
40
44
|
"active",
|
|
41
45
|
null
|
|
@@ -106,14 +110,15 @@ var DailySystem = class {
|
|
|
106
110
|
* Resolves with the new completion count and rank, or `null` when no
|
|
107
111
|
* challenge is active, the hub refused, or the hub can't be reached: then
|
|
108
112
|
* the completion is queued (`hub:daily-queued`) and replays when it is
|
|
109
|
-
* back (`hub:daily-complete` follows).
|
|
113
|
+
* back (`hub:daily-complete` follows). The daily run ends at the call,
|
|
114
|
+
* so `active` is `null` at once, even if the hub then refuses it.
|
|
110
115
|
*/
|
|
111
116
|
async complete(meta = {}) {
|
|
112
117
|
const challenge = this.active;
|
|
113
118
|
if (challenge === null) return null;
|
|
119
|
+
this.active = null;
|
|
114
120
|
try {
|
|
115
121
|
const completed = await this.host.complete(challenge.day, challenge.token, meta);
|
|
116
|
-
this.active = null;
|
|
117
122
|
if (completed === null) {
|
|
118
123
|
this.host.emit("hub:daily-queued", {
|
|
119
124
|
day: challenge.day,
|
|
@@ -147,7 +152,11 @@ var DailySystem = class {
|
|
|
147
152
|
this.isRelaying = false;
|
|
148
153
|
}
|
|
149
154
|
}
|
|
150
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Abandon the active challenge without recording it: the player quit, or
|
|
157
|
+
* left the daily for normal play (another level, a new game). Until then
|
|
158
|
+
* the page counts as in a daily run and `hub.resume.save` saves nothing.
|
|
159
|
+
*/
|
|
151
160
|
cancel() {
|
|
152
161
|
this.active = null;
|
|
153
162
|
}
|
|
@@ -188,7 +197,7 @@ let claimedDaily = null;
|
|
|
188
197
|
function getDaily(host) {
|
|
189
198
|
claimedDaily ?? (claimedDaily = claimSingleton({
|
|
190
199
|
name: "daily",
|
|
191
|
-
version: "2.0.0-next.
|
|
200
|
+
version: "2.0.0-next.4",
|
|
192
201
|
api: 1,
|
|
193
202
|
create: () => new DailySystem(host),
|
|
194
203
|
isInstance: isDailySystem
|
package/dist/shared/daily.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily.js","names":[],"sources":["../../src/daily/daily-system.ts","../../src/daily/page-daily.ts"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,cAAc;;AAGpB,MAAa,oBAAoB;;AAIjC,SAAS,SAAS,WAAmC;CACnD,OAAO,OAAO,cAAc,YAAY,YAAY,KAAK,SAAS,IAAI,YAAY;AACpF;;AAGA,SAAS,kBAAiC;CAGxC,MAAM,WAAW,OAAO,WAAW,cAAc,OAAO,SAAS,UAAU,QAAQ,gBAAgB,CAAC;CACpG,IAAI,aAAa,QAAQ,OAAO,aAAa,aAC3C,OAAO;CAET,OAAO,SAAS,IAAI,IAAI,SAAS,IAAI,CAAC,CAAC,aAAa,IAAI,OAAO,CAAC;AAClE;;AAIA,SAAS,UAAU,OAAwB;CACzC,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;;AAGA,IAAa,cAAb,MAAyB;
|
|
1
|
+
{"version":3,"file":"daily.js","names":[],"sources":["../../src/daily/daily-system.ts","../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a;EACpB;CACF;;;;;;CAOA,SAAe;EACb,KAAK,SAAS;CAChB;;CAGA,SAA+B;EAC7B,OAAO,KAAK,KAAK,OAAO;CAC1B;;CAGA,MAAyB;EACvB,OAAO,KAAK,KAAK,IAAI;CACvB;AACF;;;;;;;;ACrKA,MAAa,sBAAsB;;AAInC,SAAgB,cAAc,WAA8C;CAC1E,OAAO,WAAW,WAAW;EAAC;EAAU;EAAgB;EAAY;EAAU;EAAU;CAAK,CAAC;AAChG;AAEA,IAAI,eAAmC;;;;;;AAOvC,SAAgB,SAAS,MAA8B;CACrD,iBAAA,eAAiB,eAAe;EAC9B,MAAM;EACN,SAAA;EACA,KAAA;EACA,cAAc,IAAI,YAAY,IAAI;EAClC,YAAY;CACd,CAAC;CACD,OAAO;AACT"}
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { o as multiplayerForwarder } from "./mp.js";
|
|
|
4
4
|
import { f as raceForwarder } from "./race.js";
|
|
5
5
|
import { n as roomsForwarder } from "./rooms.js";
|
|
6
6
|
import { Q as socialForwarder, X as notifyForwarder, Z as presenceForwarder } from "./social.js";
|
|
7
|
-
import { Board, Board as Board$1, ErrorCode, GameInfo, GameLeaderboards, GameRecords, HubVersion, Inventory, Inventory as Inventory$1, Json, Json as Json$1, LeaderboardEntry, Metrics, Metrics as Metrics$1, PublicEndpoints, RejectReason, SessionUser, SortDir, SortDir as SortDir$1, Stats, Stats as Stats$1 } from "@diffenderfer-games/hub-contract";
|
|
7
|
+
import { Board, Board as Board$1, ErrorCode, GameInfo, GameLeaderboards, GameRecords, HubVersion, Inventory, Inventory as Inventory$1, Json, Json as Json$1, LeaderboardEntry, Metrics, Metrics as Metrics$1, PublicEndpoints, RejectReason, ResumeSlot, ResumeSummary, SessionUser, SortDir, SortDir as SortDir$1, Stats, Stats as Stats$1 } from "@diffenderfer-games/hub-contract";
|
|
8
8
|
import { CallReturn, ClientData } from "@ayepi/core/client";
|
|
9
9
|
//#region src/core/storage/key-value.d.ts
|
|
10
10
|
/**
|
|
@@ -544,6 +544,47 @@ declare class OfflineApi {
|
|
|
544
544
|
on<Name extends OfflineEventName>(name: Name, listener: OfflineListener<Name>): () => void;
|
|
545
545
|
}
|
|
546
546
|
//#endregion
|
|
547
|
+
//#region src/core/resume/local-resume.d.ts
|
|
548
|
+
/** A run as this device saved it. */
|
|
549
|
+
interface LocalRun {
|
|
550
|
+
readonly status: 'saved';
|
|
551
|
+
readonly userId: number | null;
|
|
552
|
+
/** When the game saved it, epoch ms. */
|
|
553
|
+
readonly at: number;
|
|
554
|
+
readonly label: string;
|
|
555
|
+
readonly fraction: number | null;
|
|
556
|
+
readonly title: string | null;
|
|
557
|
+
readonly version: number;
|
|
558
|
+
/** The game's title, for the Resume card before the hub knows the run. */
|
|
559
|
+
readonly gameTitle: string;
|
|
560
|
+
readonly state: Json;
|
|
561
|
+
readonly isSynced: boolean;
|
|
562
|
+
}
|
|
563
|
+
/** A run this device cleared (kept until the hub has the clear). */
|
|
564
|
+
interface LocalClear {
|
|
565
|
+
readonly status: 'cleared';
|
|
566
|
+
readonly userId: number | null;
|
|
567
|
+
readonly at: number;
|
|
568
|
+
readonly isSynced: boolean;
|
|
569
|
+
}
|
|
570
|
+
/** A device copy of one game's slot. */
|
|
571
|
+
type LocalResume = LocalRun | LocalClear;
|
|
572
|
+
/** The device copies of every game's slot. */
|
|
573
|
+
declare class LocalResumeStore {
|
|
574
|
+
private readonly store;
|
|
575
|
+
constructor(store: KeyValueStore);
|
|
576
|
+
/** `slug`'s copy, or `null`. */
|
|
577
|
+
read(slug: string): LocalResume | null;
|
|
578
|
+
/** Store `slug`'s copy; answers whether it stuck (a full storage refuses a large state). */
|
|
579
|
+
write(slug: string, record: LocalResume): boolean;
|
|
580
|
+
/** Forget `slug`'s copy. */
|
|
581
|
+
remove(slug: string): void;
|
|
582
|
+
/** The hub now has `slug`'s save or clear made at `at`: mark it synced (a clear is simply forgotten). */
|
|
583
|
+
markSynced(slug: string, at: number): void;
|
|
584
|
+
/** Every game's copy, by slug. */
|
|
585
|
+
all(): Map<string, LocalResume>;
|
|
586
|
+
}
|
|
587
|
+
//#endregion
|
|
547
588
|
//#region src/core/connection.d.ts
|
|
548
589
|
/** A queued op the hub refused during a sync (or that kept failing): dropped, with the reason. */
|
|
549
590
|
interface SyncConflict {
|
|
@@ -576,6 +617,8 @@ declare class HubConnection {
|
|
|
576
617
|
protected readonly store: LocalStore;
|
|
577
618
|
/** This game's queued operations. */
|
|
578
619
|
protected readonly outbox: Outbox;
|
|
620
|
+
/** The device copies of every game's resume slot (`hub.resume`). */
|
|
621
|
+
protected readonly resumeStore: LocalResumeStore;
|
|
579
622
|
private readonly offlineMode;
|
|
580
623
|
private isReachable;
|
|
581
624
|
private runningSync;
|
|
@@ -851,6 +894,154 @@ interface HubMenuControl {
|
|
|
851
894
|
readonly visible: boolean;
|
|
852
895
|
}
|
|
853
896
|
//#endregion
|
|
897
|
+
//#region src/core/offline/hub-kinds/resume-kind.d.ts
|
|
898
|
+
/** Send the run saved at `savedAt`; `state` only when the device copy couldn't hold it. */
|
|
899
|
+
type ResumeSavePayload = {
|
|
900
|
+
readonly action: 'save';
|
|
901
|
+
readonly savedAt: number;
|
|
902
|
+
readonly label: string;
|
|
903
|
+
readonly fraction: number | null;
|
|
904
|
+
readonly title: string | null;
|
|
905
|
+
readonly version: number;
|
|
906
|
+
readonly state?: Json;
|
|
907
|
+
};
|
|
908
|
+
/** Clear the run, unless one was saved after `before`. */
|
|
909
|
+
type ResumeClearPayload = {
|
|
910
|
+
readonly action: 'clear';
|
|
911
|
+
readonly before: number;
|
|
912
|
+
};
|
|
913
|
+
/** One resume op. */
|
|
914
|
+
type ResumePayload = ResumeSavePayload | ResumeClearPayload;
|
|
915
|
+
//#endregion
|
|
916
|
+
//#region src/core/resume/resume-types.d.ts
|
|
917
|
+
/** How far along a run is. */
|
|
918
|
+
interface ResumeProgress {
|
|
919
|
+
/** A short line the game writes, such as "Level 12" or "Round 3 of 5" (up to 60 characters). */
|
|
920
|
+
readonly label: string;
|
|
921
|
+
/** 0 to 1, drawn as a progress bar; leave it out when the game can't say. */
|
|
922
|
+
readonly fraction?: number | null;
|
|
923
|
+
}
|
|
924
|
+
/** A run to save. `TState` is the game's own JSON-safe state type. */
|
|
925
|
+
interface ResumeSaveInput<TState extends GamePayload> {
|
|
926
|
+
/** Everything the game needs to pick the run up again (up to 512 KB as JSON). */
|
|
927
|
+
readonly state: TState;
|
|
928
|
+
readonly progress: ResumeProgress;
|
|
929
|
+
/** An optional name for the run ("Klondike, draw 3"), shown under the game's name. */
|
|
930
|
+
readonly title?: string | null;
|
|
931
|
+
/** The game's state version (default 0). Bump it when `state` changes shape; see `load({ version })`. */
|
|
932
|
+
readonly version?: number;
|
|
933
|
+
}
|
|
934
|
+
/** A saved run, read back. */
|
|
935
|
+
interface ResumeRun<TState> {
|
|
936
|
+
readonly state: TState;
|
|
937
|
+
readonly progress: {
|
|
938
|
+
readonly label: string;
|
|
939
|
+
readonly fraction: number | null;
|
|
940
|
+
};
|
|
941
|
+
readonly title: string | null;
|
|
942
|
+
readonly version: number;
|
|
943
|
+
/** When the game saved it, epoch ms. */
|
|
944
|
+
readonly savedAt: number;
|
|
945
|
+
}
|
|
946
|
+
/** Options for reading the run back. */
|
|
947
|
+
interface ResumeLoadOptions {
|
|
948
|
+
/**
|
|
949
|
+
* The state version this code reads. A run saved with an older version is
|
|
950
|
+
* dropped (cleared) and reads as `null`; a newer one (from a newer copy of
|
|
951
|
+
* the game in another tab) reads as `null` but is kept.
|
|
952
|
+
*/
|
|
953
|
+
readonly version?: number;
|
|
954
|
+
}
|
|
955
|
+
/** One saved run in the player's list (the home page's Resume card). */
|
|
956
|
+
interface ResumeEntry {
|
|
957
|
+
/** The game's slug. */
|
|
958
|
+
readonly slug: string;
|
|
959
|
+
readonly gameTitle: string;
|
|
960
|
+
/** The game's URL path, like `/solitaire`. */
|
|
961
|
+
readonly path: string;
|
|
962
|
+
/** The game has a tile image (`/_tiles/<slug>`). */
|
|
963
|
+
readonly hasImage: boolean;
|
|
964
|
+
readonly progress: {
|
|
965
|
+
readonly label: string;
|
|
966
|
+
readonly fraction: number | null;
|
|
967
|
+
};
|
|
968
|
+
readonly title: string | null;
|
|
969
|
+
/** When it was saved, epoch ms. */
|
|
970
|
+
readonly savedAt: number;
|
|
971
|
+
/** Saved on this device and not yet sent to the hub (offline, or the tab closed first). */
|
|
972
|
+
readonly isLocalOnly: boolean;
|
|
973
|
+
}
|
|
974
|
+
/** Why a save was ignored: the page is in a race, a daily challenge or an online room. */
|
|
975
|
+
type ResumeBlocker = 'race' | 'daily' | 'room';
|
|
976
|
+
//#endregion
|
|
977
|
+
//#region src/core/resume/hub-resume.d.ts
|
|
978
|
+
/** How long saves must be quiet before the latest is sent, ms. */
|
|
979
|
+
declare const RESUME_DEBOUNCE_MS = 3000;
|
|
980
|
+
/** Largest state, bytes of JSON (the contract's `RESUME_MAX_STATE_BYTES`). */
|
|
981
|
+
declare const RESUME_MAX_STATE_BYTES: number;
|
|
982
|
+
/** What `hub.resume` needs from its client. */
|
|
983
|
+
interface ResumeHost {
|
|
984
|
+
/** This game's slug; `null` on the home page. */
|
|
985
|
+
readonly slug: string | null;
|
|
986
|
+
readonly local: LocalResumeStore;
|
|
987
|
+
/** The signed-in player's id as the device knows it, or `null`. */
|
|
988
|
+
currentUserId(): number | null;
|
|
989
|
+
/** The game's display title. */
|
|
990
|
+
gameTitle(): string;
|
|
991
|
+
/** Why saving is off right now, or `null`. */
|
|
992
|
+
blocker(): ResumeBlocker | null;
|
|
993
|
+
/** Perform a resume op: at once when online with nothing waiting, else queued. */
|
|
994
|
+
send(payload: ResumePayload): Promise<void>;
|
|
995
|
+
/** This game's run on the hub, or `undefined` when the hub can't be reached. */
|
|
996
|
+
fetchSlot(): Promise<ResumeSlot | null | undefined>;
|
|
997
|
+
/** The player's runs on the hub, or `undefined` when it can't be reached. */
|
|
998
|
+
fetchList(): Promise<ResumeSummary[] | undefined>;
|
|
999
|
+
/** Clear another game's run on the hub (the home page's discard); throws offline. */
|
|
1000
|
+
clearOther(slug: string): Promise<void>;
|
|
1001
|
+
}
|
|
1002
|
+
/** `hub.resume`. */
|
|
1003
|
+
declare class HubResume {
|
|
1004
|
+
private readonly host;
|
|
1005
|
+
private timer;
|
|
1006
|
+
private waiting;
|
|
1007
|
+
private isListening;
|
|
1008
|
+
private readonly warnedBlockers;
|
|
1009
|
+
constructor(host: ResumeHost);
|
|
1010
|
+
/**
|
|
1011
|
+
* `true` when the page was opened from the Resume card (`?hub_resume=1`,
|
|
1012
|
+
* taken out of the address bar). Synchronous, so a game can restore before
|
|
1013
|
+
* it routes or draws its title screen.
|
|
1014
|
+
*/
|
|
1015
|
+
get requested(): boolean;
|
|
1016
|
+
/** Why a save would be ignored right now (`race`, `daily`, `room`), or `null`. */
|
|
1017
|
+
get blockedBy(): ResumeBlocker | null;
|
|
1018
|
+
/**
|
|
1019
|
+
* Save the run (the latest save wins). Stored on the device at once; sent
|
|
1020
|
+
* after {@link RESUME_DEBOUNCE_MS} of quiet, or when the page is hidden.
|
|
1021
|
+
* Returns `false` (and saves nothing) in a race, a daily challenge or an
|
|
1022
|
+
* online room. Throws a `HubError` 413 over 512 KB, 400 without a label.
|
|
1023
|
+
*/
|
|
1024
|
+
save<TState extends GamePayload>(run: ResumeSaveInput<TState>): boolean;
|
|
1025
|
+
/** Send a waiting save now (the page does this itself when hidden or closed). */
|
|
1026
|
+
flush(): Promise<void>;
|
|
1027
|
+
/** Clear the run: call it when the run ends (won, lost or quit). Works offline. */
|
|
1028
|
+
clear(): Promise<void>;
|
|
1029
|
+
/** The saved run with its progress and time, or `null`. The newer of the device's copy and the hub's wins. */
|
|
1030
|
+
get<TState = GamePayload>(options?: ResumeLoadOptions): Promise<ResumeRun<TState> | null>;
|
|
1031
|
+
/** The saved state, or `null` (see {@link get} for the version rule). */
|
|
1032
|
+
load<TState = GamePayload>(options?: ResumeLoadOptions): Promise<TState | null>;
|
|
1033
|
+
/** The player's saved runs in every resumable game, newest first (the home page's Resume card). */
|
|
1034
|
+
list(): Promise<ResumeEntry[]>;
|
|
1035
|
+
/** Discard another game's run from the home page (online only: throws a `HubError` offline). */
|
|
1036
|
+
discard(slug: string): Promise<void>;
|
|
1037
|
+
/** Say once per blocker why saves are ignored, so a game that forgot `hub.daily.cancel()` finds out. */
|
|
1038
|
+
private warnBlocked;
|
|
1039
|
+
private requireSlug;
|
|
1040
|
+
private schedule;
|
|
1041
|
+
/** Send a waiting save as soon as the page is hidden or closed. */
|
|
1042
|
+
private listenToPage;
|
|
1043
|
+
}
|
|
1044
|
+
//#endregion
|
|
854
1045
|
//#region src/core/version/hub-version.d.ts
|
|
855
1046
|
/** How a hub regards a client version. */
|
|
856
1047
|
type ClientSupport =
|
|
@@ -868,6 +1059,7 @@ type ClientSupport =
|
|
|
868
1059
|
declare class Hub extends HubEconomy {
|
|
869
1060
|
/** This client's package version (sent as `x-hub-client`). */
|
|
870
1061
|
readonly clientVersion: string;
|
|
1062
|
+
private resumeApi;
|
|
871
1063
|
/**
|
|
872
1064
|
* The hub's version and the client versions it supports (`GET /_api/version`),
|
|
873
1065
|
* read once per page. `null` for a hub from before versioning.
|
|
@@ -903,6 +1095,14 @@ declare class Hub extends HubEconomy {
|
|
|
903
1095
|
get notify(): typeof notifyForwarder;
|
|
904
1096
|
/** Races: a single-player game becomes multiplayer by racing. */
|
|
905
1097
|
get race(): typeof raceForwarder;
|
|
1098
|
+
/**
|
|
1099
|
+
* Resume a saved game: `hub.resume.save({ state, progress })` during a long
|
|
1100
|
+
* single-player run, `clear()` when it ends, `load()` and `requested` to
|
|
1101
|
+
* pick it up again (docs: "Resume saved games"). Needs `game.resumable: true`.
|
|
1102
|
+
*/
|
|
1103
|
+
get resume(): HubResume;
|
|
1104
|
+
/** What `hub.resume` needs from this client. */
|
|
1105
|
+
private resumeHost;
|
|
906
1106
|
/** What the daily system needs from this client: its REST calls and window events. */
|
|
907
1107
|
private dailyHost;
|
|
908
1108
|
}
|
|
@@ -979,7 +1179,7 @@ declare class ContentRejectedError extends HubError {
|
|
|
979
1179
|
//#endregion
|
|
980
1180
|
//#region src/core/version/client-version.gen.d.ts
|
|
981
1181
|
/** This client's package version, sent as `x-hub-client` on REST calls and `client` in `hello`. */
|
|
982
|
-
declare const HUB_CLIENT_VERSION = "2.0.0-next.
|
|
1182
|
+
declare const HUB_CLIENT_VERSION = "2.0.0-next.4";
|
|
983
1183
|
//#endregion
|
|
984
|
-
export {
|
|
1184
|
+
export { GameLeaderboards as $, SyncConflict as A, OfflineHandler as B, TradeBundle as C, EndpointReply as Ct, AuthResponse as D, TradeNoteOptions as E, OfflineEventName as F, QueueOp as G, ReplayContext as H, OfflineListener as I, BufferedEvent as J, QueueOpInput as K, OfflineOp as L, OfflineApi as M, OUTBOX_FULL_CODE as N, ProfileUpdate as O, OfflineEventDetails as P, GameInfo$1 as Q, OUTBOX_MAX_CHARS as R, GrantBundle as S, EndpointName as St, TradeListOptions as T, CLIENT_VERSION_HEADER as U, OfflineKindDefinition as V, ProfilePatch as W, BoardWithTop as X, Board$1 as Y, GameAnalytics as Z, ResumeLoadOptions as _, Stats$1 as _t, HubErrorDetails as a, InventorySnapshot as at, ResumeSaveInput as b, User as bt, Hub as c, LeaderboardResult as ct, ClientSupport as d, Profile as dt, GameRecords as et, HubResume as f, ProfileSummary as ft, ResumeEntry as g, SortDir$1 as gt, ResumeBlocker as h, SnapshotResponse as ht, HubErrorCode as i, Inventory$1 as it, SyncResult as j, StatResult as k, createHub as l, MeResponse as lt, RESUME_MAX_STATE_BYTES as m, SaveMeta as mt, ContentRejectedError as n, HubOptions as nt, OfflineError as o, Json$1 as ot, RESUME_DEBOUNCE_MS as p, Save as pt, QueuedScoreOptions as q, HubError as r, HubStatus as rt, UNSUPPORTED_BY_HUB as s, LeaderboardEntry as st, HUB_CLIENT_VERSION as t, GlobalAnalytics as tt, hub as u, Metrics$1 as ut, ResumeProgress as v, SubmitScoreOptions as vt, TradeId as w, GamePayload as wt, HubMenuControl as x, EndpointFields as xt, ResumeRun as y, SubmitScoreResult as yt, OUTBOX_MAX_ENTRIES as z };
|
|
985
1185
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["GameInfo","ContractGameInfo","GameInfo","presence","social","mp","rooms","notify","race"],"sources":["../../src/core/storage/key-value.ts","../../src/core/game-data.ts","../../src/core/rest/endpoint-types.ts","../../src/core/types.ts","../../src/core/offline/events.ts","../../src/core/offline/queue.ts","../../src/core/offline/local-store.ts","../../src/core/rest/rest-client.ts","../../src/core/offline/outbox-entry.ts","../../src/core/offline/outbox-kinds.ts","../../src/core/offline/outbox-store.ts","../../src/core/offline/outbox-replayer.ts","../../src/core/offline/outbox.ts","../../src/core/offline/offline-api.ts","../../src/core/connection.ts","../../src/core/hub-progress.ts","../../src/core/hub-economy.ts","../../src/core/menu-control.ts","../../src/core/version/hub-version.ts","../../src/core/hub.ts","../../src/core/errors.ts","../../src/core/version/client-version.gen.ts"],"mappings":";;;;;;;;;;;;;;;;UAQiB;;EAEf,KAAK;;EAEL,MAAM,aAAa;;EAEnB,OAAO;;EAEP;;;;;KCLU;;;;KCFA,qBAAqB;;KAGrB,eAAe,UAAU,gBAAgB,WAAW,gBAAgB;;;;;KAM3E,UAAU,SAAS;WAAyB;WAAyB,YAAY;IAAS,OAAO;;KAG1F,cAAc,UAAU,gBAAgB,UAAU,QAAQ,WAAW,gBAAgB;;;;KCNrF,OAAO,KAAK,kCAAkC,QAAQ,KAAK;;UAGtD;;WAEN;;WAEA;;;UAIM;;WAEN,MAAM;;WAEN,UAAU;;;UAIJ,QAAQ,QAAQ;;WAEtB;;WAEA;;WAEA,MAAM;;WAEN;;;UAIM;;WAEN;;WAEA;;WAEA;;;UAIM,KAAK,QAAQ,cAAc;;WAEjC,MAAM;;;UAIA,mBAAmB,cAAc,cAAc;;WAErD;;WAEA,OAAO;;WAEP,OAAO;;;UAID;;WAEN,OA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AEjD;;WAEA;;WAEA;WACA;;;cAIE;;WAEF,OAAK;;WAEL,SAAS;mBACD;mBACA;mBACA;UACT;UACA;UACA;mBACS;;EAKL,YAAA,SAAS;;EAwBrB,OAAO,cAAc,YAAY;;EAKjC,MAAM,cAAc,SAAS,OAAO;;;;;;EAWpC,IAAI,IAAI;;EAkBF,OAAO,IAAI,cAAc,QAAQ;;EASjC,OAAO,oBAAkB,QAAQ;;EAYvC,WAAW;;EAKX;;EAKA,GAAG,aAAa,kBAAkB,MAAM,MAAM,UAAU,gBAAgB;UAQhE;UAYA;UAgBA;UAcA;;;;;UC9MO;;WAEN,QAAQ;;EAEjB;;;cAIW;mBACM;;EAGL,YAAA,MAAM;;;;;;EASlB,OAAO,gBAAgB,aAAa,cAAc,YAAY,eAAe,WAAW,sBAAsB;;;;;;;EAc9G,QAAQ,cAAc,SAAS,cAAc;;EAQ7C,WAAW;;EAKX,GAAG,aAAa,kBAAkB,MAAM,MAAM,UAAU,gBAAgB;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["GameInfo","ContractGameInfo","GameInfo","presence","social","mp","rooms","notify","race"],"sources":["../../src/core/storage/key-value.ts","../../src/core/game-data.ts","../../src/core/rest/endpoint-types.ts","../../src/core/types.ts","../../src/core/offline/events.ts","../../src/core/offline/queue.ts","../../src/core/offline/local-store.ts","../../src/core/rest/rest-client.ts","../../src/core/offline/outbox-entry.ts","../../src/core/offline/outbox-kinds.ts","../../src/core/offline/outbox-store.ts","../../src/core/offline/outbox-replayer.ts","../../src/core/offline/outbox.ts","../../src/core/offline/offline-api.ts","../../src/core/resume/local-resume.ts","../../src/core/connection.ts","../../src/core/hub-progress.ts","../../src/core/hub-economy.ts","../../src/core/menu-control.ts","../../src/core/offline/hub-kinds/resume-kind.ts","../../src/core/resume/resume-types.ts","../../src/core/resume/hub-resume.ts","../../src/core/version/hub-version.ts","../../src/core/hub.ts","../../src/core/errors.ts","../../src/core/version/client-version.gen.ts"],"mappings":";;;;;;;;;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AQ;;;;;;MASR,SAAS;;MAKT,mBAAmBC;;MAKnB,iBAAiBC;;MAKjB,aAAaC;;MAKb,gBAAgBC;;MAKhB,iBAAiBC;;MAKjB,eAAeC;;;;;;MASf,UAAU;;UAMN;;UAiCA;;;cAqBG,KAAK;;iBAMF,UAAU,UAAS,aAAkB;;;;;;;cCzKxC;;cAGA;;;;;;KAOD,eAAe,mBAAmB,4BAA4B,yBAAyB;;UAGlF;;WAEN,OAAO;;WAEP,SAAS,yBAAyB;;WAElC;;WAEA;;WAEA;;;;;;;;cASE,iBAAiB;;WAEnB;;WAEA,MAAM;;WAEN;;WAEA;;WAEA;;WAEA;;EAGG,YAAA,iBAAiB,iBAAiB,UAAS;;MAYnD;;;cAMO,qBAAqB;;EAEpB,YAAA;;;;;;;cAWD,6BAA6B;;EAE5B,YAAA,iBAAiB,4BAA4B,SAAS;;;;;cC1FvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","names":[],"sources":["../../src/realtime/rooms-forwarder.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"rooms.d.ts","names":[],"sources":["../../src/realtime/rooms-forwarder.ts"],"mappings":";;;;;cA4Fa,gBAAgB"}
|
package/dist/shared/rooms.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { r as _defineProperty } from "./globals.js";
|
|
2
2
|
import { n as pageBridge, r as rethrowAsHubError, t as outdatedRuntime } from "./bridge.js";
|
|
3
3
|
//#region src/realtime/rooms-forwarder.ts
|
|
4
|
+
/** The rooms this page is in (created, joined or reclaimed, and not yet left or closed). */
|
|
5
|
+
const openRooms = /* @__PURE__ */ new Set();
|
|
6
|
+
/** Whether this page is in a hub room right now. */
|
|
7
|
+
function isInHubRoom() {
|
|
8
|
+
return openRooms.size > 0;
|
|
9
|
+
}
|
|
4
10
|
/** A runtime room whose rejections are re-created as the core client's errors. */
|
|
5
11
|
var ForwardedRoom = class {
|
|
6
12
|
constructor(room) {
|
|
7
13
|
_defineProperty(this, "room", void 0);
|
|
8
14
|
this.room = room;
|
|
15
|
+
openRooms.add(room);
|
|
16
|
+
room.on("closed", () => {
|
|
17
|
+
openRooms.delete(room);
|
|
18
|
+
});
|
|
9
19
|
}
|
|
10
20
|
get info() {
|
|
11
21
|
return this.room.info;
|
|
@@ -47,6 +57,7 @@ var ForwardedRoom = class {
|
|
|
47
57
|
return rethrowAsHubError(this.room.kick(userId));
|
|
48
58
|
}
|
|
49
59
|
leave() {
|
|
60
|
+
openRooms.delete(this.room);
|
|
50
61
|
return rethrowAsHubError(this.room.leave());
|
|
51
62
|
}
|
|
52
63
|
end(results) {
|
|
@@ -65,6 +76,6 @@ const roomsForwarder = {
|
|
|
65
76
|
})
|
|
66
77
|
};
|
|
67
78
|
//#endregion
|
|
68
|
-
export { roomsForwarder as t };
|
|
79
|
+
export { roomsForwarder as n, isInHubRoom as t };
|
|
69
80
|
|
|
70
81
|
//# sourceMappingURL=rooms.js.map
|