@crowdedkingdoms/crowdyjs 8.0.0 → 8.0.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/README.md +51 -14
- package/dist/client.d.ts +8 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -0
- package/dist/crowdy-client.d.ts +7 -0
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +4 -0
- package/dist/domains/gameModel.d.ts +54 -3
- package/dist/domains/gameModel.d.ts.map +1 -1
- package/dist/domains/gameModel.js +67 -4
- package/dist/domains/host.d.ts +14 -3
- package/dist/domains/host.d.ts.map +1 -1
- package/dist/domains/host.js +17 -3
- package/dist/domains/organizations.d.ts +3 -3
- package/dist/domains/organizations.js +3 -3
- package/dist/domains/quotas.d.ts +1 -1
- package/dist/domains/quotas.js +1 -1
- package/dist/domains/udp.d.ts +28 -17
- package/dist/domains/udp.d.ts.map +1 -1
- package/dist/domains/udp.js +28 -17
- package/dist/generated/graphql.d.ts +289 -6
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +6 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/lb-cookie-store.d.ts +20 -0
- package/dist/lb-cookie-store.d.ts.map +1 -0
- package/dist/lb-cookie-store.js +73 -0
- package/dist/realtime.d.ts +20 -5
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +38 -0
- package/dist/types.d.ts +22 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/world.d.ts +13 -8
- package/dist/world.d.ts.map +1 -1
- package/dist/world.js +13 -8
- package/package.json +6 -4
package/dist/world.d.ts
CHANGED
|
@@ -84,7 +84,8 @@ export declare class ActorClient {
|
|
|
84
84
|
/**
|
|
85
85
|
* Enter a chunk: records it as this actor's current chunk and sends an
|
|
86
86
|
* initial actor update to register presence there. Resolves with the server's
|
|
87
|
-
* applied `
|
|
87
|
+
* applied echo — your own `ActorUpdateNotification` (the sender is included in
|
|
88
|
+
* the chunk fan-out), correlated by `sequenceNumber`.
|
|
88
89
|
*
|
|
89
90
|
* The **first** spatial message to a brand-new chunk may be dropped
|
|
90
91
|
* server-side while grid permissions load, so if this rejects with a timeout,
|
|
@@ -94,7 +95,8 @@ export declare class ActorClient {
|
|
|
94
95
|
* int64 decimal string. A chunk is a 16x16x16 voxel cube.
|
|
95
96
|
* @param state - Initial actor state blob, base64-encoded. Defaults to `'AA=='`
|
|
96
97
|
* (a single zero byte), i.e. registration-only.
|
|
97
|
-
* @returns The correlated {@link SpatialNotification} (
|
|
98
|
+
* @returns The correlated {@link SpatialNotification} (your own
|
|
99
|
+
* `ActorUpdateNotification` self-echo).
|
|
98
100
|
* @throws {CrowdyProtocolError} if `chunk` is outside signed int64 range.
|
|
99
101
|
* @throws {CrowdyGraphQLError} if the underlying send is rejected.
|
|
100
102
|
* @throws {CrowdyTimeoutError} if the HTTP send leg times out.
|
|
@@ -106,8 +108,9 @@ export declare class ActorClient {
|
|
|
106
108
|
/**
|
|
107
109
|
* Send a state update for this actor to its current chunk (set by
|
|
108
110
|
* {@link join}) or to `options.chunk` if provided. Uses the UDP `...AndWait`
|
|
109
|
-
* path and resolves with the applied
|
|
110
|
-
* `uuid` are filled
|
|
111
|
+
* path and resolves with the applied echo — your own `ActorUpdateNotification`
|
|
112
|
+
* (the sender is included in the chunk fan-out). `appId` and `uuid` are filled
|
|
113
|
+
* in for you.
|
|
111
114
|
*
|
|
112
115
|
* @param state - Actor state blob, base64-encoded (may be `''` for a
|
|
113
116
|
* registration-only update).
|
|
@@ -118,7 +121,8 @@ export declare class ActorClient {
|
|
|
118
121
|
* actor's `defaultDistance`.
|
|
119
122
|
* - `decayRate` — decay algorithm 0-5; defaults to the actor's
|
|
120
123
|
* `defaultDecayRate`.
|
|
121
|
-
* @returns The correlated {@link SpatialNotification} (
|
|
124
|
+
* @returns The correlated {@link SpatialNotification} (your own
|
|
125
|
+
* `ActorUpdateNotification` self-echo).
|
|
122
126
|
* @throws {Error} `'Actor must join a chunk before sending state'` if no chunk
|
|
123
127
|
* has been joined and none is supplied.
|
|
124
128
|
* @throws {CrowdyProtocolError} if the resolved chunk is outside int64 range.
|
|
@@ -131,8 +135,8 @@ export declare class ActorClient {
|
|
|
131
135
|
/**
|
|
132
136
|
* Send a voxel (block) update from this actor to its current chunk (or
|
|
133
137
|
* `input.chunk`). Uses the UDP `...AndWait` path and resolves with the applied
|
|
134
|
-
*
|
|
135
|
-
* you.
|
|
138
|
+
* echo — your own `VoxelUpdateNotification` (the sender is included in the
|
|
139
|
+
* chunk fan-out). `appId`, `uuid`, and `chunk` are filled in for you.
|
|
136
140
|
*
|
|
137
141
|
* @param input - Voxel fields minus `appId`/`uuid`/`chunk`:
|
|
138
142
|
* - `voxel` — `{ x, y, z }` voxel coordinates within the chunk, each an
|
|
@@ -144,7 +148,8 @@ export declare class ActorClient {
|
|
|
144
148
|
* - `sequenceNumber` — optional uint8 (0-255) correlation id.
|
|
145
149
|
* - `chunk` — optional `{ x, y, z }` (signed int64 decimal strings) to
|
|
146
150
|
* override the tracked chunk.
|
|
147
|
-
* @returns The correlated {@link SpatialNotification} (
|
|
151
|
+
* @returns The correlated {@link SpatialNotification} (your own
|
|
152
|
+
* `VoxelUpdateNotification` self-echo).
|
|
148
153
|
* @throws {Error} `'Actor must join a chunk before sending voxel updates'` if
|
|
149
154
|
* no chunk has been joined and none is supplied.
|
|
150
155
|
* @throws {CrowdyProtocolError} if the resolved chunk is outside int64 range.
|
package/dist/world.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../src/world.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,qBAAqB,EACrB,OAAO,EACP,uBAA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W,EAAE,qBAAqB,EAClC,OAAO,GAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAO,GACxC,OAAO,CAAC,OAAO,CAAC;CAWpB"}
|
package/dist/world.js
CHANGED
|
@@ -66,7 +66,8 @@ export class ActorClient {
|
|
|
66
66
|
/**
|
|
67
67
|
* Enter a chunk: records it as this actor's current chunk and sends an
|
|
68
68
|
* initial actor update to register presence there. Resolves with the server's
|
|
69
|
-
* applied `
|
|
69
|
+
* applied echo — your own `ActorUpdateNotification` (the sender is included in
|
|
70
|
+
* the chunk fan-out), correlated by `sequenceNumber`.
|
|
70
71
|
*
|
|
71
72
|
* The **first** spatial message to a brand-new chunk may be dropped
|
|
72
73
|
* server-side while grid permissions load, so if this rejects with a timeout,
|
|
@@ -76,7 +77,8 @@ export class ActorClient {
|
|
|
76
77
|
* int64 decimal string. A chunk is a 16x16x16 voxel cube.
|
|
77
78
|
* @param state - Initial actor state blob, base64-encoded. Defaults to `'AA=='`
|
|
78
79
|
* (a single zero byte), i.e. registration-only.
|
|
79
|
-
* @returns The correlated {@link SpatialNotification} (
|
|
80
|
+
* @returns The correlated {@link SpatialNotification} (your own
|
|
81
|
+
* `ActorUpdateNotification` self-echo).
|
|
80
82
|
* @throws {CrowdyProtocolError} if `chunk` is outside signed int64 range.
|
|
81
83
|
* @throws {CrowdyGraphQLError} if the underlying send is rejected.
|
|
82
84
|
* @throws {CrowdyTimeoutError} if the HTTP send leg times out.
|
|
@@ -91,8 +93,9 @@ export class ActorClient {
|
|
|
91
93
|
/**
|
|
92
94
|
* Send a state update for this actor to its current chunk (set by
|
|
93
95
|
* {@link join}) or to `options.chunk` if provided. Uses the UDP `...AndWait`
|
|
94
|
-
* path and resolves with the applied
|
|
95
|
-
* `uuid` are filled
|
|
96
|
+
* path and resolves with the applied echo — your own `ActorUpdateNotification`
|
|
97
|
+
* (the sender is included in the chunk fan-out). `appId` and `uuid` are filled
|
|
98
|
+
* in for you.
|
|
96
99
|
*
|
|
97
100
|
* @param state - Actor state blob, base64-encoded (may be `''` for a
|
|
98
101
|
* registration-only update).
|
|
@@ -103,7 +106,8 @@ export class ActorClient {
|
|
|
103
106
|
* actor's `defaultDistance`.
|
|
104
107
|
* - `decayRate` — decay algorithm 0-5; defaults to the actor's
|
|
105
108
|
* `defaultDecayRate`.
|
|
106
|
-
* @returns The correlated {@link SpatialNotification} (
|
|
109
|
+
* @returns The correlated {@link SpatialNotification} (your own
|
|
110
|
+
* `ActorUpdateNotification` self-echo).
|
|
107
111
|
* @throws {Error} `'Actor must join a chunk before sending state'` if no chunk
|
|
108
112
|
* has been joined and none is supplied.
|
|
109
113
|
* @throws {CrowdyProtocolError} if the resolved chunk is outside int64 range.
|
|
@@ -130,8 +134,8 @@ export class ActorClient {
|
|
|
130
134
|
/**
|
|
131
135
|
* Send a voxel (block) update from this actor to its current chunk (or
|
|
132
136
|
* `input.chunk`). Uses the UDP `...AndWait` path and resolves with the applied
|
|
133
|
-
*
|
|
134
|
-
* you.
|
|
137
|
+
* echo — your own `VoxelUpdateNotification` (the sender is included in the
|
|
138
|
+
* chunk fan-out). `appId`, `uuid`, and `chunk` are filled in for you.
|
|
135
139
|
*
|
|
136
140
|
* @param input - Voxel fields minus `appId`/`uuid`/`chunk`:
|
|
137
141
|
* - `voxel` — `{ x, y, z }` voxel coordinates within the chunk, each an
|
|
@@ -143,7 +147,8 @@ export class ActorClient {
|
|
|
143
147
|
* - `sequenceNumber` — optional uint8 (0-255) correlation id.
|
|
144
148
|
* - `chunk` — optional `{ x, y, z }` (signed int64 decimal strings) to
|
|
145
149
|
* override the tracked chunk.
|
|
146
|
-
* @returns The correlated {@link SpatialNotification} (
|
|
150
|
+
* @returns The correlated {@link SpatialNotification} (your own
|
|
151
|
+
* `VoxelUpdateNotification` self-echo).
|
|
147
152
|
* @throws {Error} `'Actor must join a chunk before sending voxel updates'` if
|
|
148
153
|
* no chunk has been joined and none is supplied.
|
|
149
154
|
* @throws {CrowdyProtocolError} if the resolved chunk is outside int64 range.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowdedkingdoms/crowdyjs",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "Client SDK for Crowded Kingdoms GraphQL API with UDP proxy support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"MIGRATION.md"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"sync
|
|
25
|
-
"
|
|
24
|
+
"schema:sync": "npm run schema:sync:prod",
|
|
25
|
+
"schema:sync:prod": "node scripts/sync-schema.mjs --prod",
|
|
26
|
+
"schema:sync:local": "node scripts/sync-schema.mjs --local",
|
|
27
|
+
"schema:sync:paths": "node scripts/sync-schema.mjs",
|
|
26
28
|
"codegen": "graphql-codegen --config codegen.ts",
|
|
27
29
|
"check:schema": "npm run codegen && git diff --exit-code schema.gql src/generated/graphql.ts",
|
|
28
30
|
"codegen:watch": "graphql-codegen --config codegen.ts --watch",
|
|
29
|
-
"prebuild": "npm run codegen",
|
|
30
31
|
"build": "tsc",
|
|
31
32
|
"test": "npm run build && node --test --test-concurrency=1 test/unit/*.test.mjs test/e2e/*.test.mjs",
|
|
32
33
|
"test:unit": "npm run build && node --test test/unit/*.test.mjs",
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"@graphql-codegen/typed-document-node": "^6.1.8",
|
|
62
63
|
"@graphql-codegen/typescript": "^5.0.10",
|
|
63
64
|
"@graphql-codegen/typescript-operations": "^5.1.0",
|
|
65
|
+
"@graphql-tools/merge": "^9.1.10",
|
|
64
66
|
"@types/node": "^22.10.7",
|
|
65
67
|
"typescript": "^5.7.3",
|
|
66
68
|
"ws": "^8.20.0"
|