@crowdedkingdoms/crowdyjs 18.10.0 → 18.11.0-dev.1
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/MIGRATION.md +43 -0
- package/README.md +79 -30
- package/dist/crowdy-client.d.ts +11 -3
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +25 -4
- package/dist/default-origin.d.ts +6 -6
- package/dist/default-origin.d.ts.map +1 -1
- package/dist/default-origin.js +6 -6
- package/dist/domains/exec.d.ts +6 -0
- package/dist/domains/exec.d.ts.map +1 -1
- package/dist/domains/exec.js +28 -2
- package/dist/generated/graphql-schema.d.ts +1 -1
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/kit/index.d.ts +13 -2
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +13 -2
- package/dist/kit/kit.d.ts +83 -7
- package/dist/kit/kit.d.ts.map +1 -1
- package/dist/kit/kit.js +82 -4
- package/dist/kit/mirror.d.ts +111 -0
- package/dist/kit/mirror.d.ts.map +1 -0
- package/dist/kit/mirror.js +295 -0
- package/dist/kit/modules/matchmaking.d.ts +107 -0
- package/dist/kit/modules/matchmaking.d.ts.map +1 -0
- package/dist/kit/modules/matchmaking.js +109 -0
- package/dist/kit/modules/npcs.d.ts +80 -0
- package/dist/kit/modules/npcs.d.ts.map +1 -0
- package/dist/kit/modules/npcs.js +102 -0
- package/dist/kit/modules/presence.d.ts +81 -0
- package/dist/kit/modules/presence.d.ts.map +1 -0
- package/dist/kit/modules/presence.js +99 -0
- package/dist/kit/modules/sessions.d.ts +91 -0
- package/dist/kit/modules/sessions.d.ts.map +1 -0
- package/dist/kit/modules/sessions.js +84 -0
- package/dist/kit/modules/world.d.ts +69 -0
- package/dist/kit/modules/world.d.ts.map +1 -0
- package/dist/kit/modules/world.js +35 -0
- package/dist/kit/protocol.d.ts +128 -0
- package/dist/kit/protocol.d.ts.map +1 -0
- package/dist/kit/protocol.js +171 -0
- package/dist/kit/realtime.d.ts +72 -0
- package/dist/kit/realtime.d.ts.map +1 -0
- package/dist/kit/realtime.js +108 -0
- package/dist/kit/runtime.d.ts +90 -0
- package/dist/kit/runtime.d.ts.map +1 -0
- package/dist/kit/runtime.js +194 -0
- package/dist/kit/store.d.ts +20 -0
- package/dist/kit/store.d.ts.map +1 -0
- package/dist/kit/store.js +25 -0
- package/dist/kit/topology.d.ts +69 -0
- package/dist/kit/topology.d.ts.map +1 -0
- package/dist/kit/topology.js +156 -0
- package/dist/kit/wire.d.ts +45 -5
- package/dist/kit/wire.d.ts.map +1 -1
- package/dist/kit/wire.js +51 -5
- package/dist/live-coding/assets/browser-authoring-index.json +1 -1
- package/dist/live-coding/assets/manifest.json +1 -1
- package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
- package/dist/live-coding/browser-authoring-index.generated.js +1935 -45
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* never an untrusted browser.
|
|
47
47
|
*/
|
|
48
48
|
/** The published package version. Mirrors `package.json`. */
|
|
49
|
-
export declare const VERSION = "18.
|
|
49
|
+
export declare const VERSION = "18.11.0-dev.1";
|
|
50
50
|
export { LbCookieStore } from './lb-cookie-store.js';
|
|
51
51
|
export { CrowdyClient, createCrowdyClient, type CrowdyClientConfig, } from './crowdy-client.js';
|
|
52
52
|
export { CROWDY_DEFAULT_TIER, CROWDY_DEFAULT_HOST, CROWDY_DEFAULT_HTTP_ORIGIN, CROWDY_DEFAULT_WS_ORIGIN, } from './default-origin.js';
|
|
@@ -59,7 +59,7 @@ export { VIDEO_FRAGMENT_HEADER_BYTES, MAX_VIDEO_FRAGMENT_BODY_BYTES, MAX_VIDEO_F
|
|
|
59
59
|
export { VOICE_HEADER_BYTES, VOICE_HEADER_VERSION, MAX_VOICE_FRAME_BYTES, VOICE_TARGET_DELAY_MS, VOICE_JITTER_MAX_FRAMES, VOICE_RESET_AFTER_MS, VoiceCodec, VoiceFlag, voiceClockRate, voiceSamplesPerFrame, voiceSeqDiff, encodeVoiceHeader, encodeVoicePacket, decodeVoicePacket, VoicePacketizer, VoiceJitterBuffer, type VoiceHeader, type VoicePacket, type VoicePacketizerOptions, type VoiceJitterBufferOptions, type VoicePushResult, type VoicePlayout, } from './media/voice-frames.js';
|
|
60
60
|
export { RealtimeMetrics, payloadBytesOf, type RealtimeMetricsCounters, type RealtimeMetricsKind, type RealtimeMetricsSnapshot, } from './metrics.js';
|
|
61
61
|
export { WorldClient, ActorClient, type ActorOptions } from './world.js';
|
|
62
|
-
export
|
|
62
|
+
export * from './kit/index.js';
|
|
63
63
|
export type { StateCodec, Ticker, WorldSession, WorldSessionConfig, WorldStoresClient, } from './stores/index.js';
|
|
64
64
|
export { ACCESS_NOT_GRANTED_CODE, ACCESS_REVOKED_CODE, ACCESS_SUSPENDED_CODE, ACCOUNT_BLOCKED_CODE, GROUP_MEMBER_BANNED_CODE, accountBlockedOf, groupMemberBannedOf, ACTOR_EXISTS_CODE, APP_PAUSED_CODE, accessRefusalOf, actorExistsOf, appPausedOf, isAppPaused, APP_UNAVAILABLE_CODE, CrowdyAppUnavailableError, CrowdyError, CrowdyGraphQLError, CrowdyHttpError, CrowdyNetworkError, CrowdyProtocolError, CrowdyRealtimeError, CrowdyTimeoutError, CrowdyUserCodeFaultError, playerFaultOf, WRONG_DATACENTER_CODE, } from './errors.js';
|
|
65
65
|
export type { AppPauseReason, CrowdyAccessRefusal, CrowdyFaultBlame, CrowdyFaultCode, CrowdyPlayerFault, } from './errors.js';
|
|
@@ -98,7 +98,7 @@ export { ServerStatusAPI } from './domains/serverStatus.js';
|
|
|
98
98
|
export { ChannelsAPI } from './domains/channels.js';
|
|
99
99
|
export { TeamsAPI } from './domains/teams.js';
|
|
100
100
|
export { UdpAPI } from './domains/udp.js';
|
|
101
|
-
export { ExecAPI, ExecConnection, EXEC_CLOSE_ACCESS_ENDED, CrowdyExecError, EXEC_STATUSES, execStatus, execGatewayRefusal, encodeExecFrame, decodeExecFrame, type ExecStatus, type ExecClientFrame, type ExecServerFrame, type ExecPush, type ExecPushHandler, type ExecEndpoint, type ExecConnectOptions, type ExecWebSocketCtor, type ExecNodeTypeInput, type ExecDeployOptions, type ExecCrate, type ExecSourceFile, type ExecBuild, type ExecBuildArtifact, type ExecStarter, type ExecStarterPack, type ExecLogLine, type ExecLogsOptions, type ExecInstance, type ExecVersion, type ExecManifest, type ExecManifestType, type ExecAppStatus, type ExecRestartResult, type ExecEndpointStat, type ExecEndpointStatsOptions, ExecModScope, execModType, EXEC_CLIENT_ABI_VERSION, type ExecMod, type ExecModListing, type ExecModSwitch, type ExecClientCapabilitySummary, type ExecModClient, type ExecGridClientMod, type ExecModClientArtifact, type ExecModClientArtifactBytes, } from './domains/exec.js';
|
|
101
|
+
export { ExecAPI, ExecConnection, EXEC_CLOSE_ACCESS_ENDED, CrowdyExecError, EXEC_STATUSES, execStatus, execGatewayRefusal, execWireIntegers, encodeExecFrame, decodeExecFrame, type ExecStatus, type ExecClientFrame, type ExecServerFrame, type ExecPush, type ExecPushHandler, type ExecEndpoint, type ExecConnectOptions, type ExecWebSocketCtor, type ExecNodeTypeInput, type ExecDeployOptions, type ExecCrate, type ExecSourceFile, type ExecBuild, type ExecBuildArtifact, type ExecStarter, type ExecStarterPack, type ExecLogLine, type ExecLogsOptions, type ExecInstance, type ExecVersion, type ExecManifest, type ExecManifestType, type ExecAppStatus, type ExecRestartResult, type ExecEndpointStat, type ExecEndpointStatsOptions, ExecModScope, execModType, EXEC_CLIENT_ABI_VERSION, type ExecMod, type ExecModListing, type ExecModSwitch, type ExecClientCapabilitySummary, type ExecModClient, type ExecGridClientMod, type ExecModClientArtifact, type ExecModClientArtifactBytes, } from './domains/exec.js';
|
|
102
102
|
export { CrowdyStudioAPI } from './domains/crowdyStudio.js';
|
|
103
103
|
export { PlayerWalletAPI } from './domains/playerWallet.js';
|
|
104
104
|
export { MarketplaceAPI } from './domains/marketplace.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,OAAO,kBAAkB,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,6BAA6B,EAC7B,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,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,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,+BAA+B,EAC/B,oBAAoB,EACpB,YAAY,EACZ,eAAe,EAEf,KAAK,EACL,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,EACL,8BAA8B,EAC9B,uBAAuB,EACvB,wBAAwB,EACxB,KAAK,EACL,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,4BAA4B,EAE5B,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EAErB,OAAO,GACR,MAAM,wBAAwB,CAAC;AAMhC,YAAY,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* never an untrusted browser.
|
|
47
47
|
*/
|
|
48
48
|
/** The published package version. Mirrors `package.json`. */
|
|
49
|
-
export const VERSION = '18.
|
|
49
|
+
export const VERSION = '18.11.0-dev.1';
|
|
50
50
|
export { LbCookieStore } from './lb-cookie-store.js';
|
|
51
51
|
export { CrowdyClient, createCrowdyClient, } from './crowdy-client.js';
|
|
52
52
|
// The tier this build defaults to, exported so a consumer can PRINT what it is
|
|
@@ -63,7 +63,9 @@ export { VIDEO_FRAGMENT_HEADER_BYTES, MAX_VIDEO_FRAGMENT_BODY_BYTES, MAX_VIDEO_F
|
|
|
63
63
|
export { VOICE_HEADER_BYTES, VOICE_HEADER_VERSION, MAX_VOICE_FRAME_BYTES, VOICE_TARGET_DELAY_MS, VOICE_JITTER_MAX_FRAMES, VOICE_RESET_AFTER_MS, VoiceCodec, VoiceFlag, voiceClockRate, voiceSamplesPerFrame, voiceSeqDiff, encodeVoiceHeader, encodeVoicePacket, decodeVoicePacket, VoicePacketizer, VoiceJitterBuffer, } from './media/voice-frames.js';
|
|
64
64
|
export { RealtimeMetrics, payloadBytesOf, } from './metrics.js';
|
|
65
65
|
export { WorldClient, ActorClient } from './world.js';
|
|
66
|
-
|
|
66
|
+
// The Game Kit: typed clients for the ck-exec starter hubs, their protocol, mirrors and
|
|
67
|
+
// topology, the realtime wire and conventions, and social.
|
|
68
|
+
export * from './kit/index.js';
|
|
67
69
|
export { ACCESS_NOT_GRANTED_CODE, ACCESS_REVOKED_CODE, ACCESS_SUSPENDED_CODE, ACCOUNT_BLOCKED_CODE, GROUP_MEMBER_BANNED_CODE, accountBlockedOf, groupMemberBannedOf, ACTOR_EXISTS_CODE, APP_PAUSED_CODE, accessRefusalOf, actorExistsOf, appPausedOf, isAppPaused, APP_UNAVAILABLE_CODE, CrowdyAppUnavailableError, CrowdyError, CrowdyGraphQLError, CrowdyHttpError, CrowdyNetworkError, CrowdyProtocolError, CrowdyRealtimeError, CrowdyTimeoutError, CrowdyUserCodeFaultError, playerFaultOf, WRONG_DATACENTER_CODE, } from './errors.js';
|
|
68
70
|
export { moveFromError, moveFromErrors } from './datacenter-redirect.js';
|
|
69
71
|
export { SequenceAllocator, decodeBase64, encodeBase64, generateCrowdyUuid, validateChunkCoordinates, validateCrowdyUuid, } from './utils.js';
|
|
@@ -101,7 +103,7 @@ export { ServerStatusAPI } from './domains/serverStatus.js';
|
|
|
101
103
|
export { ChannelsAPI } from './domains/channels.js';
|
|
102
104
|
export { TeamsAPI } from './domains/teams.js';
|
|
103
105
|
export { UdpAPI } from './domains/udp.js';
|
|
104
|
-
export { ExecAPI, ExecConnection, EXEC_CLOSE_ACCESS_ENDED, CrowdyExecError, EXEC_STATUSES, execStatus, execGatewayRefusal, encodeExecFrame, decodeExecFrame, ExecModScope, execModType, EXEC_CLIENT_ABI_VERSION, } from './domains/exec.js';
|
|
106
|
+
export { ExecAPI, ExecConnection, EXEC_CLOSE_ACCESS_ENDED, CrowdyExecError, EXEC_STATUSES, execStatus, execGatewayRefusal, execWireIntegers, encodeExecFrame, decodeExecFrame, ExecModScope, execModType, EXEC_CLIENT_ABI_VERSION, } from './domains/exec.js';
|
|
105
107
|
export { CrowdyStudioAPI } from './domains/crowdyStudio.js';
|
|
106
108
|
export { PlayerWalletAPI } from './domains/playerWallet.js';
|
|
107
109
|
export { MarketplaceAPI } from './domains/marketplace.js';
|
package/dist/kit/index.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
export { runOptimisticAction, type OptimisticActionOutcome, type OptimisticActionSpec, } from './actions.js';
|
|
2
|
-
export { GameKitClient, type GameKitDomains, type GameKitOptions, } from './kit.js';
|
|
3
|
-
export {
|
|
2
|
+
export { GameKitClient, ShardKit, type GameKitDomains, type GameKitNodeTypes, type GameKitOptions, } from './kit.js';
|
|
3
|
+
export { KIT_ACTION_ID_MAX, KIT_CODES, KIT_PROTOCOL, KIT_SNAPSHOT_METHOD, KitError, isKitMessage, kitErrorCode, newActionId, parseKitRefusal, parseShardKey, shardCentre, shardKey, shardKeysAround, splitKitMessage, withActionId, type KitChanged, type KitContainer, type KitDelta, type KitHeader, type KitMessageKind, } from './protocol.js';
|
|
4
|
+
export { KIT_SUBSCRIPTIONS_MAX, KitRuntime, type KitCallOptions, type KitRuntimeOptions, } from './runtime.js';
|
|
5
|
+
export { WritableKitStore, type KitStore } from './store.js';
|
|
6
|
+
export { CollectionMirror, HubState, PrivateState, TopicMirror, type KitCollection, type PrivateStateSource, } from './mirror.js';
|
|
7
|
+
export { KIT_EVENT_TYPES, decodeKitActorState, isKitActorState, isKitPlayerActor, kitActorCodec, kitActorLanes, kitEventCodecs, parseKitServerEvent, withKitActors, type KitActorState, type KitPlayerActor, type KitWorldActor, } from './realtime.js';
|
|
8
|
+
export { KIT_BUILD_MAX_CRATES, KIT_NODE_API_SCOPES, KitTopology, kitManifestProblems, type KitDeployOptions, type KitManifest, type KitPlanOptions, type KitTopologyPlan, } from './topology.js';
|
|
9
|
+
export { WorldKit, type WorldConditions, type WorldKitOptions, type WorldLiveopsEvent, type WorldResourceNode, type WorldView, } from './modules/world.js';
|
|
10
|
+
export { MatchQueue, MatchmakingKit, type MatchJoin, type MatchPlace, type MatchQueueCounts, type MatchmakerConfig, type MatchmakingKitOptions, } from './modules/matchmaking.js';
|
|
11
|
+
export { GameSessionHandle, SessionsKit, sessionTurn, type SessionConfig, type SessionMove, type SessionPhase, type SessionState, type SessionsKitOptions, } from './modules/sessions.js';
|
|
12
|
+
export { NpcArea, NpcsKit, type KitPetView, type NpcsKitOptions } from './modules/npcs.js';
|
|
13
|
+
export { EmotesKit, SpectateKit, SpectatorHeartbeat, type EmoteSend, type KitChunk, type SpectateOptions, } from './modules/presence.js';
|
|
14
|
+
export { EVENT_ABILITY, EVENT_APP_FIRST, EVENT_CONTACT_DAMAGE, EVENT_CONTROL_POINT, EVENT_EMOTE, EVENT_ENCOUNTER, EVENT_MOVEMENT_VIOLATION, EVENT_POSSESSION, EVENT_PROPOSAL, EVENT_RACE_TIMING, EVENT_SCORE, EVENT_TURN, EVENT_WEATHER, EVENT_ZONE_CHANGE, FLAG_GROUNDED, FLAG_MOB, FLAG_NPC, FLAG_RESERVED3, POSE_BYTES, decodeEnginePose, encodeEnginePose, engineLanes, enginePoseCodec, parseAbilityEvent, parseContactDamage, parseControlPointEvent, parseEmoteEvent, parseEncounterEvent, parseEngineEvent, parseMovementViolation, parsePossessionEvent, parseProposalEvent, parseRaceTimingEvent, parseScoreEvent, parseTurnEvent, parseWeatherEvent, parseZoneChangeEvent, poseSuffix, type AbilityEvent, type ContactDamageEvent, type ControlPointEvent, type EmoteEvent, type EncounterEvent, type EnginePose, type MovementViolationEvent, type PossessionEvent, type ProposalEvent, type RaceTimingEvent, type ScoreEvent, type TurnEvent, type WeatherEvent, type ZoneChangeEvent, } from './wire.js';
|
|
4
15
|
export { SocialKit, type KitChatMessage, type KitGroupWithChannel, type SocialKitOptions, } from './social.js';
|
|
5
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/kit/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,QAAQ,EACR,eAAe,EACf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M,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EACL,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC"}
|
package/dist/kit/index.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export { runOptimisticAction, } from './actions.js';
|
|
2
|
-
export { GameKitClient, } from './kit.js';
|
|
3
|
-
export {
|
|
2
|
+
export { GameKitClient, ShardKit, } from './kit.js';
|
|
3
|
+
export { KIT_ACTION_ID_MAX, KIT_CODES, KIT_PROTOCOL, KIT_SNAPSHOT_METHOD, KitError, isKitMessage, kitErrorCode, newActionId, parseKitRefusal, parseShardKey, shardCentre, shardKey, shardKeysAround, splitKitMessage, withActionId, } from './protocol.js';
|
|
4
|
+
export { KIT_SUBSCRIPTIONS_MAX, KitRuntime, } from './runtime.js';
|
|
5
|
+
export { WritableKitStore } from './store.js';
|
|
6
|
+
export { CollectionMirror, HubState, PrivateState, TopicMirror, } from './mirror.js';
|
|
7
|
+
export { KIT_EVENT_TYPES, decodeKitActorState, isKitActorState, isKitPlayerActor, kitActorCodec, kitActorLanes, kitEventCodecs, parseKitServerEvent, withKitActors, } from './realtime.js';
|
|
8
|
+
export { KIT_BUILD_MAX_CRATES, KIT_NODE_API_SCOPES, KitTopology, kitManifestProblems, } from './topology.js';
|
|
9
|
+
export { WorldKit, } from './modules/world.js';
|
|
10
|
+
export { MatchQueue, MatchmakingKit, } from './modules/matchmaking.js';
|
|
11
|
+
export { GameSessionHandle, SessionsKit, sessionTurn, } from './modules/sessions.js';
|
|
12
|
+
export { NpcArea, NpcsKit } from './modules/npcs.js';
|
|
13
|
+
export { EmotesKit, SpectateKit, SpectatorHeartbeat, } from './modules/presence.js';
|
|
14
|
+
export { EVENT_ABILITY, EVENT_APP_FIRST, EVENT_CONTACT_DAMAGE, EVENT_CONTROL_POINT, EVENT_EMOTE, EVENT_ENCOUNTER, EVENT_MOVEMENT_VIOLATION, EVENT_POSSESSION, EVENT_PROPOSAL, EVENT_RACE_TIMING, EVENT_SCORE, EVENT_TURN, EVENT_WEATHER, EVENT_ZONE_CHANGE, FLAG_GROUNDED, FLAG_MOB, FLAG_NPC, FLAG_RESERVED3, POSE_BYTES, decodeEnginePose, encodeEnginePose, engineLanes, enginePoseCodec, parseAbilityEvent, parseContactDamage, parseControlPointEvent, parseEmoteEvent, parseEncounterEvent, parseEngineEvent, parseMovementViolation, parsePossessionEvent, parseProposalEvent, parseRaceTimingEvent, parseScoreEvent, parseTurnEvent, parseWeatherEvent, parseZoneChangeEvent, poseSuffix, } from './wire.js';
|
|
4
15
|
export { SocialKit, } from './social.js';
|
package/dist/kit/kit.d.ts
CHANGED
|
@@ -1,31 +1,107 @@
|
|
|
1
1
|
import type { ChannelsAPI } from '../domains/channels.js';
|
|
2
|
+
import type { ExecAPI } from '../domains/exec.js';
|
|
2
3
|
import type { GameAppsAPI } from '../domains/gameApps.js';
|
|
3
4
|
import type { TeamsAPI } from '../domains/teams.js';
|
|
4
5
|
import type { UdpAPI } from '../domains/udp.js';
|
|
5
6
|
import type { Scalars } from '../generated/graphql.js';
|
|
7
|
+
import { MatchmakingKit } from './modules/matchmaking.js';
|
|
8
|
+
import { NpcsKit } from './modules/npcs.js';
|
|
9
|
+
import { EmotesKit, SpectateKit } from './modules/presence.js';
|
|
10
|
+
import { SessionsKit } from './modules/sessions.js';
|
|
11
|
+
import { WorldKit } from './modules/world.js';
|
|
12
|
+
import { KitRuntime, type KitRuntimeOptions } from './runtime.js';
|
|
6
13
|
import { SocialKit, type SocialKitOptions } from './social.js';
|
|
14
|
+
import { KitTopology } from './topology.js';
|
|
15
|
+
/**
|
|
16
|
+
* The node types the kit's modules call, when a game deployed the starters under other names.
|
|
17
|
+
* Each defaults to the starter pack's.
|
|
18
|
+
*/
|
|
19
|
+
export interface GameKitNodeTypes {
|
|
20
|
+
/** The root world hub (`world`). */
|
|
21
|
+
world?: string;
|
|
22
|
+
/** Matchmaking queues (`matchmaker`). */
|
|
23
|
+
matchmaker?: string;
|
|
24
|
+
/** Game sessions (`session`). */
|
|
25
|
+
session?: string;
|
|
26
|
+
/** Areas of mobs, NPCs and pets (`npcs`). */
|
|
27
|
+
npcs?: string;
|
|
28
|
+
}
|
|
7
29
|
/** Options for {@link GameKitClient}. */
|
|
8
|
-
export interface GameKitOptions {
|
|
30
|
+
export interface GameKitOptions extends KitRuntimeOptions {
|
|
9
31
|
social?: SocialKitOptions;
|
|
32
|
+
/** The node types the modules call. */
|
|
33
|
+
nodes?: GameKitNodeTypes;
|
|
34
|
+
/** The key of the root world hub. Default `''`. */
|
|
35
|
+
worldKey?: string;
|
|
36
|
+
/** An area's size in chunks, for `npcs.areaAt`. Default 8. */
|
|
37
|
+
areaSize?: number;
|
|
10
38
|
}
|
|
11
39
|
/**
|
|
12
|
-
* The domains the kit composes: teams for parties and guilds, channels and
|
|
13
|
-
* `client.kit(appId)` wires them
|
|
40
|
+
* The domains the kit composes: exec for the hubs, teams for parties and guilds, channels and
|
|
41
|
+
* udp for chat and the realtime conventions. `client.kit(appId)` wires them.
|
|
14
42
|
*/
|
|
15
43
|
export interface GameKitDomains {
|
|
16
44
|
channels?: ChannelsAPI;
|
|
17
45
|
teams?: TeamsAPI;
|
|
18
46
|
udp?: UdpAPI;
|
|
47
|
+
exec?: ExecAPI;
|
|
48
|
+
/** The player's id, for `changed` messages: `client.users.me`. */
|
|
49
|
+
whoAmI?: () => Promise<string | null>;
|
|
50
|
+
}
|
|
51
|
+
/** Shard keys: the hub for where a player stands, computed the way the hubs compute it. */
|
|
52
|
+
export declare class ShardKit {
|
|
53
|
+
/** The key of the `size`-chunk shard holding chunk `(x, z)`. */
|
|
54
|
+
key(x: number, z: number, size: number): string;
|
|
55
|
+
/** The keys of the shards within `radius` of the one holding `(x, z)`, its own first. */
|
|
56
|
+
around(x: number, z: number, size: number, radius?: number): string[];
|
|
19
57
|
}
|
|
20
58
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
59
|
+
* The app-scoped **Game Kit** that `client.kit(appId)` returns: typed clients for the ck-exec
|
|
60
|
+
* starter hubs (the root {@link world} with liveops, {@link matchmaking} queues with parties,
|
|
61
|
+
* game {@link sessions}, areas of {@link npcs} with mobs and pets), the {@link topology} that
|
|
62
|
+
* deploys them, the client-side conventions ({@link spectate}, {@link emotes},
|
|
63
|
+
* {@link shards}), and {@link social} (parties, guilds, chat over teams and channels).
|
|
64
|
+
*
|
|
65
|
+
* The hub modules share one connection ({@link runtime}), opened when first needed, which
|
|
66
|
+
* paces calls under the gateway's limit, resends safely (a change carries an action id the
|
|
67
|
+
* hub answers once), and mirrors topics with resync on gaps and reconnects. The realtime
|
|
68
|
+
* codecs (`kitActorCodec`, `kitEventCodecs`, the `wire.ts` parsers) and `runOptimisticAction`
|
|
69
|
+
* are standalone exports.
|
|
25
70
|
*/
|
|
26
71
|
export declare class GameKitClient {
|
|
72
|
+
private readonly appId;
|
|
73
|
+
private readonly options;
|
|
74
|
+
private readonly domains;
|
|
27
75
|
/** Social helpers (parties, guilds, chat over teams + channels). */
|
|
28
76
|
readonly social: SocialKit;
|
|
77
|
+
/** The shared connection to the app's hubs. */
|
|
78
|
+
readonly runtime: KitRuntime;
|
|
79
|
+
private worldKit;
|
|
80
|
+
private matchmakingKit;
|
|
81
|
+
private sessionsKit;
|
|
82
|
+
private npcsKit;
|
|
83
|
+
private topologyKit;
|
|
84
|
+
private spectateKit;
|
|
85
|
+
private emotesKit;
|
|
86
|
+
private shardKit;
|
|
29
87
|
constructor(appId: Scalars['BigInt']['input'], gameApps: GameAppsAPI, options?: GameKitOptions, domains?: GameKitDomains);
|
|
88
|
+
/** The root world hub: conditions, resource nodes, liveops. */
|
|
89
|
+
get world(): WorldKit;
|
|
90
|
+
/** Matchmaking queues, with parties matched whole. */
|
|
91
|
+
get matchmaking(): MatchmakingKit;
|
|
92
|
+
/** Game sessions: lobby, ready checks, turns, scores. */
|
|
93
|
+
get sessions(): SessionsKit;
|
|
94
|
+
/** Areas of mobs, NPCs and players' pets. */
|
|
95
|
+
get npcs(): NpcsKit;
|
|
96
|
+
/** Composing and deploying the app's tree of starter hubs (developers). */
|
|
97
|
+
get topology(): KitTopology;
|
|
98
|
+
/** Keeping a viewer with no avatar where the world's messages reach it. */
|
|
99
|
+
get spectate(): SpectateKit;
|
|
100
|
+
/** Emotes between players, a client event every kit client reads. */
|
|
101
|
+
get emotes(): EmotesKit;
|
|
102
|
+
/** Shard keys, as the hubs compute them. */
|
|
103
|
+
get shards(): ShardKit;
|
|
104
|
+
/** Closes the kit's connection (one it was given stays open). */
|
|
105
|
+
close(): void;
|
|
30
106
|
}
|
|
31
107
|
//# sourceMappingURL=kit.d.ts.map
|
package/dist/kit/kit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../../src/kit/kit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../../src/kit/kit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAA8B,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,OAAO,EAAuB,MAAM,mBAAm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AS,CAEtB;IAED,4CAA4C;IAC5C,IAAI,MAAM,IAAI,QAAQ,CAErB;IAED,iEAAiE;IACjE,KAAK,IAAI,IAAI;CAGd"}
|
package/dist/kit/kit.js
CHANGED
|
@@ -1,12 +1,90 @@
|
|
|
1
|
+
import { MatchmakingKit } from './modules/matchmaking.js';
|
|
2
|
+
import { NpcsKit } from './modules/npcs.js';
|
|
3
|
+
import { EmotesKit, SpectateKit } from './modules/presence.js';
|
|
4
|
+
import { SessionsKit } from './modules/sessions.js';
|
|
5
|
+
import { WorldKit } from './modules/world.js';
|
|
6
|
+
import { shardKey, shardKeysAround } from './protocol.js';
|
|
7
|
+
import { KitRuntime } from './runtime.js';
|
|
1
8
|
import { SocialKit } from './social.js';
|
|
9
|
+
import { KitTopology } from './topology.js';
|
|
10
|
+
/** Shard keys: the hub for where a player stands, computed the way the hubs compute it. */
|
|
11
|
+
export class ShardKit {
|
|
12
|
+
/** The key of the `size`-chunk shard holding chunk `(x, z)`. */
|
|
13
|
+
key(x, z, size) {
|
|
14
|
+
return shardKey(x, z, size);
|
|
15
|
+
}
|
|
16
|
+
/** The keys of the shards within `radius` of the one holding `(x, z)`, its own first. */
|
|
17
|
+
around(x, z, size, radius = 1) {
|
|
18
|
+
return shardKeysAround(x, z, size, radius);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
2
21
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
22
|
+
* The app-scoped **Game Kit** that `client.kit(appId)` returns: typed clients for the ck-exec
|
|
23
|
+
* starter hubs (the root {@link world} with liveops, {@link matchmaking} queues with parties,
|
|
24
|
+
* game {@link sessions}, areas of {@link npcs} with mobs and pets), the {@link topology} that
|
|
25
|
+
* deploys them, the client-side conventions ({@link spectate}, {@link emotes},
|
|
26
|
+
* {@link shards}), and {@link social} (parties, guilds, chat over teams and channels).
|
|
27
|
+
*
|
|
28
|
+
* The hub modules share one connection ({@link runtime}), opened when first needed, which
|
|
29
|
+
* paces calls under the gateway's limit, resends safely (a change carries an action id the
|
|
30
|
+
* hub answers once), and mirrors topics with resync on gaps and reconnects. The realtime
|
|
31
|
+
* codecs (`kitActorCodec`, `kitEventCodecs`, the `wire.ts` parsers) and `runOptimisticAction`
|
|
32
|
+
* are standalone exports.
|
|
7
33
|
*/
|
|
8
34
|
export class GameKitClient {
|
|
9
35
|
constructor(appId, gameApps, options = {}, domains = {}) {
|
|
36
|
+
this.appId = appId;
|
|
37
|
+
this.options = options;
|
|
38
|
+
this.domains = domains;
|
|
39
|
+
this.worldKit = null;
|
|
40
|
+
this.matchmakingKit = null;
|
|
41
|
+
this.sessionsKit = null;
|
|
42
|
+
this.npcsKit = null;
|
|
43
|
+
this.topologyKit = null;
|
|
44
|
+
this.spectateKit = null;
|
|
45
|
+
this.emotesKit = null;
|
|
46
|
+
this.shardKit = null;
|
|
10
47
|
this.social = new SocialKit(appId, domains.teams, domains.channels, domains.udp, gameApps, options.social);
|
|
48
|
+
this.runtime = new KitRuntime(String(appId), domains.exec, options, domains.whoAmI);
|
|
49
|
+
}
|
|
50
|
+
/** The root world hub: conditions, resource nodes, liveops. */
|
|
51
|
+
get world() {
|
|
52
|
+
const opts = { nodeType: this.options.nodes?.world, key: this.options.worldKey };
|
|
53
|
+
return (this.worldKit ?? (this.worldKit = new WorldKit(this.runtime, opts)));
|
|
54
|
+
}
|
|
55
|
+
/** Matchmaking queues, with parties matched whole. */
|
|
56
|
+
get matchmaking() {
|
|
57
|
+
const opts = { nodeType: this.options.nodes?.matchmaker };
|
|
58
|
+
return (this.matchmakingKit ?? (this.matchmakingKit = new MatchmakingKit(this.runtime, opts)));
|
|
59
|
+
}
|
|
60
|
+
/** Game sessions: lobby, ready checks, turns, scores. */
|
|
61
|
+
get sessions() {
|
|
62
|
+
const opts = { nodeType: this.options.nodes?.session };
|
|
63
|
+
return (this.sessionsKit ?? (this.sessionsKit = new SessionsKit(this.runtime, opts)));
|
|
64
|
+
}
|
|
65
|
+
/** Areas of mobs, NPCs and players' pets. */
|
|
66
|
+
get npcs() {
|
|
67
|
+
const opts = { nodeType: this.options.nodes?.npcs, areaSize: this.options.areaSize };
|
|
68
|
+
return (this.npcsKit ?? (this.npcsKit = new NpcsKit(this.runtime, opts)));
|
|
69
|
+
}
|
|
70
|
+
/** Composing and deploying the app's tree of starter hubs (developers). */
|
|
71
|
+
get topology() {
|
|
72
|
+
return (this.topologyKit ?? (this.topologyKit = new KitTopology(String(this.appId), this.domains.exec)));
|
|
73
|
+
}
|
|
74
|
+
/** Keeping a viewer with no avatar where the world's messages reach it. */
|
|
75
|
+
get spectate() {
|
|
76
|
+
return (this.spectateKit ?? (this.spectateKit = new SpectateKit(String(this.appId), this.domains.udp)));
|
|
77
|
+
}
|
|
78
|
+
/** Emotes between players, a client event every kit client reads. */
|
|
79
|
+
get emotes() {
|
|
80
|
+
return (this.emotesKit ?? (this.emotesKit = new EmotesKit(String(this.appId), this.domains.udp)));
|
|
81
|
+
}
|
|
82
|
+
/** Shard keys, as the hubs compute them. */
|
|
83
|
+
get shards() {
|
|
84
|
+
return (this.shardKit ?? (this.shardKit = new ShardKit()));
|
|
85
|
+
}
|
|
86
|
+
/** Closes the kit's connection (one it was given stays open). */
|
|
87
|
+
close() {
|
|
88
|
+
this.runtime.close();
|
|
11
89
|
}
|
|
12
90
|
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { type KitChanged, type KitContainer, type KitDelta, type KitHeader } from './protocol.js';
|
|
2
|
+
import type { KitRuntime } from './runtime.js';
|
|
3
|
+
import type { KitStore } from './store.js';
|
|
4
|
+
/**
|
|
5
|
+
* A hub topic mirrored on the client: it subscribes, asks the hub for a snapshot, then applies
|
|
6
|
+
* what arrives after the snapshot's `seq`. It asks again when the publishing instance's
|
|
7
|
+
* `epoch` changes, when a delta topic skips a `seq`, and after the connection reconnects.
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class TopicMirror<S> implements KitStore<S | undefined> {
|
|
10
|
+
protected readonly runtime: KitRuntime;
|
|
11
|
+
readonly nodeType: string;
|
|
12
|
+
readonly key: string;
|
|
13
|
+
readonly topic: string;
|
|
14
|
+
private state;
|
|
15
|
+
private epoch;
|
|
16
|
+
private seq;
|
|
17
|
+
private buffer;
|
|
18
|
+
private syncing;
|
|
19
|
+
private stopSub;
|
|
20
|
+
private offReconnect;
|
|
21
|
+
private readonly listeners;
|
|
22
|
+
private readonly eventListeners;
|
|
23
|
+
private readonly changedListeners;
|
|
24
|
+
private watching;
|
|
25
|
+
constructor(runtime: KitRuntime, nodeType: string, key: string, topic: string);
|
|
26
|
+
/** The state a snapshot's body stands for. */
|
|
27
|
+
protected abstract fromSnapshot(body: Record<string, unknown>): S;
|
|
28
|
+
/** The state after one delta, or null when a delta is not this topic's (resync). */
|
|
29
|
+
protected abstract applyDelta(state: S, delta: KitDelta): S | null;
|
|
30
|
+
/** Whether a skipped `seq` loses state (a delta topic) or not (snapshot topics). */
|
|
31
|
+
protected abstract readonly gapsLoseState: boolean;
|
|
32
|
+
/** Subscribes and takes the first snapshot; resolves with the state. Idempotent. */
|
|
33
|
+
start(): Promise<S>;
|
|
34
|
+
/** Stops the subscription; the last state stays readable. */
|
|
35
|
+
stop(): Promise<void>;
|
|
36
|
+
/** Takes a fresh snapshot (shared by concurrent callers). */
|
|
37
|
+
resync(): Promise<S>;
|
|
38
|
+
get(): S | undefined;
|
|
39
|
+
subscribe(listener: (value: S | undefined) => void): () => void;
|
|
40
|
+
/** `event` messages on the topic. */
|
|
41
|
+
onEvent(listener: (body: Record<string, unknown>, header: KitHeader) => void): () => void;
|
|
42
|
+
/** `changed` messages on the topic: someone's private state to read again. */
|
|
43
|
+
onChanged(listener: (changed: KitChanged, header: KitHeader) => void): () => void;
|
|
44
|
+
/** The epoch and seq the mirror is at; `-1` before its first snapshot. */
|
|
45
|
+
get position(): {
|
|
46
|
+
epoch: number;
|
|
47
|
+
seq: number;
|
|
48
|
+
};
|
|
49
|
+
private emit;
|
|
50
|
+
private onPush;
|
|
51
|
+
private apply;
|
|
52
|
+
}
|
|
53
|
+
/** A topic whose messages are its hub's whole public state (`snapshot` messages). */
|
|
54
|
+
export declare class HubState<T = Record<string, unknown>> extends TopicMirror<T> {
|
|
55
|
+
protected readonly gapsLoseState = false;
|
|
56
|
+
protected fromSnapshot(body: Record<string, unknown>): T;
|
|
57
|
+
protected applyDelta(): T | null;
|
|
58
|
+
}
|
|
59
|
+
/** A collection's members by id: what a model topic's snapshot and deltas describe. */
|
|
60
|
+
export type KitCollection = ReadonlyMap<number, KitContainer>;
|
|
61
|
+
/**
|
|
62
|
+
* A topic carrying a collection (`delta` per member; the snapshot's `containers`): the
|
|
63
|
+
* starters' model topics, such as an area's mobs, NPCs and pets.
|
|
64
|
+
*/
|
|
65
|
+
export declare class CollectionMirror extends TopicMirror<KitCollection> {
|
|
66
|
+
protected readonly gapsLoseState = true;
|
|
67
|
+
protected fromSnapshot(body: Record<string, unknown>): KitCollection;
|
|
68
|
+
protected applyDelta(state: KitCollection, d: KitDelta): KitCollection | null;
|
|
69
|
+
/** The members, oldest first, of one type or all. */
|
|
70
|
+
list(typeName?: string): KitContainer[];
|
|
71
|
+
/** One member by id. */
|
|
72
|
+
member(id: number): KitContainer | undefined;
|
|
73
|
+
}
|
|
74
|
+
/** How a {@link PrivateState} reads its value and hears that it changed. */
|
|
75
|
+
export interface PrivateStateSource<T> {
|
|
76
|
+
nodeType: string;
|
|
77
|
+
key: string;
|
|
78
|
+
/** The topic whose `changed` messages name this player. */
|
|
79
|
+
topic: string;
|
|
80
|
+
/** The `what` (or whats) that concern this value. */
|
|
81
|
+
what: string | readonly string[];
|
|
82
|
+
/** Reads the value with a call the hub answers for its caller alone. */
|
|
83
|
+
read: () => Promise<T>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* State only its player may read (a hand of cards, an inventory, a pet's bond): read with a
|
|
87
|
+
* caller-scoped call, read again when the hub's `changed` message names this player, and after
|
|
88
|
+
* a reconnect. Nothing private is ever on a topic.
|
|
89
|
+
*/
|
|
90
|
+
export declare class PrivateState<T> implements KitStore<T | undefined> {
|
|
91
|
+
private readonly runtime;
|
|
92
|
+
private readonly source;
|
|
93
|
+
private value;
|
|
94
|
+
private reading;
|
|
95
|
+
private again;
|
|
96
|
+
private stopSub;
|
|
97
|
+
private offReconnect;
|
|
98
|
+
private readonly listeners;
|
|
99
|
+
private readonly whats;
|
|
100
|
+
private watching;
|
|
101
|
+
constructor(runtime: KitRuntime, source: PrivateStateSource<T>);
|
|
102
|
+
/** Subscribes and reads the first value. Idempotent. */
|
|
103
|
+
start(): Promise<T>;
|
|
104
|
+
stop(): Promise<void>;
|
|
105
|
+
/** Reads the value again (one read at a time; a request during one runs after it). */
|
|
106
|
+
refresh(): Promise<T>;
|
|
107
|
+
get(): T | undefined;
|
|
108
|
+
subscribe(listener: (value: T | undefined) => void): () => void;
|
|
109
|
+
private onPush;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mirror.d.ts","sourceRoot":"","sources":["../../src/kit/mirror.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C;;;;GAIG;AACH,8BAAsB,WAAW,CAAC,CAAC,CAAE,YAAW,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC;IAcnE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAhBxB,OAAO,CAAC,KAAK,CAAgB;IAC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