@crowdedkingdoms/crowdyjs 18.6.0-dev.1 → 18.7.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 +89 -0
- package/README.md +108 -4
- package/dist/binary-wire.d.ts +30 -2
- package/dist/binary-wire.d.ts.map +1 -1
- package/dist/binary-wire.js +61 -3
- package/dist/domains/appAccess.d.ts +32 -1
- package/dist/domains/appAccess.d.ts.map +1 -1
- package/dist/domains/appAccess.js +49 -1
- package/dist/domains/channels.d.ts +8 -3
- package/dist/domains/channels.d.ts.map +1 -1
- package/dist/domains/channels.js +8 -3
- package/dist/domains/exec.d.ts +14 -0
- package/dist/domains/exec.d.ts.map +1 -1
- package/dist/domains/exec.js +13 -1
- package/dist/domains/grids.d.ts +1 -0
- package/dist/domains/grids.d.ts.map +1 -1
- package/dist/domains/grids.js +1 -0
- package/dist/domains/portal.d.ts +18 -0
- package/dist/domains/portal.d.ts.map +1 -1
- package/dist/domains/portal.js +1 -1
- package/dist/domains/udp.d.ts +27 -8
- package/dist/domains/udp.d.ts.map +1 -1
- package/dist/domains/udp.js +39 -9
- package/dist/domains/users.d.ts +23 -2
- package/dist/domains/users.d.ts.map +1 -1
- package/dist/domains/users.js +34 -2
- package/dist/domains/voxels.d.ts +4 -3
- package/dist/domains/voxels.d.ts.map +1 -1
- package/dist/domains/voxels.js +4 -3
- package/dist/errors.d.ts +52 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +74 -0
- package/dist/generated/graphql-schema.d.ts +160 -48
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/generated/graphql-schema.js +3 -1
- package/dist/generated/graphql.d.ts +153 -17
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +24 -17
- package/dist/grid-mods/grid-host-calls.d.ts +34 -0
- package/dist/grid-mods/grid-host-calls.d.ts.map +1 -1
- package/dist/grid-mods/grid-host-calls.js +28 -5
- package/dist/grid-mods/index.d.ts +1 -1
- package/dist/grid-mods/index.d.ts.map +1 -1
- package/dist/grid-mods/index.js +1 -1
- package/dist/grid-scope.d.ts +3 -0
- package/dist/grid-scope.d.ts.map +1 -1
- package/dist/grid-scope.js +6 -0
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/media/voice-frames.d.ts +258 -0
- package/dist/media/voice-frames.d.ts.map +1 -0
- package/dist/media/voice-frames.js +424 -0
- package/dist/metrics.d.ts +1 -1
- package/dist/realtime.d.ts +19 -3
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +8 -0
- package/dist/stores/actors.d.ts +3 -1
- package/dist/stores/actors.d.ts.map +1 -1
- package/dist/stores/chunks.d.ts +65 -6
- package/dist/stores/chunks.d.ts.map +1 -1
- package/dist/stores/chunks.js +161 -19
- package/dist/stores/index.d.ts +2 -2
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +1 -1
- package/dist/stores/keys.d.ts +5 -0
- package/dist/stores/keys.d.ts.map +1 -1
- package/dist/stores/keys.js +7 -0
- package/dist/stores/session.d.ts +1 -1
- package/dist/stores/session.d.ts.map +1 -1
- package/dist/stores/session.js +2 -0
- package/dist/types.d.ts +49 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/stores/chunks.d.ts
CHANGED
|
@@ -4,10 +4,29 @@
|
|
|
4
4
|
* optimistic local edits, and the deterministic-worldgen write-back pattern.
|
|
5
5
|
* Replaces the WorldStreamer + WorldState + codec plumbing every voxel game
|
|
6
6
|
* hand-writes (~860 LOC in Blocks with Friends).
|
|
7
|
+
*
|
|
8
|
+
* It is a helper for 16×16×16 chunks with one byte per voxel. Voxel positions and
|
|
9
|
+
* types are the app's signed 16-bit values, which the platform does not check; an
|
|
10
|
+
* edit the dense grid cannot hold (a type outside 0-255, a position outside 0-15)
|
|
11
|
+
* goes to the chunk's `overlay` instead, and reads of that voxel return it. An app
|
|
12
|
+
* with other addressing reads the raw voxel events (`udp.subscribe`'s
|
|
13
|
+
* `voxelUpdate`, `chunks.get`'s `voxelStates`).
|
|
7
14
|
*/
|
|
8
15
|
import { type StateCodec } from './codec.js';
|
|
9
16
|
import { type ChunkCoord } from './keys.js';
|
|
10
17
|
import type { WorldSessionContext } from './session.js';
|
|
18
|
+
/**
|
|
19
|
+
* A voxel the dense grid cannot hold, kept in its chunk's `overlay`: a type outside 0-255, or a
|
|
20
|
+
* position outside 0-15 (the app's signed 16-bit values, as the edit carried them).
|
|
21
|
+
*/
|
|
22
|
+
export interface ChunkOverlayVoxel<TVoxelState = string> {
|
|
23
|
+
readonly x: number;
|
|
24
|
+
readonly y: number;
|
|
25
|
+
readonly z: number;
|
|
26
|
+
voxelType: number;
|
|
27
|
+
/** Its typed state, when it has one. */
|
|
28
|
+
state?: TVoxelState;
|
|
29
|
+
}
|
|
11
30
|
/** Load lifecycle of a cached chunk. */
|
|
12
31
|
export type ChunkLoadState = 'loading' | 'loaded' | 'missing' | 'seeded' | 'failed';
|
|
13
32
|
/**
|
|
@@ -20,10 +39,17 @@ export interface CachedChunk<TVoxelState = string, TChunkState = string> {
|
|
|
20
39
|
/**
|
|
21
40
|
* Dense voxel-type grid (4096 bytes), null when unknown. Indexed
|
|
22
41
|
* `x + y*16 + z*256` by default; see {@link ChunkStoreConfig.voxelIndex}.
|
|
42
|
+
* Holds 0 where an in-grid voxel's type is in {@link overlay}.
|
|
23
43
|
*/
|
|
24
44
|
voxels: Uint8Array | null;
|
|
25
|
-
/** Sparse typed per-voxel state by voxel index. */
|
|
45
|
+
/** Sparse typed per-voxel state by voxel index (voxels in the dense grid). */
|
|
26
46
|
voxelStates: Map<number, TVoxelState>;
|
|
47
|
+
/**
|
|
48
|
+
* The voxels the dense grid cannot hold (a type outside 0-255, a position outside 0-15), each
|
|
49
|
+
* with its state, keyed by `voxelKey(x, y, z)`. {@link ChunkStore.voxelTypeAt} and
|
|
50
|
+
* {@link ChunkStore.voxelStateAt} read them first.
|
|
51
|
+
*/
|
|
52
|
+
overlay: Map<string, ChunkOverlayVoxel<TVoxelState>>;
|
|
27
53
|
/** Typed chunk-level state (null when absent/undecoded). */
|
|
28
54
|
chunkState: TChunkState | null;
|
|
29
55
|
loadState: ChunkLoadState;
|
|
@@ -116,10 +142,14 @@ export interface ChunkStoreConfig<TVoxelState = string, TChunkState = string> {
|
|
|
116
142
|
/** A voxel edit for {@link ChunkStore.setVoxel}. */
|
|
117
143
|
export interface SetVoxelInput<TVoxelState> {
|
|
118
144
|
chunk: ChunkCoord;
|
|
119
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* Within-chunk voxel coordinates: 0-15 each for the dense grid; any other signed 16-bit value
|
|
147
|
+
* is kept in the chunk's overlay.
|
|
148
|
+
*/
|
|
120
149
|
x: number;
|
|
121
150
|
y: number;
|
|
122
151
|
z: number;
|
|
152
|
+
/** The app's voxel type (signed 16-bit); outside 0-255 it is kept in the overlay. */
|
|
123
153
|
voxelType: number;
|
|
124
154
|
/** Typed per-voxel state (encoded with the store's codec). */
|
|
125
155
|
state?: TVoxelState;
|
|
@@ -135,8 +165,16 @@ export interface SetVoxelInput<TVoxelState> {
|
|
|
135
165
|
* server never stored as `missing`, and hands them to your `onMissing`
|
|
136
166
|
* worldgen hook.
|
|
137
167
|
* - Realtime `voxelUpdate` notifications merge into the cache automatically
|
|
138
|
-
* (dense grid write + typed state decode + revision bump + change event
|
|
139
|
-
* -
|
|
168
|
+
* (dense grid write + typed state decode + revision bump + change event; an
|
|
169
|
+
* edit with a type outside 0-255 or a position outside 0-15 goes to the
|
|
170
|
+
* chunk's `overlay` instead).
|
|
171
|
+
* - `setVoxel` applies locally (optimistic) and replicates via the UDP path. The
|
|
172
|
+
* server delivers every accepted edit back to its sender: that echo is matched
|
|
173
|
+
* (sender uuid + sequence number + voxel) and not applied again, so a local edit
|
|
174
|
+
* fires one change event, and an older echo never rolls back a newer local edit.
|
|
175
|
+
* It is applied only when another client's edit of that voxel arrived in
|
|
176
|
+
* between (the server ordered yours last) or the edit was sent with
|
|
177
|
+
* `optimistic: false`.
|
|
140
178
|
* - `seed`/`flush` implement deterministic-worldgen write-back through
|
|
141
179
|
* `chunks.update`, one throttled chunk at a time.
|
|
142
180
|
*
|
|
@@ -166,6 +204,8 @@ export declare class ChunkStore<TVoxelState = string, TChunkState = string> {
|
|
|
166
204
|
private readonly voxelIndex;
|
|
167
205
|
private revisionValue;
|
|
168
206
|
private sequence;
|
|
207
|
+
/** This client's edits not yet echoed back, oldest first, per `chunkKey|voxelKey`. */
|
|
208
|
+
private readonly pendingEdits;
|
|
169
209
|
constructor(ctx: WorldSessionContext, config?: ChunkStoreConfig<TVoxelState, TChunkState>);
|
|
170
210
|
/** Bumped on every cache change — poll it cheaply from a render loop. */
|
|
171
211
|
get revision(): number;
|
|
@@ -173,9 +213,12 @@ export declare class ChunkStore<TVoxelState = string, TChunkState = string> {
|
|
|
173
213
|
get(coord: ChunkCoord): CachedChunk<TVoxelState, TChunkState> | undefined;
|
|
174
214
|
/** Every tracked chunk (any load state). */
|
|
175
215
|
list(): Array<CachedChunk<TVoxelState, TChunkState>>;
|
|
176
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* The voxel type at a within-chunk coordinate: the overlay's when it holds that voxel, else the
|
|
218
|
+
* dense grid's (0 when unknown, or for a position outside the grid with no overlay entry).
|
|
219
|
+
*/
|
|
177
220
|
voxelTypeAt(coord: ChunkCoord, x: number, y: number, z: number): number;
|
|
178
|
-
/** The typed per-voxel state at a within-chunk coordinate, if any. */
|
|
221
|
+
/** The typed per-voxel state at a within-chunk coordinate (the overlay's first), if any. */
|
|
179
222
|
voxelStateAt(coord: ChunkCoord, x: number, y: number, z: number): TVoxelState | undefined;
|
|
180
223
|
/** Subscribe to per-chunk changes (loads, merges, edits). @returns off. */
|
|
181
224
|
onChunkChanged(listener: (chunk: CachedChunk<TVoxelState, TChunkState>) => void): () => void;
|
|
@@ -245,7 +288,23 @@ export declare class ChunkStore<TVoxelState = string, TChunkState = string> {
|
|
|
245
288
|
private forgetWriteBack;
|
|
246
289
|
private applyServerChunk;
|
|
247
290
|
private markMissing;
|
|
291
|
+
private rememberEdit;
|
|
292
|
+
/** The unexpired pending edits for one voxel, dropping the expired ones. */
|
|
293
|
+
private livePendingEdits;
|
|
294
|
+
/**
|
|
295
|
+
* Match a realtime voxel edit against this client's pending edits. Returns whether to apply it.
|
|
296
|
+
* The server delivers every accepted edit back to its sender: the echo of an edit already
|
|
297
|
+
* applied optimistically is not applied again (no second change event), and an echo is never
|
|
298
|
+
* applied over a newer local edit of the same voxel. Another client's edit is applied, and
|
|
299
|
+
* marks the pending local edits of that voxel stale so their echoes restore them.
|
|
300
|
+
*/
|
|
301
|
+
private takeEcho;
|
|
248
302
|
private applyVoxel;
|
|
303
|
+
/**
|
|
304
|
+
* Keep a voxel the dense grid cannot hold in the overlay. An in-grid position with a wide type
|
|
305
|
+
* leaves 0 in the grid and no dense state; one outside the grid never touches the grid.
|
|
306
|
+
*/
|
|
307
|
+
private putOverlay;
|
|
249
308
|
private ensureEntry;
|
|
250
309
|
private decodeChunkState;
|
|
251
310
|
private touch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/stores/chunks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/stores/chunks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAUL,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA+FxD;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,WAAW,GAAG,MAAM;IACrD,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAA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O,GAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI;IAWxF,qEAAqE;IACrE,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAQlC,8CAA8C;IAC9C,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IAY9E,iFAAiF;IACjF,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAarD;;;OAGG;YACW,WAAW;IAmDzB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,YAAY;IAWpB,4EAA4E;IAC5E,OAAO,CAAC,gBAAgB;IAQxB;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ;IAqBhB,OAAO,CAAC,UAAU;IAkClB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,WAAW;IAsBnB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,KAAK;IAOb,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,YAAY;CAIrB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,GAAG,MAAM,EAAE,WAAW,GAAG,MAAM,EACzE,GAAG,EAAE,mBAAmB,EACxB,MAAM,GAAE,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAM,GACtD,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAEtC"}
|
package/dist/stores/chunks.js
CHANGED
|
@@ -4,10 +4,18 @@
|
|
|
4
4
|
* optimistic local edits, and the deterministic-worldgen write-back pattern.
|
|
5
5
|
* Replaces the WorldStreamer + WorldState + codec plumbing every voxel game
|
|
6
6
|
* hand-writes (~860 LOC in Blocks with Friends).
|
|
7
|
+
*
|
|
8
|
+
* It is a helper for 16×16×16 chunks with one byte per voxel. Voxel positions and
|
|
9
|
+
* types are the app's signed 16-bit values, which the platform does not check; an
|
|
10
|
+
* edit the dense grid cannot hold (a type outside 0-255, a position outside 0-15)
|
|
11
|
+
* goes to the chunk's `overlay` instead, and reads of that voxel return it. An app
|
|
12
|
+
* with other addressing reads the raw voxel events (`udp.subscribe`'s
|
|
13
|
+
* `voxelUpdate`, `chunks.get`'s `voxelStates`).
|
|
7
14
|
*/
|
|
15
|
+
import { assertVoxelEdit } from '../binary-wire.js';
|
|
8
16
|
import { generateCrowdyUuid, decodeBase64, encodeBase64 } from '../utils.js';
|
|
9
17
|
import { rawCodec } from './codec.js';
|
|
10
|
-
import { CHUNK_VOLUME, chunkDistance, chunkKey, chunksAround, fromChunkInput, toChunkInput, voxelIndex, } from './keys.js';
|
|
18
|
+
import { CHUNK_SIZE, CHUNK_VOLUME, chunkDistance, chunkKey, chunksAround, fromChunkInput, toChunkInput, voxelIndex, voxelKey, } from './keys.js';
|
|
11
19
|
/**
|
|
12
20
|
* Hydrations in flight at once. Each is one request, and a bulk load returns hundreds of
|
|
13
21
|
* chunks: sent together, the API refuses a share of them as busy.
|
|
@@ -17,6 +25,8 @@ const HYDRATE_CONCURRENCY = 8;
|
|
|
17
25
|
const BUSY_ATTEMPTS = 4;
|
|
18
26
|
/** A chunk whose hydration failed this many times in a row is not asked for again. */
|
|
19
27
|
const HYDRATE_GIVE_UP = 3;
|
|
28
|
+
/** How long a local voxel edit waits for its echo before it is forgotten (a lost or refused send). */
|
|
29
|
+
const PENDING_EDIT_TTL_MS = 10000;
|
|
20
30
|
/** The platform refused the call before running it: asking again can succeed. */
|
|
21
31
|
function refusedBeforeRunning(error) {
|
|
22
32
|
const e = error;
|
|
@@ -69,6 +79,14 @@ async function whenNotBusy(call) {
|
|
|
69
79
|
}
|
|
70
80
|
}
|
|
71
81
|
}
|
|
82
|
+
/** A within-chunk position inside the 16³ grid (0-15 on each axis). */
|
|
83
|
+
function inDenseGrid(x, y, z) {
|
|
84
|
+
return [x, y, z].every((v) => Number.isInteger(v) && v >= 0 && v < CHUNK_SIZE);
|
|
85
|
+
}
|
|
86
|
+
/** Whether the dense grid can hold this edit: a position inside it and a type 0-255. */
|
|
87
|
+
function fitsDenseGrid(x, y, z, voxelType) {
|
|
88
|
+
return inDenseGrid(x, y, z) && Number.isInteger(voxelType) && voxelType >= 0 && voxelType <= 255;
|
|
89
|
+
}
|
|
72
90
|
/**
|
|
73
91
|
* The SDK-managed **chunk/voxel cache** — the client-side source of truth
|
|
74
92
|
* for terrain:
|
|
@@ -78,8 +96,16 @@ async function whenNotBusy(call) {
|
|
|
78
96
|
* server never stored as `missing`, and hands them to your `onMissing`
|
|
79
97
|
* worldgen hook.
|
|
80
98
|
* - Realtime `voxelUpdate` notifications merge into the cache automatically
|
|
81
|
-
* (dense grid write + typed state decode + revision bump + change event
|
|
82
|
-
* -
|
|
99
|
+
* (dense grid write + typed state decode + revision bump + change event; an
|
|
100
|
+
* edit with a type outside 0-255 or a position outside 0-15 goes to the
|
|
101
|
+
* chunk's `overlay` instead).
|
|
102
|
+
* - `setVoxel` applies locally (optimistic) and replicates via the UDP path. The
|
|
103
|
+
* server delivers every accepted edit back to its sender: that echo is matched
|
|
104
|
+
* (sender uuid + sequence number + voxel) and not applied again, so a local edit
|
|
105
|
+
* fires one change event, and an older echo never rolls back a newer local edit.
|
|
106
|
+
* It is applied only when another client's edit of that voxel arrived in
|
|
107
|
+
* between (the server ordered yours last) or the edit was sent with
|
|
108
|
+
* `optimistic: false`.
|
|
83
109
|
* - `seed`/`flush` implement deterministic-worldgen write-back through
|
|
84
110
|
* `chunks.update`, one throttled chunk at a time.
|
|
85
111
|
*
|
|
@@ -105,6 +131,8 @@ export class ChunkStore {
|
|
|
105
131
|
this.fallbackUuid = generateCrowdyUuid();
|
|
106
132
|
this.revisionValue = 0;
|
|
107
133
|
this.sequence = 0;
|
|
134
|
+
/** This client's edits not yet echoed back, oldest first, per `chunkKey|voxelKey`. */
|
|
135
|
+
this.pendingEdits = new Map();
|
|
108
136
|
this.voxelStateCodec =
|
|
109
137
|
config.voxelStateCodec ?? rawCodec;
|
|
110
138
|
this.chunkStateCodec =
|
|
@@ -122,6 +150,8 @@ export class ChunkStore {
|
|
|
122
150
|
const chunk = this.chunks.get(chunkKey(coord));
|
|
123
151
|
if (!chunk)
|
|
124
152
|
return; // only merge into chunks we track
|
|
153
|
+
if (!this.takeEcho(chunk, notification))
|
|
154
|
+
return;
|
|
125
155
|
this.applyVoxel(chunk, notification.voxelX, notification.voxelY, notification.voxelZ, notification.voxelType, notification.voxelState || undefined);
|
|
126
156
|
}));
|
|
127
157
|
const writeBackInterval = config.writeBackIntervalMs ?? 700;
|
|
@@ -143,14 +173,32 @@ export class ChunkStore {
|
|
|
143
173
|
list() {
|
|
144
174
|
return [...this.chunks.values()];
|
|
145
175
|
}
|
|
146
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* The voxel type at a within-chunk coordinate: the overlay's when it holds that voxel, else the
|
|
178
|
+
* dense grid's (0 when unknown, or for a position outside the grid with no overlay entry).
|
|
179
|
+
*/
|
|
147
180
|
voxelTypeAt(coord, x, y, z) {
|
|
148
181
|
const chunk = this.chunks.get(chunkKey(coord));
|
|
149
|
-
|
|
182
|
+
if (!chunk)
|
|
183
|
+
return 0;
|
|
184
|
+
const wide = chunk.overlay.get(voxelKey(x, y, z));
|
|
185
|
+
if (wide)
|
|
186
|
+
return wide.voxelType;
|
|
187
|
+
if (!inDenseGrid(x, y, z))
|
|
188
|
+
return 0;
|
|
189
|
+
return chunk.voxels?.[this.voxelIndex(x, y, z)] ?? 0;
|
|
150
190
|
}
|
|
151
|
-
/** The typed per-voxel state at a within-chunk coordinate, if any. */
|
|
191
|
+
/** The typed per-voxel state at a within-chunk coordinate (the overlay's first), if any. */
|
|
152
192
|
voxelStateAt(coord, x, y, z) {
|
|
153
|
-
|
|
193
|
+
const chunk = this.chunks.get(chunkKey(coord));
|
|
194
|
+
if (!chunk)
|
|
195
|
+
return undefined;
|
|
196
|
+
const wide = chunk.overlay.get(voxelKey(x, y, z));
|
|
197
|
+
if (wide)
|
|
198
|
+
return wide.state;
|
|
199
|
+
if (!inDenseGrid(x, y, z))
|
|
200
|
+
return undefined;
|
|
201
|
+
return chunk.voxelStates.get(this.voxelIndex(x, y, z));
|
|
154
202
|
}
|
|
155
203
|
/** Subscribe to per-chunk changes (loads, merges, edits). @returns off. */
|
|
156
204
|
onChunkChanged(listener) {
|
|
@@ -292,7 +340,23 @@ export class ChunkStore {
|
|
|
292
340
|
chunk.voxels = decodeBase64(full.voxels);
|
|
293
341
|
chunk.chunkState = this.decodeChunkState(full.chunkState ?? null);
|
|
294
342
|
for (const entry of full.voxelStates ?? []) {
|
|
295
|
-
const
|
|
343
|
+
const { x, y, z } = entry.voxelCoord;
|
|
344
|
+
if (!fitsDenseGrid(x, y, z, entry.voxelType)) {
|
|
345
|
+
const key = voxelKey(x, y, z);
|
|
346
|
+
let state = entry.state ? chunk.overlay.get(key)?.state : undefined;
|
|
347
|
+
if (entry.state) {
|
|
348
|
+
try {
|
|
349
|
+
state = this.voxelStateCodec.decode(entry.state);
|
|
350
|
+
}
|
|
351
|
+
catch {
|
|
352
|
+
// As below: a foreign blob keeps the state already cached.
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
this.putOverlay(chunk, x, y, z, entry.voxelType, state);
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const index = this.voxelIndex(x, y, z);
|
|
359
|
+
chunk.overlay.delete(voxelKey(x, y, z));
|
|
296
360
|
// A chunk stored with `voxels: null` still carries its recorded edits.
|
|
297
361
|
if (!chunk.voxels)
|
|
298
362
|
chunk.voxels = new Uint8Array(CHUNK_VOLUME);
|
|
@@ -319,16 +383,29 @@ export class ChunkStore {
|
|
|
319
383
|
* acceptance.
|
|
320
384
|
*/
|
|
321
385
|
async setVoxel(input) {
|
|
386
|
+
const encodedState = input.state !== undefined ? this.voxelStateCodec.encode(input.state) : undefined;
|
|
387
|
+
const voxel = { x: input.x, y: input.y, z: input.z };
|
|
388
|
+
assertVoxelEdit({ voxel, voxelType: input.voxelType, voxelState: encodedState });
|
|
322
389
|
const chunk = this.ensureEntry(input.chunk);
|
|
323
|
-
|
|
390
|
+
const optimistic = input.optimistic ?? true;
|
|
391
|
+
if (optimistic) {
|
|
324
392
|
this.applyVoxel(chunk, input.x, input.y, input.z, input.voxelType, undefined, input.state);
|
|
325
393
|
}
|
|
326
394
|
const sequenceNumber = this.nextSequence();
|
|
395
|
+
const uuid = this.senderUuid();
|
|
396
|
+
this.rememberEdit(chunk, voxel, {
|
|
397
|
+
uuid,
|
|
398
|
+
sequenceNumber,
|
|
399
|
+
voxelType: input.voxelType,
|
|
400
|
+
encodedState,
|
|
401
|
+
sentAt: this.now(),
|
|
402
|
+
stale: !optimistic,
|
|
403
|
+
});
|
|
327
404
|
this.ctx.trackSend({
|
|
328
405
|
kind: 'voxelUpdate',
|
|
329
406
|
sequenceNumber,
|
|
330
407
|
sentAt: this.now(),
|
|
331
|
-
uuid
|
|
408
|
+
uuid,
|
|
332
409
|
detail: { chunk: input.chunk, x: input.x, y: input.y, z: input.z },
|
|
333
410
|
});
|
|
334
411
|
// Omit voxelState when the caller did not supply state. Sending '' is
|
|
@@ -338,12 +415,10 @@ export class ChunkStore {
|
|
|
338
415
|
return this.ctx.client.udp.sendVoxelUpdate({
|
|
339
416
|
appId: this.ctx.appId,
|
|
340
417
|
chunk: toChunkInput(input.chunk),
|
|
341
|
-
uuid
|
|
342
|
-
voxel
|
|
418
|
+
uuid,
|
|
419
|
+
voxel,
|
|
343
420
|
voxelType: input.voxelType,
|
|
344
|
-
...(
|
|
345
|
-
? { voxelState: this.voxelStateCodec.encode(input.state) }
|
|
346
|
-
: {}),
|
|
421
|
+
...(encodedState !== undefined ? { voxelState: encodedState } : {}),
|
|
347
422
|
sequenceNumber,
|
|
348
423
|
...(this.config.distance !== undefined ? { distance: this.config.distance } : {}),
|
|
349
424
|
...(this.config.decayRate !== undefined
|
|
@@ -495,11 +570,47 @@ export class ChunkStore {
|
|
|
495
570
|
this.seed(coord, generated.voxels, { writeBack: generated.writeBack ?? true });
|
|
496
571
|
}
|
|
497
572
|
}
|
|
573
|
+
rememberEdit(chunk, voxel, edit) {
|
|
574
|
+
const key = `${chunk.key}|${voxelKey(voxel.x, voxel.y, voxel.z)}`;
|
|
575
|
+
const edits = this.livePendingEdits(key);
|
|
576
|
+
edits.push(edit);
|
|
577
|
+
this.pendingEdits.set(key, edits);
|
|
578
|
+
}
|
|
579
|
+
/** The unexpired pending edits for one voxel, dropping the expired ones. */
|
|
580
|
+
livePendingEdits(key) {
|
|
581
|
+
const cutoff = this.now() - PENDING_EDIT_TTL_MS;
|
|
582
|
+
const edits = (this.pendingEdits.get(key) ?? []).filter((edit) => edit.sentAt >= cutoff);
|
|
583
|
+
if (edits.length === 0)
|
|
584
|
+
this.pendingEdits.delete(key);
|
|
585
|
+
else
|
|
586
|
+
this.pendingEdits.set(key, edits);
|
|
587
|
+
return edits;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Match a realtime voxel edit against this client's pending edits. Returns whether to apply it.
|
|
591
|
+
* The server delivers every accepted edit back to its sender: the echo of an edit already
|
|
592
|
+
* applied optimistically is not applied again (no second change event), and an echo is never
|
|
593
|
+
* applied over a newer local edit of the same voxel. Another client's edit is applied, and
|
|
594
|
+
* marks the pending local edits of that voxel stale so their echoes restore them.
|
|
595
|
+
*/
|
|
596
|
+
takeEcho(chunk, notification) {
|
|
597
|
+
const key = `${chunk.key}|${voxelKey(notification.voxelX, notification.voxelY, notification.voxelZ)}`;
|
|
598
|
+
const edits = this.livePendingEdits(key);
|
|
599
|
+
if (edits.length === 0)
|
|
600
|
+
return true;
|
|
601
|
+
const index = edits.findIndex((edit) => edit.uuid === notification.uuid && edit.sequenceNumber === notification.sequenceNumber);
|
|
602
|
+
if (index < 0) {
|
|
603
|
+
for (const edit of edits)
|
|
604
|
+
edit.stale = true;
|
|
605
|
+
return true;
|
|
606
|
+
}
|
|
607
|
+
const [echoed] = edits.splice(index, 1);
|
|
608
|
+
if (edits.length === 0)
|
|
609
|
+
this.pendingEdits.delete(key);
|
|
610
|
+
const newerLocalEdit = edits.length > index;
|
|
611
|
+
return echoed.stale && !newerLocalEdit;
|
|
612
|
+
}
|
|
498
613
|
applyVoxel(chunk, x, y, z, voxelType, encodedState, decodedState) {
|
|
499
|
-
if (!chunk.voxels)
|
|
500
|
-
chunk.voxels = new Uint8Array(CHUNK_VOLUME);
|
|
501
|
-
const index = this.voxelIndex(x, y, z);
|
|
502
|
-
chunk.voxels[index] = voxelType;
|
|
503
614
|
let state = decodedState;
|
|
504
615
|
if (state === undefined && encodedState) {
|
|
505
616
|
try {
|
|
@@ -509,6 +620,16 @@ export class ChunkStore {
|
|
|
509
620
|
state = undefined;
|
|
510
621
|
}
|
|
511
622
|
}
|
|
623
|
+
if (!fitsDenseGrid(x, y, z, voxelType)) {
|
|
624
|
+
this.putOverlay(chunk, x, y, z, voxelType, state);
|
|
625
|
+
this.touch(chunk);
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
chunk.overlay.delete(voxelKey(x, y, z));
|
|
629
|
+
if (!chunk.voxels)
|
|
630
|
+
chunk.voxels = new Uint8Array(CHUNK_VOLUME);
|
|
631
|
+
const index = this.voxelIndex(x, y, z);
|
|
632
|
+
chunk.voxels[index] = voxelType;
|
|
512
633
|
if (state !== undefined) {
|
|
513
634
|
chunk.voxelStates.set(index, state);
|
|
514
635
|
}
|
|
@@ -517,6 +638,26 @@ export class ChunkStore {
|
|
|
517
638
|
}
|
|
518
639
|
this.touch(chunk);
|
|
519
640
|
}
|
|
641
|
+
/**
|
|
642
|
+
* Keep a voxel the dense grid cannot hold in the overlay. An in-grid position with a wide type
|
|
643
|
+
* leaves 0 in the grid and no dense state; one outside the grid never touches the grid.
|
|
644
|
+
*/
|
|
645
|
+
putOverlay(chunk, x, y, z, voxelType, state) {
|
|
646
|
+
if (inDenseGrid(x, y, z)) {
|
|
647
|
+
if (!chunk.voxels)
|
|
648
|
+
chunk.voxels = new Uint8Array(CHUNK_VOLUME);
|
|
649
|
+
const index = this.voxelIndex(x, y, z);
|
|
650
|
+
chunk.voxels[index] = 0;
|
|
651
|
+
chunk.voxelStates.delete(index);
|
|
652
|
+
}
|
|
653
|
+
chunk.overlay.set(voxelKey(x, y, z), {
|
|
654
|
+
x,
|
|
655
|
+
y,
|
|
656
|
+
z,
|
|
657
|
+
voxelType,
|
|
658
|
+
...(state !== undefined ? { state } : {}),
|
|
659
|
+
});
|
|
660
|
+
}
|
|
520
661
|
ensureEntry(coord) {
|
|
521
662
|
const key = chunkKey(coord);
|
|
522
663
|
let chunk = this.chunks.get(key);
|
|
@@ -526,6 +667,7 @@ export class ChunkStore {
|
|
|
526
667
|
coord,
|
|
527
668
|
voxels: null,
|
|
528
669
|
voxelStates: new Map(),
|
|
670
|
+
overlay: new Map(),
|
|
529
671
|
chunkState: null,
|
|
530
672
|
loadState: 'loading',
|
|
531
673
|
revision: 0,
|
package/dist/stores/index.d.ts
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
* Entry point: {@link createWorldSession}.
|
|
13
13
|
*/
|
|
14
14
|
export { bool8, bytes, f32, f64, i8, i16, i32, jsonCodec, rawCodec, reserved, structCodec, textCodec, u8, u16, u32, type StateCodec, type StructCodec, type StructField, type StructSpec, type StructValue, } from './codec.js';
|
|
15
|
-
export { CHUNK_SIZE, CHUNK_VOLUME, chunkDistance, chunkKey, chunksAround, fromChunkInput, parseChunkKey, toChunkInput, voxelCoordFromIndex, voxelIndex, worldToChunk, worldToLocalVoxel, type ChunkCoord, } from './keys.js';
|
|
15
|
+
export { CHUNK_SIZE, CHUNK_VOLUME, chunkDistance, chunkKey, chunksAround, fromChunkInput, parseChunkKey, toChunkInput, voxelCoordFromIndex, voxelIndex, voxelKey, worldToChunk, worldToLocalVoxel, type ChunkCoord, } from './keys.js';
|
|
16
16
|
export { intervalTicker, manualTicker, workerTicker, type ManualTicker, type Ticker, } from './ticker.js';
|
|
17
17
|
export { WorldSessionCore, type BusKey, type SentPacketKind, type SentPacketRecord, type WorldSessionBaseConfig, type WorldSessionContext, type WorldStoresClient, } from './session.js';
|
|
18
18
|
export { LocalActorStore, RemoteActorLane, RemoteActorStore, attachLocalActor, attachRemoteActors, localStorageUuidStore, memoryUuidStore, type AckedActorUpdate, type ActorSendError, type ActorUpdateEcho, type GenericErrorEcho, type LocalActorConfig, type LocalActorStatus, type RemoteActor, type RemoteActorSample, type RemoteActorsConfig, type SendReason, type SentActorUpdate, type UuidStore, } from './actors.js';
|
|
19
19
|
export { ErrorStore, attachErrorStore, type AttributedError, type ErrorStoreConfig, } from './errors.js';
|
|
20
|
-
export { ChunkStore, attachChunkStore, type CachedChunk, type ChunkLoadState, type ChunkStoreConfig, type ChunkWriteBackFailure, type SetVoxelInput, } from './chunks.js';
|
|
20
|
+
export { ChunkStore, attachChunkStore, type CachedChunk, type ChunkLoadState, type ChunkOverlayVoxel, type ChunkStoreConfig, type ChunkWriteBackFailure, type SetVoxelInput, } from './chunks.js';
|
|
21
21
|
export { ActorInbox, ChannelInbox, EventRouter, attachActorInbox, attachChannelInbox, attachEventRouter, type ActorInboxConfig, type ChannelInboxConfig, type EventRouterConfig, type InboxMessage, type TypedEvent, } from './inbox.js';
|
|
22
22
|
export { AvatarStateStore, HostTracker, SaveStateStore, attachAvatarState, attachHostTracker, attachSaveState, type AvatarStateConfig, type HostTrackerConfig, type SaveStateConfig, } from './durable.js';
|
|
23
23
|
import { LocalActorStore, RemoteActorStore, type LocalActorConfig, type RemoteActorsConfig } from './actors.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stores/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,GAAG,EACH,EAAE,EACF,GAAG,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OAAO,CAAC,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,kBAAkB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC1F,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,CAAC,GACT,YAAY,CAAC,CAAC,CAAC,CAsDjB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stores/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,GAAG,EACH,EAAE,EACF,GAAG,EACH,GAAG,EACH,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,SAAS,EACT,EAAE,EACF,GAAG,EACH,GAAG,EACH,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,MAAM,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EA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E,GACzC;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B,OAAO,CAAC,GACZ,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,GACzD,OAAO,CAAC,GACZ,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAC3B;IACE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAC/B,gBAAgB,CAAC,EAAE,CAAC,EACpB,iBAAiB,CAAC,EAAE,CAAC,EACrB,aAAa,CAAC,EAAE,CAAC,CAClB,CAAC;CACH,GACD,OAAO,CAAC,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,kBAAkB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC1F,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,CAAC,GACT,YAAY,CAAC,CAAC,CAAC,CAsDjB"}
|
package/dist/stores/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Entry point: {@link createWorldSession}.
|
|
13
13
|
*/
|
|
14
14
|
export { bool8, bytes, f32, f64, i8, i16, i32, jsonCodec, rawCodec, reserved, structCodec, textCodec, u8, u16, u32, } from './codec.js';
|
|
15
|
-
export { CHUNK_SIZE, CHUNK_VOLUME, chunkDistance, chunkKey, chunksAround, fromChunkInput, parseChunkKey, toChunkInput, voxelCoordFromIndex, voxelIndex, worldToChunk, worldToLocalVoxel, } from './keys.js';
|
|
15
|
+
export { CHUNK_SIZE, CHUNK_VOLUME, chunkDistance, chunkKey, chunksAround, fromChunkInput, parseChunkKey, toChunkInput, voxelCoordFromIndex, voxelIndex, voxelKey, worldToChunk, worldToLocalVoxel, } from './keys.js';
|
|
16
16
|
export { intervalTicker, manualTicker, workerTicker, } from './ticker.js';
|
|
17
17
|
export { WorldSessionCore, } from './session.js';
|
|
18
18
|
export { LocalActorStore, RemoteActorLane, RemoteActorStore, attachLocalActor, attachRemoteActors, localStorageUuidStore, memoryUuidStore, } from './actors.js';
|
package/dist/stores/keys.d.ts
CHANGED
|
@@ -36,6 +36,11 @@ export declare function worldToLocalVoxel(x: number, y: number, z: number): {
|
|
|
36
36
|
* `x + y*16 + z*256` (the platform's chunk `voxels` layout).
|
|
37
37
|
*/
|
|
38
38
|
export declare function voxelIndex(x: number, y: number, z: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* The key a chunk's `overlay` holds a voxel under: `"x:y:z"`, its within-chunk coordinates as
|
|
41
|
+
* the edit carried them (any signed 16-bit value).
|
|
42
|
+
*/
|
|
43
|
+
export declare function voxelKey(x: number, y: number, z: number): string;
|
|
39
44
|
/** Invert {@link voxelIndex} back to within-chunk coordinates. */
|
|
40
45
|
export declare function voxelCoordFromIndex(index: number): {
|
|
41
46
|
x: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/stores/keys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,6BAA6B;AAC7B,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,kEAAkE;AAClE,eAAO,MAAM,YAAY,QAAuC,CAAC;AAEjE,0EAA0E;AAC1E,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,gEAAgE;AAChE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,qBAAqB,GAAG,MAAM,CAE1E;AAED,8DAA8D;AAC9D,wBAAgB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C,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAMtF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAW7E;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAElE"}
|
package/dist/stores/keys.js
CHANGED
|
@@ -45,6 +45,13 @@ export function worldToLocalVoxel(x, y, z) {
|
|
|
45
45
|
export function voxelIndex(x, y, z) {
|
|
46
46
|
return x + y * CHUNK_SIZE + z * CHUNK_SIZE * CHUNK_SIZE;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The key a chunk's `overlay` holds a voxel under: `"x:y:z"`, its within-chunk coordinates as
|
|
50
|
+
* the edit carried them (any signed 16-bit value).
|
|
51
|
+
*/
|
|
52
|
+
export function voxelKey(x, y, z) {
|
|
53
|
+
return `${x}:${y}:${z}`;
|
|
54
|
+
}
|
|
48
55
|
/** Invert {@link voxelIndex} back to within-chunk coordinates. */
|
|
49
56
|
export function voxelCoordFromIndex(index) {
|
|
50
57
|
return {
|
package/dist/stores/session.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface WorldStoresClient {
|
|
|
36
36
|
host: HostAPI;
|
|
37
37
|
}
|
|
38
38
|
/** The kinds of outbound sends the session can attribute errors to. */
|
|
39
|
-
export type SentPacketKind = 'actorUpdate' | 'voxelUpdate' | 'text' | 'clientEvent' | 'audio' | 'video' | 'singleActorMessage' | 'channelMessage';
|
|
39
|
+
export type SentPacketKind = 'actorUpdate' | 'voxelUpdate' | 'text' | 'clientEvent' | 'audio' | 'video' | 'singleActorMessage' | 'channelMessage' | 'channelAudio';
|
|
40
40
|
/** A record of one outbound send, kept so errors can be attributed. */
|
|
41
41
|
export interface SentPacketRecord {
|
|
42
42
|
kind: SentPacketKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/stores/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,uEAAuE;AACvE,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,aAAa,GACb,MAAM,GACN,aAAa,GACb,OAAO,GACP,OAAO,GACP,oBAAoB,GACpB,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/stores/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,M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