@crowdedkingdoms/crowdyjs 18.11.0-dev.1 → 18.13.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.
Files changed (55) hide show
  1. package/MIGRATION.md +51 -0
  2. package/README.md +19 -1
  3. package/dist/generated/graphql-schema.d.ts +5 -5
  4. package/dist/generated/graphql-schema.d.ts.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/kit/index.d.ts +11 -0
  8. package/dist/kit/index.d.ts.map +1 -1
  9. package/dist/kit/index.js +11 -0
  10. package/dist/kit/kit.d.ts +99 -2
  11. package/dist/kit/kit.d.ts.map +1 -1
  12. package/dist/kit/kit.js +128 -2
  13. package/dist/kit/modules/arenas.d.ts +87 -0
  14. package/dist/kit/modules/arenas.d.ts.map +1 -0
  15. package/dist/kit/modules/arenas.js +66 -0
  16. package/dist/kit/modules/encounters.d.ts +75 -0
  17. package/dist/kit/modules/encounters.d.ts.map +1 -0
  18. package/dist/kit/modules/encounters.js +57 -0
  19. package/dist/kit/modules/instances.d.ts +78 -0
  20. package/dist/kit/modules/instances.d.ts.map +1 -0
  21. package/dist/kit/modules/instances.js +72 -0
  22. package/dist/kit/modules/leaderboards.d.ts +79 -0
  23. package/dist/kit/modules/leaderboards.d.ts.map +1 -0
  24. package/dist/kit/modules/leaderboards.js +69 -0
  25. package/dist/kit/modules/market.d.ts +159 -0
  26. package/dist/kit/modules/market.d.ts.map +1 -0
  27. package/dist/kit/modules/market.js +141 -0
  28. package/dist/kit/modules/minigames.d.ts +59 -0
  29. package/dist/kit/modules/minigames.d.ts.map +1 -0
  30. package/dist/kit/modules/minigames.js +55 -0
  31. package/dist/kit/modules/player.d.ts +264 -0
  32. package/dist/kit/modules/player.d.ts.map +1 -0
  33. package/dist/kit/modules/player.js +258 -0
  34. package/dist/kit/modules/racing.d.ts +131 -0
  35. package/dist/kit/modules/racing.d.ts.map +1 -0
  36. package/dist/kit/modules/racing.js +113 -0
  37. package/dist/kit/modules/tables.d.ts +76 -0
  38. package/dist/kit/modules/tables.d.ts.map +1 -0
  39. package/dist/kit/modules/tables.js +73 -0
  40. package/dist/kit/modules/tactics.d.ts +79 -0
  41. package/dist/kit/modules/tactics.d.ts.map +1 -0
  42. package/dist/kit/modules/tactics.js +67 -0
  43. package/dist/kit/modules/territory.d.ts +92 -0
  44. package/dist/kit/modules/territory.d.ts.map +1 -0
  45. package/dist/kit/modules/territory.js +84 -0
  46. package/dist/kit/protocol.d.ts +2 -0
  47. package/dist/kit/protocol.d.ts.map +1 -1
  48. package/dist/kit/protocol.js +2 -0
  49. package/dist/kit/runtime.d.ts.map +1 -1
  50. package/dist/kit/runtime.js +6 -1
  51. package/dist/live-coding/assets/browser-authoring-index.json +1 -1
  52. package/dist/live-coding/assets/manifest.json +1 -1
  53. package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
  54. package/dist/live-coding/browser-authoring-index.generated.js +4776 -149
  55. 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.11.0-dev.1";
49
+ export declare const VERSION = "18.13.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';
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.11.0-dev.1';
49
+ export const VERSION = '18.13.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
@@ -13,4 +13,15 @@ export { NpcArea, NpcsKit, type KitPetView, type NpcsKitOptions } from './module
13
13
  export { EmotesKit, SpectateKit, SpectatorHeartbeat, type EmoteSend, type KitChunk, type SpectateOptions, } from './modules/presence.js';
14
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';
15
15
  export { SocialKit, type KitChatMessage, type KitGroupWithChannel, type SocialKitOptions, } from './social.js';
16
+ export { LeaderboardHandle, LeaderboardsKit, type LeaderboardConfig, type LeaderboardRank, type LeaderboardSeason, type LeaderboardView, } from './modules/leaderboards.js';
17
+ export { CardTable, TablesKit, type CardHand, type CardPlayed, type CardTableView } from './modules/tables.js';
18
+ export { TacticsBattle, TacticsKit, type TacticsBattleView, type TacticsUnit, type TacticsUnitStats, } from './modules/tactics.js';
19
+ export { Encounter, EncountersKit, type EncounterEnemy, type EncounterTower, type EncounterView, } from './modules/encounters.js';
20
+ export { Duel, MinigamesKit, type DuelReveal, type DuelSeat, type DuelView } from './modules/minigames.js';
21
+ export { InstanceRun, InstancesKit, type InstanceMember, type InstanceRoom, type InstanceRunView, } from './modules/instances.js';
22
+ export { ArenaMatch, ArenasKit, type ArenaBlast, type ArenaFighter, type ArenaShot, type ArenaView, } from './modules/arenas.js';
23
+ export { BallMatch, Race, RacingKit, type BallPlayer, type BallState, type BallView, type RaceGate, type RaceGhost, type RaceRacer, type RaceView, } from './modules/racing.js';
24
+ export { TerritoryKit, TerritoryMap, ZoneMatch, type TerritoryPoint, type TerritoryView, type ZoneContender, type ZoneView, } from './modules/territory.js';
25
+ export { AchievementsKit, CraftingKit, InventoryKit, LootKit, PlayerKit, ProductionKit, ProgressionKit, QuestsKit, WalletKit, type AchievementView, type EconBundle, type EconRecipe, type EconStack, type InventoryView, type LootRoll, type LootTableView, type PlayerEarned, type PlayerEvent, type PlayerProfile, type PlayerRules, type PlayerView, type ProductionView, type ProgressView, type QuestObjectiveView, type QuestView, type WalletView, } from './modules/player.js';
26
+ export { MarketCore, MarketHandle, MarketsKit, ShopHandle, ShopsKit, TradeDesk, TradesKit, type MarketBook, type MarketOrder, type MarketPlaced, type MarketQuote, type MarketTrade, type MarketTradeSide, type MarketView, type VendorOfferView, type VendorView, } from './modules/market.js';
16
27
  //# sourceMappingURL=index.d.ts.map
@@ -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,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,EAC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S,EACd,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,QAAQ,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,eAAe,EACf,WAAW,EACX,YAAY,EACZ,OAAO,EACP,SAAS,EACT,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,SAAS,EACT,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,qBAAqB,CAAC"}
package/dist/kit/index.js CHANGED
@@ -13,3 +13,14 @@ export { NpcArea, NpcsKit } from './modules/npcs.js';
13
13
  export { EmotesKit, SpectateKit, SpectatorHeartbeat, } from './modules/presence.js';
14
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';
15
15
  export { SocialKit, } from './social.js';
16
+ export { LeaderboardHandle, LeaderboardsKit, } from './modules/leaderboards.js';
17
+ export { CardTable, TablesKit } from './modules/tables.js';
18
+ export { TacticsBattle, TacticsKit, } from './modules/tactics.js';
19
+ export { Encounter, EncountersKit, } from './modules/encounters.js';
20
+ export { Duel, MinigamesKit } from './modules/minigames.js';
21
+ export { InstanceRun, InstancesKit, } from './modules/instances.js';
22
+ export { ArenaMatch, ArenasKit, } from './modules/arenas.js';
23
+ export { BallMatch, Race, RacingKit, } from './modules/racing.js';
24
+ export { TerritoryKit, TerritoryMap, ZoneMatch, } from './modules/territory.js';
25
+ export { AchievementsKit, CraftingKit, InventoryKit, LootKit, PlayerKit, ProductionKit, ProgressionKit, QuestsKit, WalletKit, } from './modules/player.js';
26
+ export { MarketCore, MarketHandle, MarketsKit, ShopHandle, ShopsKit, TradeDesk, TradesKit, } from './modules/market.js';
package/dist/kit/kit.d.ts CHANGED
@@ -4,10 +4,21 @@ import type { GameAppsAPI } from '../domains/gameApps.js';
4
4
  import type { TeamsAPI } from '../domains/teams.js';
5
5
  import type { UdpAPI } from '../domains/udp.js';
6
6
  import type { Scalars } from '../generated/graphql.js';
7
+ import { ArenasKit } from './modules/arenas.js';
8
+ import { EncountersKit } from './modules/encounters.js';
9
+ import { InstancesKit } from './modules/instances.js';
10
+ import { LeaderboardsKit } from './modules/leaderboards.js';
11
+ import { MarketsKit, ShopsKit, TradesKit } from './modules/market.js';
7
12
  import { MatchmakingKit } from './modules/matchmaking.js';
13
+ import { MinigamesKit } from './modules/minigames.js';
14
+ import { AchievementsKit, CraftingKit, InventoryKit, LootKit, PlayerKit, ProductionKit, ProgressionKit, QuestsKit, WalletKit } from './modules/player.js';
8
15
  import { NpcsKit } from './modules/npcs.js';
9
16
  import { EmotesKit, SpectateKit } from './modules/presence.js';
17
+ import { RacingKit } from './modules/racing.js';
10
18
  import { SessionsKit } from './modules/sessions.js';
19
+ import { TablesKit } from './modules/tables.js';
20
+ import { TacticsKit } from './modules/tactics.js';
21
+ import { TerritoryKit } from './modules/territory.js';
11
22
  import { WorldKit } from './modules/world.js';
12
23
  import { KitRuntime, type KitRuntimeOptions } from './runtime.js';
13
24
  import { SocialKit, type SocialKitOptions } from './social.js';
@@ -25,6 +36,30 @@ export interface GameKitNodeTypes {
25
36
  session?: string;
26
37
  /** Areas of mobs, NPCs and pets (`npcs`). */
27
38
  npcs?: string;
39
+ /** Leaderboards (`leaderboard`). */
40
+ leaderboard?: string;
41
+ /** Card tables (`deck`). */
42
+ deck?: string;
43
+ /** Grid battles (`tactics`). */
44
+ tactics?: string;
45
+ /** Waves and bosses (`director`). */
46
+ director?: string;
47
+ /** Duels (`minigame`). */
48
+ minigame?: string;
49
+ /** Private runs (`instance`). */
50
+ instance?: string;
51
+ /** Arenas (`arena`). */
52
+ arena?: string;
53
+ /** Races (`race`) and ball games (`ball`). */
54
+ race?: string;
55
+ ball?: string;
56
+ /** Control points (`territory`) and shrinking circles (`zone`). */
57
+ territory?: string;
58
+ zone?: string;
59
+ /** Each player's own hub (`player`): inventory, wallet, progression, crafting, loot. */
60
+ player?: string;
61
+ /** Markets (`market`): vendors, order books, trades. */
62
+ market?: string;
28
63
  }
29
64
  /** Options for {@link GameKitClient}. */
30
65
  export interface GameKitOptions extends KitRuntimeOptions {
@@ -58,8 +93,13 @@ export declare class ShardKit {
58
93
  /**
59
94
  * The app-scoped **Game Kit** that `client.kit(appId)` returns: typed clients for the ck-exec
60
95
  * 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},
96
+ * game {@link sessions}, areas of {@link npcs} with mobs and pets, {@link leaderboards}, card
97
+ * {@link tables}, {@link tactics} battles, {@link encounters}, {@link minigames}, private
98
+ * {@link instances}, {@link arenas}, {@link racing}, {@link territory}; the economy:
99
+ * {@link player}, {@link inventory}, {@link wallet}, {@link progression}, {@link achievements},
100
+ * {@link quests}, {@link crafting}, {@link loot}, {@link production}, {@link market},
101
+ * {@link shops}, {@link trades}), the {@link topology}
102
+ * that deploys them, the client-side conventions ({@link spectate}, {@link emotes},
63
103
  * {@link shards}), and {@link social} (parties, guilds, chat over teams and channels).
64
104
  *
65
105
  * The hub modules share one connection ({@link runtime}), opened when first needed, which
@@ -84,6 +124,18 @@ export declare class GameKitClient {
84
124
  private spectateKit;
85
125
  private emotesKit;
86
126
  private shardKit;
127
+ private leaderboardsKit;
128
+ private tablesKit;
129
+ private tacticsKit;
130
+ private encountersKit;
131
+ private minigamesKit;
132
+ private instancesKit;
133
+ private arenasKit;
134
+ private racingKit;
135
+ private territoryKit;
136
+ private playerKit;
137
+ private readonly economy;
138
+ private readonly markets;
87
139
  constructor(appId: Scalars['BigInt']['input'], gameApps: GameAppsAPI, options?: GameKitOptions, domains?: GameKitDomains);
88
140
  /** The root world hub: conditions, resource nodes, liveops. */
89
141
  get world(): WorldKit;
@@ -93,6 +145,51 @@ export declare class GameKitClient {
93
145
  get sessions(): SessionsKit;
94
146
  /** Areas of mobs, NPCs and players' pets. */
95
147
  get npcs(): NpcsKit;
148
+ /** Leaderboards the hubs rank (a client never submits its own score). */
149
+ get leaderboards(): LeaderboardsKit;
150
+ /** Card tables with hidden hands the hub holds. */
151
+ get tables(): TablesKit;
152
+ /** Grid battles in turns, against the hub's units. */
153
+ get tactics(): TacticsKit;
154
+ /** Encounters: waves down a lane, towers, a boss with phases. */
155
+ get encounters(): EncountersKit;
156
+ /** Duels of hidden throws, revealed together. */
157
+ get minigames(): MinigamesKit;
158
+ /** Private runs for one party: seeded floors, permadeath, expiry. */
159
+ get instances(): InstancesKit;
160
+ /** Real-time arenas: classes, abilities, the hub's referee. */
161
+ get arenas(): ArenasKit;
162
+ /** Races and ball games, on positions the hub's warden keeps. */
163
+ get racing(): RacingKit;
164
+ /** Control points factions capture, and shrinking circles. */
165
+ get territory(): TerritoryKit;
166
+ /**
167
+ * The caller's own `player` hub: what they own and what they did. The economy lives in hub
168
+ * state and is not a ledger. The modules below are views of it.
169
+ */
170
+ get player(): PlayerKit;
171
+ private view;
172
+ /** The player's items: stacks in slots, and mail for what did not fit. */
173
+ get inventory(): InventoryKit;
174
+ /** The player's soft currencies. */
175
+ get wallet(): WalletKit;
176
+ /** Experience, levels and public profiles. */
177
+ get progression(): ProgressionKit;
178
+ get achievements(): AchievementsKit;
179
+ /** Quests, first-session tutorials among them. */
180
+ get quests(): QuestsKit;
181
+ get crafting(): CraftingKit;
182
+ /** Loot tables with pity. */
183
+ get loot(): LootKit;
184
+ /** Idle production that catches up on the time away. */
185
+ get production(): ProductionKit;
186
+ private marketCore;
187
+ /** Markets' order books. */
188
+ get market(): MarketsKit;
189
+ /** Markets' vendors. */
190
+ get shops(): ShopsKit;
191
+ /** Trades between two players at a market. */
192
+ get trades(): TradesKit;
96
193
  /** Composing and deploying the app's tree of starter hubs (developers). */
97
194
  get topology(): KitTopology;
98
195
  /** Keeping a viewer with no avatar where the world's messages reach it. */
@@ -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,OAAO,EAAE,MAAM,oBAAoB,CAAC;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I,WAAW,CAE1B;IAED,qEAAqE;IACrE,IAAI,MAAM,IAAI,SAAS,CAEtB;IAED,4CAA4C;IAC5C,IAAI,MAAM,IAAI,QAAQ,CAErB;IAED,iEAAiE;IACjE,KAAK,IAAI,IAAI;CAGd"}
package/dist/kit/kit.js CHANGED
@@ -1,7 +1,18 @@
1
+ import { ArenasKit } from './modules/arenas.js';
2
+ import { EncountersKit } from './modules/encounters.js';
3
+ import { InstancesKit } from './modules/instances.js';
4
+ import { LeaderboardsKit } from './modules/leaderboards.js';
5
+ import { MarketCore, MarketsKit, ShopsKit, TradesKit } from './modules/market.js';
1
6
  import { MatchmakingKit } from './modules/matchmaking.js';
7
+ import { MinigamesKit } from './modules/minigames.js';
8
+ import { AchievementsKit, CraftingKit, InventoryKit, LootKit, PlayerKit, ProductionKit, ProgressionKit, QuestsKit, WalletKit, } from './modules/player.js';
2
9
  import { NpcsKit } from './modules/npcs.js';
3
10
  import { EmotesKit, SpectateKit } from './modules/presence.js';
11
+ import { RacingKit } from './modules/racing.js';
4
12
  import { SessionsKit } from './modules/sessions.js';
13
+ import { TablesKit } from './modules/tables.js';
14
+ import { TacticsKit } from './modules/tactics.js';
15
+ import { TerritoryKit } from './modules/territory.js';
5
16
  import { WorldKit } from './modules/world.js';
6
17
  import { shardKey, shardKeysAround } from './protocol.js';
7
18
  import { KitRuntime } from './runtime.js';
@@ -21,8 +32,13 @@ export class ShardKit {
21
32
  /**
22
33
  * The app-scoped **Game Kit** that `client.kit(appId)` returns: typed clients for the ck-exec
23
34
  * 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},
35
+ * game {@link sessions}, areas of {@link npcs} with mobs and pets, {@link leaderboards}, card
36
+ * {@link tables}, {@link tactics} battles, {@link encounters}, {@link minigames}, private
37
+ * {@link instances}, {@link arenas}, {@link racing}, {@link territory}; the economy:
38
+ * {@link player}, {@link inventory}, {@link wallet}, {@link progression}, {@link achievements},
39
+ * {@link quests}, {@link crafting}, {@link loot}, {@link production}, {@link market},
40
+ * {@link shops}, {@link trades}), the {@link topology}
41
+ * that deploys them, the client-side conventions ({@link spectate}, {@link emotes},
26
42
  * {@link shards}), and {@link social} (parties, guilds, chat over teams and channels).
27
43
  *
28
44
  * The hub modules share one connection ({@link runtime}), opened when first needed, which
@@ -44,6 +60,26 @@ export class GameKitClient {
44
60
  this.spectateKit = null;
45
61
  this.emotesKit = null;
46
62
  this.shardKit = null;
63
+ this.leaderboardsKit = null;
64
+ this.tablesKit = null;
65
+ this.tacticsKit = null;
66
+ this.encountersKit = null;
67
+ this.minigamesKit = null;
68
+ this.instancesKit = null;
69
+ this.arenasKit = null;
70
+ this.racingKit = null;
71
+ this.territoryKit = null;
72
+ this.playerKit = null;
73
+ this.economy = new Map();
74
+ this.markets = new Map();
75
+ this.marketCore = (key) => {
76
+ let core = this.markets.get(key);
77
+ if (!core) {
78
+ core = new MarketCore(this.runtime, this.options.nodes?.market ?? 'market', key);
79
+ this.markets.set(key, core);
80
+ }
81
+ return core;
82
+ };
47
83
  this.social = new SocialKit(appId, domains.teams, domains.channels, domains.udp, gameApps, options.social);
48
84
  this.runtime = new KitRuntime(String(appId), domains.exec, options, domains.whoAmI);
49
85
  }
@@ -67,6 +103,96 @@ export class GameKitClient {
67
103
  const opts = { nodeType: this.options.nodes?.npcs, areaSize: this.options.areaSize };
68
104
  return (this.npcsKit ?? (this.npcsKit = new NpcsKit(this.runtime, opts)));
69
105
  }
106
+ /** Leaderboards the hubs rank (a client never submits its own score). */
107
+ get leaderboards() {
108
+ return (this.leaderboardsKit ?? (this.leaderboardsKit = new LeaderboardsKit(this.runtime, this.options.nodes?.leaderboard)));
109
+ }
110
+ /** Card tables with hidden hands the hub holds. */
111
+ get tables() {
112
+ return (this.tablesKit ?? (this.tablesKit = new TablesKit(this.runtime, this.options.nodes?.deck)));
113
+ }
114
+ /** Grid battles in turns, against the hub's units. */
115
+ get tactics() {
116
+ return (this.tacticsKit ?? (this.tacticsKit = new TacticsKit(this.runtime, this.options.nodes?.tactics)));
117
+ }
118
+ /** Encounters: waves down a lane, towers, a boss with phases. */
119
+ get encounters() {
120
+ return (this.encountersKit ?? (this.encountersKit = new EncountersKit(this.runtime, this.options.nodes?.director)));
121
+ }
122
+ /** Duels of hidden throws, revealed together. */
123
+ get minigames() {
124
+ return (this.minigamesKit ?? (this.minigamesKit = new MinigamesKit(this.runtime, this.options.nodes?.minigame)));
125
+ }
126
+ /** Private runs for one party: seeded floors, permadeath, expiry. */
127
+ get instances() {
128
+ return (this.instancesKit ?? (this.instancesKit = new InstancesKit(this.runtime, this.options.nodes?.instance)));
129
+ }
130
+ /** Real-time arenas: classes, abilities, the hub's referee. */
131
+ get arenas() {
132
+ return (this.arenasKit ?? (this.arenasKit = new ArenasKit(this.runtime, this.options.nodes?.arena)));
133
+ }
134
+ /** Races and ball games, on positions the hub's warden keeps. */
135
+ get racing() {
136
+ return (this.racingKit ?? (this.racingKit = new RacingKit(this.runtime, this.options.nodes?.race, this.options.nodes?.ball)));
137
+ }
138
+ /** Control points factions capture, and shrinking circles. */
139
+ get territory() {
140
+ return (this.territoryKit ?? (this.territoryKit = new TerritoryKit(this.runtime, this.options.nodes?.territory, this.options.nodes?.zone)));
141
+ }
142
+ /**
143
+ * The caller's own `player` hub: what they own and what they did. The economy lives in hub
144
+ * state and is not a ledger. The modules below are views of it.
145
+ */
146
+ get player() {
147
+ return (this.playerKit ?? (this.playerKit = new PlayerKit(this.runtime, this.options.nodes?.player)));
148
+ }
149
+ view(name, make) {
150
+ if (!this.economy.has(name))
151
+ this.economy.set(name, make(this.player));
152
+ return this.economy.get(name);
153
+ }
154
+ /** The player's items: stacks in slots, and mail for what did not fit. */
155
+ get inventory() {
156
+ return this.view('inventory', (p) => new InventoryKit(p));
157
+ }
158
+ /** The player's soft currencies. */
159
+ get wallet() {
160
+ return this.view('wallet', (p) => new WalletKit(p));
161
+ }
162
+ /** Experience, levels and public profiles. */
163
+ get progression() {
164
+ return this.view('progression', (p) => new ProgressionKit(p));
165
+ }
166
+ get achievements() {
167
+ return this.view('achievements', (p) => new AchievementsKit(p));
168
+ }
169
+ /** Quests, first-session tutorials among them. */
170
+ get quests() {
171
+ return this.view('quests', (p) => new QuestsKit(p));
172
+ }
173
+ get crafting() {
174
+ return this.view('crafting', (p) => new CraftingKit(p));
175
+ }
176
+ /** Loot tables with pity. */
177
+ get loot() {
178
+ return this.view('loot', (p) => new LootKit(p));
179
+ }
180
+ /** Idle production that catches up on the time away. */
181
+ get production() {
182
+ return this.view('production', (p) => new ProductionKit(p));
183
+ }
184
+ /** Markets' order books. */
185
+ get market() {
186
+ return this.view('market', () => new MarketsKit(this.marketCore));
187
+ }
188
+ /** Markets' vendors. */
189
+ get shops() {
190
+ return this.view('shops', () => new ShopsKit(this.marketCore));
191
+ }
192
+ /** Trades between two players at a market. */
193
+ get trades() {
194
+ return this.view('trades', () => new TradesKit(this.marketCore));
195
+ }
70
196
  /** Composing and deploying the app's tree of starter hubs (developers). */
71
197
  get topology() {
72
198
  return (this.topologyKit ?? (this.topologyKit = new KitTopology(String(this.appId), this.domains.exec)));
@@ -0,0 +1,87 @@
1
+ import { HubState } from '../mirror.js';
2
+ import type { KitRuntime } from '../runtime.js';
3
+ export interface ArenaFighter {
4
+ player: number;
5
+ class: string;
6
+ x: number;
7
+ z: number;
8
+ hp: number;
9
+ max_hp: number;
10
+ /** What casts spend; it regenerates. */
11
+ resource: number;
12
+ statuses: string[];
13
+ kills: number;
14
+ deaths: number;
15
+ /** Down, until the respawn. */
16
+ down: boolean;
17
+ }
18
+ export interface ArenaShot {
19
+ ability: string;
20
+ caster: number;
21
+ x: number;
22
+ z: number;
23
+ }
24
+ export interface ArenaBlast {
25
+ ability: string;
26
+ caster: number;
27
+ x: number;
28
+ z: number;
29
+ radius: number;
30
+ /** When it goes off (Unix ms). */
31
+ at: number;
32
+ }
33
+ /** What the `arena` topic's snapshots carry. */
34
+ export interface ArenaView {
35
+ phase: 'waiting' | 'running' | 'finished';
36
+ width: number;
37
+ depth: number;
38
+ fighters: ArenaFighter[];
39
+ projectiles: ArenaShot[];
40
+ areas: ArenaBlast[];
41
+ kill_target: number;
42
+ ends_at: number | null;
43
+ winner: number | null;
44
+ }
45
+ /** Real-time arenas (the `arena` starter): {@link arena} by key. */
46
+ export declare class ArenasKit {
47
+ private readonly runtime;
48
+ private readonly nodeType;
49
+ private readonly arenas;
50
+ constructor(runtime: KitRuntime, nodeType?: string);
51
+ arena(key: string): ArenaMatch;
52
+ }
53
+ /**
54
+ * One arena: players fight with their class's abilities and the hub referees every hit. A
55
+ * client reports where its player is ({@link move}, a few times a second) and the hub keeps what
56
+ * the class's speed allows; casts are checked for cooldown, resource and range, and land as the hub
57
+ * decides. {@link view} mirrors the `arena` topic (up to five snapshots a second); its `event`
58
+ * messages (`type`: `cast`, `impact`, `kill`, `respawn`, `violation`, `removed`, `finished`) come
59
+ * through `view.onEvent`.
60
+ */
61
+ export declare class ArenaMatch {
62
+ private readonly runtime;
63
+ readonly nodeType: string;
64
+ readonly key: string;
65
+ readonly view: HubState<ArenaView>;
66
+ constructor(runtime: KitRuntime, nodeType: string, key: string);
67
+ watch(): Promise<ArenaView>;
68
+ unwatch(): Promise<void>;
69
+ /** Joins as `heroClass` (the starter's are `warrior` and `mage`). @throws {KitError} `bad_request`, `full`, `started`. */
70
+ join(heroClass: string): Promise<boolean>;
71
+ leave(): Promise<boolean>;
72
+ /** The first to join, or a developer. @throws {KitError} `forbidden`, `not_ready` (one fighter), `started`. */
73
+ start(): Promise<boolean>;
74
+ /**
75
+ * Reports where the player is; resolves with the position the hub kept (a move too fast is cut
76
+ * short, a jump refused). Not sent with an action id: the next report replaces it.
77
+ * @throws {KitError} `forbidden` (removed for movement the warden refused), `conflict` (down).
78
+ */
79
+ move(x: number, z: number): Promise<[number, number]>;
80
+ /**
81
+ * Casts `ability` aimed at `(x, z)`; resolves with whether a hit-scan strike hit someone at once
82
+ * (a projectile or an area lands later, as an `impact` event).
83
+ * @throws {KitError} `cooldown`, `insufficient` (resource), `out_of_reach`, `not_found` (not the class's).
84
+ */
85
+ cast(ability: string, x: number, z: number): Promise<boolean>;
86
+ }
87
+ //# sourceMappingURL=arenas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arenas.d.ts","sourceRoot":"","sources":["../../../src/kit/modules/arenas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,gDAAgD;AAChD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,UA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AAM,CAAC,CAAC;IAIrD;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAG9D"}
@@ -0,0 +1,66 @@
1
+ import { HubState } from '../mirror.js';
2
+ /** Real-time arenas (the `arena` starter): {@link arena} by key. */
3
+ export class ArenasKit {
4
+ constructor(runtime, nodeType = 'arena') {
5
+ this.runtime = runtime;
6
+ this.nodeType = nodeType;
7
+ this.arenas = new Map();
8
+ }
9
+ arena(key) {
10
+ let a = this.arenas.get(key);
11
+ if (!a) {
12
+ a = new ArenaMatch(this.runtime, this.nodeType, key);
13
+ this.arenas.set(key, a);
14
+ }
15
+ return a;
16
+ }
17
+ }
18
+ /**
19
+ * One arena: players fight with their class's abilities and the hub referees every hit. A
20
+ * client reports where its player is ({@link move}, a few times a second) and the hub keeps what
21
+ * the class's speed allows; casts are checked for cooldown, resource and range, and land as the hub
22
+ * decides. {@link view} mirrors the `arena` topic (up to five snapshots a second); its `event`
23
+ * messages (`type`: `cast`, `impact`, `kill`, `respawn`, `violation`, `removed`, `finished`) come
24
+ * through `view.onEvent`.
25
+ */
26
+ export class ArenaMatch {
27
+ constructor(runtime, nodeType, key) {
28
+ this.runtime = runtime;
29
+ this.nodeType = nodeType;
30
+ this.key = key;
31
+ this.view = new HubState(runtime, nodeType, key, 'arena');
32
+ }
33
+ watch() {
34
+ return this.view.start();
35
+ }
36
+ unwatch() {
37
+ return this.view.stop();
38
+ }
39
+ /** Joins as `heroClass` (the starter's are `warrior` and `mage`). @throws {KitError} `bad_request`, `full`, `started`. */
40
+ join(heroClass) {
41
+ return this.runtime.call(this.nodeType, this.key, 'join', { class: heroClass }, { action: true });
42
+ }
43
+ leave() {
44
+ return this.runtime.call(this.nodeType, this.key, 'leave', null, { action: true });
45
+ }
46
+ /** The first to join, or a developer. @throws {KitError} `forbidden`, `not_ready` (one fighter), `started`. */
47
+ start() {
48
+ return this.runtime.call(this.nodeType, this.key, 'start', null, { action: true });
49
+ }
50
+ /**
51
+ * Reports where the player is; resolves with the position the hub kept (a move too fast is cut
52
+ * short, a jump refused). Not sent with an action id: the next report replaces it.
53
+ * @throws {KitError} `forbidden` (removed for movement the warden refused), `conflict` (down).
54
+ */
55
+ move(x, z) {
56
+ return this.runtime.call(this.nodeType, this.key, 'move', { x, z });
57
+ }
58
+ /**
59
+ * Casts `ability` aimed at `(x, z)`; resolves with whether a hit-scan strike hit someone at once
60
+ * (a projectile or an area lands later, as an `impact` event).
61
+ * @throws {KitError} `cooldown`, `insufficient` (resource), `out_of_reach`, `not_found` (not the class's).
62
+ */
63
+ cast(ability, x, z) {
64
+ return this.runtime.call(this.nodeType, this.key, 'cast', { ability, x, z }, { action: true });
65
+ }
66
+ }
@@ -0,0 +1,75 @@
1
+ import { HubState } from '../mirror.js';
2
+ import type { KitRuntime } from '../runtime.js';
3
+ export interface EncounterEnemy {
4
+ id: number;
5
+ kind: string;
6
+ x: number;
7
+ z: number;
8
+ hp: number;
9
+ max_hp: number;
10
+ boss: boolean;
11
+ /** Ticks until its next step. */
12
+ wait: number;
13
+ }
14
+ export interface EncounterTower {
15
+ x: number;
16
+ z: number;
17
+ owner: number;
18
+ }
19
+ /** What the `encounter` topic's snapshots carry. */
20
+ export interface EncounterView {
21
+ phase: 'lobby' | 'running' | 'won' | 'lost';
22
+ players: number[];
23
+ width: number;
24
+ height: number;
25
+ spawn: [number, number];
26
+ base: [number, number];
27
+ base_hp: number;
28
+ gold: number;
29
+ /** The wave under way. */
30
+ wave: number | null;
31
+ waves: number;
32
+ /** When the next wave starts, while one counts down (Unix ms). */
33
+ next_wave_at: number | null;
34
+ enemies: EncounterEnemy[];
35
+ towers: EncounterTower[];
36
+ boss_phase: number;
37
+ /** Kills by player id (the keys are the ids as text). */
38
+ kills: Record<string, number>;
39
+ }
40
+ /** Waves, towers and bosses (the `director` starter): {@link encounter} by key. */
41
+ export declare class EncountersKit {
42
+ private readonly runtime;
43
+ private readonly nodeType;
44
+ private readonly encounters;
45
+ constructor(runtime: KitRuntime, nodeType?: string);
46
+ encounter(key: string): Encounter;
47
+ }
48
+ /**
49
+ * One encounter: waves of enemies down a lane to the players' base, towers the players build (a
50
+ * tower may not cut the lane), strikes on a cooldown, kills that pay gold, and a boss that changes
51
+ * phase as it weakens. {@link view} mirrors the `encounter` topic: snapshots once a second while it
52
+ * runs, and `event` messages (`type`: `wave_started`, `wave_cleared`, `boss_phase`, `won`, `lost`)
53
+ * through `view.onEvent`.
54
+ */
55
+ export declare class Encounter {
56
+ private readonly runtime;
57
+ readonly nodeType: string;
58
+ readonly key: string;
59
+ readonly view: HubState<EncounterView>;
60
+ constructor(runtime: KitRuntime, nodeType: string, key: string);
61
+ watch(): Promise<EncounterView>;
62
+ unwatch(): Promise<void>;
63
+ /** @throws {KitError} `full`. */
64
+ join(): Promise<boolean>;
65
+ /** The first to join, or a developer. @throws {KitError} `forbidden`, `started`, `bad_request` (no way to the base). */
66
+ start(): Promise<boolean>;
67
+ /**
68
+ * Builds a tower at `(x, z)`; resolves with the gold left.
69
+ * @throws {KitError} `blocks_lane`, `insufficient` (gold), `conflict` (taken), `bad_request`, `not_member`.
70
+ */
71
+ build(x: number, z: number): Promise<number>;
72
+ /** Strikes enemy `enemy`; resolves with its hp left. @throws {KitError} `cooldown`, `not_found`, `not_member`. */
73
+ hit(enemy: number): Promise<number>;
74
+ }
75
+ //# sourceMappingURL=encounters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encounters.d.ts","sourceRoot":"","sources":["../../../src/kit/modules/encounters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CA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