@crowdedkingdoms/crowdyjs 18.30.0-test.1 → 18.31.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 CHANGED
@@ -120,6 +120,39 @@ super-admin's session). There is no SDK replacement.
120
120
  `dev`'s SDL after #417 merged (`npm run schema:sync:paths -- --schema <that schema.gql>`, then
121
121
  `npm run codegen`).
122
122
 
123
+ ## 18.31.0: the ChunkStore merges by the server's time
124
+
125
+ **What it needs.** ck-api `v2.69.0` (cks-game-api #668): `chunks.get` selects each voxel state's
126
+ `updatedAt`, which an older Game API refuses. Promote the Game API before the SDK on each tier.
127
+ Buddy `v0.46.0` dates a realtime edit with the moment the server accepted it, so a catch-up's
128
+ `createdAt` and a notification's `epochMillis` come from one clock; with an older Buddy the merge
129
+ still holds, by the database's write time.
130
+
131
+ **What changes for a game using `session.chunks`.**
132
+
133
+ - **Changes merge by the server's time.** Each voxel keeps the value the server confirmed last
134
+ and when: a stored copy's write, an entry's `updatedAt`, a notification's `epochMillis`, a
135
+ recorded edit's `createdAt`. A change older than the value held is dropped, so a slow
136
+ notification or a late page no longer overwrites a newer value. A time more than 5 minutes past
137
+ this machine's clock counts as 5 minutes ahead. `confirmedAt(coord, x, y, z)` reads it.
138
+ - **A change that arrives while a chunk loads is kept.** The store tracks a chunk it is reading,
139
+ and its copy merges under what arrived meanwhile: a newer change stays, an older one gives way.
140
+ It dropped them before.
141
+ - **Another client's edit goes under this client's unanswered edit.** The voxel keeps showing your
142
+ edit until the server answers it; if the server refuses it (or it times out), the voxel shows
143
+ the other client's edit, not what it held before yours. `VoxelEditRefusal.restored` is true
144
+ whenever the voxel stopped showing the edit. It showed the other edit at once before, and your
145
+ echo put yours back.
146
+ - **An echo matches by its value too**: sender, sequence number, voxel, type and state. A change
147
+ with your uuid and sequence number but another value is another change.
148
+ - **`catchUp(since, boxes?)` covers every chunk the store tracks**, the never-stored (`missing`)
149
+ ones included, read in boxes of at most 17³; or the boxes you pass (cut to 17³; more than 64
150
+ resolves false). It covered the last `ensureAround` area. It resolves whether anything was read.
151
+ - **`evict(coord)` and `pruneIf(predicate)`** drop chunks for a view that is not a cube; a chunk
152
+ queued for write-back stays. `pruneBeyond` returns how many it dropped.
153
+ - **`hydrate(coord)` resolves whether its copy was applied**: false for a chunk never stored, or one
154
+ evicted while the read was out (it is not brought back).
155
+
123
156
  ## 18.30.0: a ChunkStore the game can stand behind
124
157
 
125
158
  **What it needs.** What 18.29.0 needs (ck-api `v2.68.0` for the GraphQL proxy); the box reads and
package/README.md CHANGED
@@ -34,6 +34,7 @@ so it needs that Game API or newer; promote the Game API before the SDK on each
34
34
 
35
35
  | CrowdyJS | Needs the Game API (ck-api) |
36
36
  | --- | --- |
37
+ | 18.31.0 | v2.69.0 or later (`chunks.get` selects `VoxelState.updatedAt`) |
37
38
  | 18.30.0 | as 18.29.0 (`ChunkStore` reads boxes and `since`: v2.67.0) |
38
39
  | 18.29.0 | v2.68.0 or later for the GraphQL proxy (`udpNotifications` selects `ChunkChangedNotification`) |
39
40
  | 18.28.0 | v2.67.0 or later (`gameApps.nearbyGrids` selects `permissionKeys`) |
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * GENERATED — do not edit. The operator tooling's
3
- * `sync-client-origins.mjs --write --tier test` writes this file, and
3
+ * `sync-client-origins.mjs --write --tier dev` writes this file, and
4
4
  * `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
5
5
  * host that declaration does not carry. Regenerate; never hand-edit.
6
6
  *
@@ -10,14 +10,14 @@
10
10
  * than no default at all. Every fallback this SDK ever removed named a host that
11
11
  * was already dead. A generated file plus a gate is what makes this one different.
12
12
  *
13
- * Source: the operator's per-tier public CK API origin declaration, tier 'test'
13
+ * Source: the operator's per-tier public CK API origin declaration, tier 'dev'
14
14
  */
15
15
  /** The tier this build of the SDK is published for. */
16
- export declare const CROWDY_DEFAULT_TIER = "test";
16
+ export declare const CROWDY_DEFAULT_TIER = "dev";
17
17
  /** The public CK API origin for that tier. */
18
- export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.test.crowdedkingdoms.com";
18
+ export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.dev.crowdedkingdoms.com";
19
19
  /** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
20
- export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.test.crowdedkingdoms.com";
20
+ export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.dev.crowdedkingdoms.com";
21
21
  /** The bare hostname, for callers that need to compare rather than dial. */
22
- export declare const CROWDY_DEFAULT_HOST = "ck.test.crowdedkingdoms.com";
22
+ export declare const CROWDY_DEFAULT_HOST = "ck.dev.crowdedkingdoms.com";
23
23
  //# sourceMappingURL=default-origin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,gCAAgC,CAAC"}
1
+ {"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,uCAAuC,CAAC;AAE/E,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,+BAA+B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * GENERATED — do not edit. The operator tooling's
3
- * `sync-client-origins.mjs --write --tier test` writes this file, and
3
+ * `sync-client-origins.mjs --write --tier dev` writes this file, and
4
4
  * `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
5
5
  * host that declaration does not carry. Regenerate; never hand-edit.
6
6
  *
@@ -10,13 +10,13 @@
10
10
  * than no default at all. Every fallback this SDK ever removed named a host that
11
11
  * was already dead. A generated file plus a gate is what makes this one different.
12
12
  *
13
- * Source: the operator's per-tier public CK API origin declaration, tier 'test'
13
+ * Source: the operator's per-tier public CK API origin declaration, tier 'dev'
14
14
  */
15
15
  /** The tier this build of the SDK is published for. */
16
- export const CROWDY_DEFAULT_TIER = 'test';
16
+ export const CROWDY_DEFAULT_TIER = 'dev';
17
17
  /** The public CK API origin for that tier. */
18
- export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.test.crowdedkingdoms.com';
18
+ export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.dev.crowdedkingdoms.com';
19
19
  /** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
20
- export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.test.crowdedkingdoms.com';
20
+ export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.dev.crowdedkingdoms.com';
21
21
  /** The bare hostname, for callers that need to compare rather than dial. */
22
- export const CROWDY_DEFAULT_HOST = 'ck.test.crowdedkingdoms.com';
22
+ export const CROWDY_DEFAULT_HOST = 'ck.dev.crowdedkingdoms.com';
@@ -10044,6 +10044,8 @@ export type VoxelState = {
10044
10044
  __typename?: 'VoxelState';
10045
10045
  /** BASE64-encoded binary state blob for this voxel (decode from base64); null/empty when the voxel has no extra state. */
10046
10046
  state: Maybe<Scalars['String']['output']>;
10047
+ /** When this entry was last written: the recorded voxel edit's time, or the chunk's own write for a state stored with it. A client that also hears realtime voxel updates keeps, per voxel, the newer of this and a notification's time (a realtime edit is recorded at the time its notification carries, replication servers v0.46.0). Null when the read did not apply recorded edits. Game API v2.69.0. */
10048
+ updatedAt: Maybe<Scalars['DateTime']['output']>;
10047
10049
  /** Voxel position within the chunk (signed 16-bit per axis, app-defined). */
10048
10050
  voxelCoord: VoxelCoordinates;
10049
10051
  /** Voxel type id at this position (signed 16-bit, app-defined). */