@crowdedkingdoms/crowdyjs 18.14.0-test.1 → 18.15.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 +17 -0
- package/README.md +20 -5
- package/dist/binary-wire.d.ts +12 -0
- package/dist/binary-wire.d.ts.map +1 -1
- package/dist/binary-wire.js +19 -2
- package/dist/default-origin.d.ts +6 -6
- package/dist/default-origin.d.ts.map +1 -1
- package/dist/default-origin.js +6 -6
- package/dist/domains/udp.d.ts +26 -0
- package/dist/domains/udp.d.ts.map +1 -1
- package/dist/domains/udp.js +37 -1
- package/dist/generated/graphql-schema.d.ts +17 -14
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/generated/graphql-schema.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +27 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/MIGRATION.md
CHANGED
|
@@ -120,6 +120,23 @@ 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.15.0: sending opcode 140
|
|
124
|
+
|
|
125
|
+
No breaking change. `client.udp.sendGenericSpatial({ appId, chunk, uuid, payload })` sends an
|
|
126
|
+
app-defined spatial message (`GENERIC_SPATIAL_1`, opcode 140), what CrowdyCPP's
|
|
127
|
+
`Connection::sendGenericSpatial` sends: the server fans it out to the actors near `chunk`
|
|
128
|
+
without reading `payload` (base64, at most `GENERIC_SPATIAL_MAX_PAYLOAD_BYTES`, 1,123 bytes
|
|
129
|
+
decoded), and they receive it on `genericSpatial` (18.7.0). `distance` defaults to 8 and
|
|
130
|
+
`decayRate` to 0, as CrowdyCPP's `SpatialSend` does.
|
|
131
|
+
|
|
132
|
+
It needs the binary relay (`realtime: { binaryTransport: true }`) and an active
|
|
133
|
+
`udp.subscribe`: the GraphQL API has no mutation for opcode 140, so there is nothing to fall
|
|
134
|
+
back to. Off the relay it throws `CrowdyRealtimeError` with `code: 'BINARY_RELAY_UNAVAILABLE'`
|
|
135
|
+
and `retryable: false`; with the relay configured but not connected (yet), the same code with
|
|
136
|
+
`retryable: true`. Nothing is sent in either case. A payload over the limit throws `RangeError`.
|
|
137
|
+
`serializeGenericSpatial` is the serializer, byte for byte CrowdyCPP's (the golden vector in
|
|
138
|
+
`test/unit/generic-spatial.test.mjs` is CrowdyCPP's `kGoldenSpatial`).
|
|
139
|
+
|
|
123
140
|
## 18.14.0: billing descriptions, and `playerWallet.charges()` deprecated
|
|
124
141
|
|
|
125
142
|
No breaking change. The schema is cks-game-api `dev`'s after #550: the billing descriptions say
|
package/README.md
CHANGED
|
@@ -403,11 +403,26 @@ Unsubscribing stops delivery only; call `client.udp.disconnect()` to close the
|
|
|
403
403
|
UDP proxy session.
|
|
404
404
|
|
|
405
405
|
`genericSpatial` receives opcode 140 (`GENERIC_SPATIAL_1`), an app-defined spatial payload the
|
|
406
|
-
server fans out without reading — what
|
|
407
|
-
|
|
408
|
-
`
|
|
409
|
-
transport never sees one. A World Stores
|
|
410
|
-
`session.context.on('genericSpatial', …)`.
|
|
406
|
+
server fans out without reading — what `client.udp.sendGenericSpatial` and CrowdyCPP's
|
|
407
|
+
`Connection::sendGenericSpatial` send. It travels only on the binary relay
|
|
408
|
+
(`realtime: { binaryTransport: true }`): the GraphQL `udpNotifications` union has no member for
|
|
409
|
+
it, so the GraphQL proxy drops it and a client on that transport never sees one. A World Stores
|
|
410
|
+
session carries it on its bus too: `session.context.on('genericSpatial', …)`.
|
|
411
|
+
|
|
412
|
+
```ts
|
|
413
|
+
// Binary relay only (there is no GraphQL mutation for opcode 140), after udp.subscribe.
|
|
414
|
+
await client.udp.sendGenericSpatial({
|
|
415
|
+
appId,
|
|
416
|
+
chunk: { x: '0', y: '0', z: '0' },
|
|
417
|
+
uuid: myActorUuid, // 32 ASCII characters
|
|
418
|
+
payload: encodeBase64(bytes), // at most 1,123 bytes decoded
|
|
419
|
+
// distance defaults to 8, decayRate to 0
|
|
420
|
+
});
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Off the relay `sendGenericSpatial` throws `CrowdyRealtimeError` (`BINARY_RELAY_UNAVAILABLE`,
|
|
424
|
+
`retryable: false`) and sends nothing; a payload over `GENERIC_SPATIAL_MAX_PAYLOAD_BYTES`
|
|
425
|
+
throws `RangeError`.
|
|
411
426
|
|
|
412
427
|
### Surviving the loss of an instance (direct connect)
|
|
413
428
|
|
package/dist/binary-wire.d.ts
CHANGED
|
@@ -168,6 +168,18 @@ export declare function serializeSingleActorMessage(ctx: RelaySignContext, input
|
|
|
168
168
|
payload?: string | null;
|
|
169
169
|
sequenceNumber?: number | null;
|
|
170
170
|
}): Promise<Uint8Array>;
|
|
171
|
+
/** Most bytes a generic spatial payload may carry: one signed datagram's worth (1,123). */
|
|
172
|
+
export declare const GENERIC_SPATIAL_MAX_PAYLOAD_BYTES: number;
|
|
173
|
+
/**
|
|
174
|
+
* GENERIC_SPATIAL_1 (140): an app-defined payload in the long-spatial layout, which the
|
|
175
|
+
* server fans out without reading. Defaults match CrowdyCPP's `SpatialSend`: `distance` 8,
|
|
176
|
+
* `decayRate` 0.
|
|
177
|
+
* @throws {RangeError} (as a rejection) when the payload decodes to more than
|
|
178
|
+
* {@link GENERIC_SPATIAL_MAX_PAYLOAD_BYTES}.
|
|
179
|
+
*/
|
|
180
|
+
export declare function serializeGenericSpatial(ctx: RelaySignContext, input: SpatialSendBase & {
|
|
181
|
+
payload?: string | null;
|
|
182
|
+
}): Promise<Uint8Array>;
|
|
171
183
|
/**
|
|
172
184
|
* CHANNEL_MESSAGE_REQUEST:
|
|
173
185
|
* `[1B type=17][8B channelId][32B uuid][2B payloadLen][payload][1B containsAuth]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-wire.d.ts","sourceRoot":"","sources":["../src/binary-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,qEAAqE;AACrE,eAAO,MAAM,6BAA6B,QACmC,CAAC;AAE9E;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,CAInE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,CAwB5E;AAED,kEAAkE;AAClE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"binary-wire.d.ts","sourceRoot":"","sources":["../src/binary-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,qEAAqE;AACrE,eAAO,MAAM,6BAA6B,QACmC,CAAC;AAE9E;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,CAInE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,CAwB5E;AAED,kEAAkE;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AS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,GACA,OAAO,CAAC,UAAU,CAAC,CAwDrB;AA4PD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,EAAE,CAuBpE"}
|
package/dist/binary-wire.js
CHANGED
|
@@ -104,8 +104,9 @@ export const WireMessageType = {
|
|
|
104
104
|
CLIENT_TEXT_NOTIFICATION_2: 137,
|
|
105
105
|
CLIENT_EVENT_NOTIFICATION_2: 138,
|
|
106
106
|
SERVER_EVENT_NOTIFICATION_2: 139,
|
|
107
|
-
// An app-defined spatial payload (
|
|
108
|
-
// emit).
|
|
107
|
+
// An app-defined spatial payload (`udp.sendGenericSpatial`, CrowdyCPP
|
|
108
|
+
// `Connection::sendGenericSpatial`, a hub's emit). Sent and parsed on the binary relay
|
|
109
|
+
// only: the GraphQL API has no mutation and no union member for it.
|
|
109
110
|
GENERIC_SPATIAL_1: 140,
|
|
110
111
|
SINGLE_ACTOR_MESSAGE: 142,
|
|
111
112
|
// Buddy v0.25.0: webcam video pair (audio's shape, payload = one SDK
|
|
@@ -317,6 +318,22 @@ export function serializeClientEvent(ctx, input) {
|
|
|
317
318
|
export function serializeSingleActorMessage(ctx, input) {
|
|
318
319
|
return serializeSpatial(ctx, WireMessageType.SINGLE_ACTOR_MESSAGE, input.appId, input.chunk, 0, 0, input.targetUuid, input.payload ? decodeBase64(input.payload) : new Uint8Array(0), input.sequenceNumber ?? 0);
|
|
319
320
|
}
|
|
321
|
+
/** Most bytes a generic spatial payload may carry: one signed datagram's worth (1,123). */
|
|
322
|
+
export const GENERIC_SPATIAL_MAX_PAYLOAD_BYTES = RELAY_MAX_DATAGRAM_BYTES - SPATIAL_HEADER_SIZE - TAIL_AUTH_BYTES;
|
|
323
|
+
/**
|
|
324
|
+
* GENERIC_SPATIAL_1 (140): an app-defined payload in the long-spatial layout, which the
|
|
325
|
+
* server fans out without reading. Defaults match CrowdyCPP's `SpatialSend`: `distance` 8,
|
|
326
|
+
* `decayRate` 0.
|
|
327
|
+
* @throws {RangeError} (as a rejection) when the payload decodes to more than
|
|
328
|
+
* {@link GENERIC_SPATIAL_MAX_PAYLOAD_BYTES}.
|
|
329
|
+
*/
|
|
330
|
+
export async function serializeGenericSpatial(ctx, input) {
|
|
331
|
+
const payload = input.payload ? decodeBase64(input.payload) : new Uint8Array(0);
|
|
332
|
+
if (payload.length > GENERIC_SPATIAL_MAX_PAYLOAD_BYTES) {
|
|
333
|
+
throw new RangeError(`payload is ${payload.length} bytes; at most ${GENERIC_SPATIAL_MAX_PAYLOAD_BYTES}`);
|
|
334
|
+
}
|
|
335
|
+
return serializeSpatial(ctx, WireMessageType.GENERIC_SPATIAL_1, input.appId, input.chunk, input.distance ?? 8, input.decayRate ?? 0, input.uuid, payload, input.sequenceNumber ?? 0);
|
|
336
|
+
}
|
|
320
337
|
/**
|
|
321
338
|
* CHANNEL_MESSAGE_REQUEST:
|
|
322
339
|
* `[1B type=17][8B channelId][32B uuid][2B payloadLen][payload][1B containsAuth]
|
package/dist/default-origin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED — do not edit. The operator tooling's
|
|
3
|
-
* `sync-client-origins.mjs --write --tier
|
|
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 '
|
|
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 = "
|
|
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.
|
|
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.
|
|
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.
|
|
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,
|
|
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"}
|
package/dist/default-origin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED — do not edit. The operator tooling's
|
|
3
|
-
* `sync-client-origins.mjs --write --tier
|
|
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 '
|
|
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 = '
|
|
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.
|
|
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.
|
|
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.
|
|
22
|
+
export const CROWDY_DEFAULT_HOST = 'ck.dev.crowdedkingdoms.com';
|
package/dist/domains/udp.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { SubscriptionManager, UdpNotificationHandlers } from '../subscripti
|
|
|
3
3
|
import { type ConnectUdpProxyMutation, type UdpProxyConnectionStatusQuery, type SendActorUpdateMutationVariables, type SendVoxelUpdateMutationVariables, type SendAudioPacketMutationVariables, type SendVideoPacketMutationVariables, type SendTextPacketMutationVariables, type SendClientEventMutationVariables, type SendSingleActorMessageMutationVariables, type SendChannelMessageMutationVariables, type SendChannelAudioMutationVariables, type SendRangedChannelMessageMutationVariables } from '../generated/graphql.js';
|
|
4
4
|
import type { RealtimeMetrics } from '../metrics.js';
|
|
5
5
|
import type { SpatialNotification } from '../realtime.js';
|
|
6
|
+
import type { GenericSpatialInput } from '../types.js';
|
|
6
7
|
import { type VideoCodec } from '../media/video-frames.js';
|
|
7
8
|
/**
|
|
8
9
|
* UDP proxy access for browser-style clients that can't open raw UDP sockets.
|
|
@@ -447,6 +448,31 @@ export declare class UdpAPI {
|
|
|
447
448
|
* @throws {CrowdyGraphQLError} on auth/validation failures.
|
|
448
449
|
*/
|
|
449
450
|
sendSingleActorMessage(input: SendSingleActorMessageMutationVariables['input']): Promise<boolean>;
|
|
451
|
+
/**
|
|
452
|
+
* Send an app-defined spatial message (`GENERIC_SPATIAL_1`, opcode 140): the server fans it
|
|
453
|
+
* out to the actors near `chunk` without reading `payload`, and they receive it on their
|
|
454
|
+
* `genericSpatial` handler. The counterpart of CrowdyCPP's `Connection::sendGenericSpatial`.
|
|
455
|
+
* **Binary relay only:** the GraphQL API has no mutation for it, so the client needs
|
|
456
|
+
* `realtime: { binaryTransport: true }` and an active {@link subscribe} (the relay session is
|
|
457
|
+
* app-scoped). Fire-and-forget; a refusal arrives as a `genericError` correlated by
|
|
458
|
+
* `sequenceNumber`.
|
|
459
|
+
*
|
|
460
|
+
* @param input - {@link GenericSpatialInput}:
|
|
461
|
+
* - `appId` — owning app id (`BigInt` as a decimal string).
|
|
462
|
+
* - `chunk` — `{ x, y, z }` chunk address (signed int64 decimal strings).
|
|
463
|
+
* - `uuid` — 32-ASCII-character id of the sending actor (not RFC-4122).
|
|
464
|
+
* - `payload` — base64, opaque to the server, at most
|
|
465
|
+
* `GENERIC_SPATIAL_MAX_PAYLOAD_BYTES` (1,123) bytes decoded.
|
|
466
|
+
* - `distance` — replication radius in chunk units, 0-8 (clamped); defaults to 8.
|
|
467
|
+
* - `decayRate` — decay algorithm 0-5 (see {@link sendActorUpdate}); defaults to 0.
|
|
468
|
+
* - `sequenceNumber` — optional uint8 (0-255) correlation id.
|
|
469
|
+
* @returns `true` when accepted for sending — **not** confirmation of delivery.
|
|
470
|
+
* @throws {RangeError} when the payload is too large; nothing is sent.
|
|
471
|
+
* @throws {CrowdyRealtimeError} `code === 'BINARY_RELAY_UNAVAILABLE'`: `retryable: false`
|
|
472
|
+
* when the client is not on the binary relay, `true` when the relay is not connected
|
|
473
|
+
* (yet); nothing is sent.
|
|
474
|
+
*/
|
|
475
|
+
sendGenericSpatial(input: GenericSpatialInput): Promise<boolean>;
|
|
450
476
|
/**
|
|
451
477
|
* Publish a message to a channel. Delivered to every active member of the
|
|
452
478
|
* channel (regardless of location) as a `ChannelMessageNotification` on their
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"udp.d.ts","sourceRoot":"","sources":["../../src/domains/udp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,KAAK,uBAAuB,EAG5B,KAAK,6BAA6B,EAElC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,+BAA+B,EAEpC,KAAK,gCAAgC,EAErC,KAAK,uCAAuC,EAE5C,KAAK,mCAAmC,EAExC,KAAK,iCAAi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Y;CAQrB"}
|
package/dist/domains/udp.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ConnectUdpProxyDocument, DisconnectUdpProxyDocument, UdpProxyConnectionStatusDocument, SendActorUpdateDocument, SendVoxelUpdateDocument, SendAudioPacketDocument, SendVideoPacketDocument, SendTextPacketDocument, SendClientEventDocument, SendSingleActorMessageDocument, SendChannelMessageDocument, SendChannelAudioDocument, SendRangedChannelMessageDocument, } from '../generated/graphql.js';
|
|
2
2
|
import { payloadBytesOf } from '../metrics.js';
|
|
3
3
|
import { SequenceAllocator } from '../utils.js';
|
|
4
|
-
import { serializeActorUpdate, serializeAudioPacket, serializeChannelAudio, serializeChannelMessage, serializeClientEvent, serializeRangedChannelMessage, serializeSingleActorMessage, serializeTextPacket, serializeVideoPacket, serializeVoxelUpdate, assertVoxelEdit, } from '../binary-wire.js';
|
|
4
|
+
import { serializeActorUpdate, serializeAudioPacket, serializeChannelAudio, serializeChannelMessage, serializeClientEvent, serializeGenericSpatial, serializeRangedChannelMessage, serializeSingleActorMessage, serializeTextPacket, serializeVideoPacket, serializeVoxelUpdate, assertVoxelEdit, } from '../binary-wire.js';
|
|
5
|
+
import { CrowdyRealtimeError } from '../errors.js';
|
|
5
6
|
import { fragmentFrame } from '../media/video-frames.js';
|
|
6
7
|
import { encodeBase64 } from '../utils.js';
|
|
7
8
|
/**
|
|
@@ -641,6 +642,41 @@ export class UdpAPI {
|
|
|
641
642
|
this.record('singleActorMessage', input);
|
|
642
643
|
return data.sendSingleActorMessage;
|
|
643
644
|
}
|
|
645
|
+
/**
|
|
646
|
+
* Send an app-defined spatial message (`GENERIC_SPATIAL_1`, opcode 140): the server fans it
|
|
647
|
+
* out to the actors near `chunk` without reading `payload`, and they receive it on their
|
|
648
|
+
* `genericSpatial` handler. The counterpart of CrowdyCPP's `Connection::sendGenericSpatial`.
|
|
649
|
+
* **Binary relay only:** the GraphQL API has no mutation for it, so the client needs
|
|
650
|
+
* `realtime: { binaryTransport: true }` and an active {@link subscribe} (the relay session is
|
|
651
|
+
* app-scoped). Fire-and-forget; a refusal arrives as a `genericError` correlated by
|
|
652
|
+
* `sequenceNumber`.
|
|
653
|
+
*
|
|
654
|
+
* @param input - {@link GenericSpatialInput}:
|
|
655
|
+
* - `appId` — owning app id (`BigInt` as a decimal string).
|
|
656
|
+
* - `chunk` — `{ x, y, z }` chunk address (signed int64 decimal strings).
|
|
657
|
+
* - `uuid` — 32-ASCII-character id of the sending actor (not RFC-4122).
|
|
658
|
+
* - `payload` — base64, opaque to the server, at most
|
|
659
|
+
* `GENERIC_SPATIAL_MAX_PAYLOAD_BYTES` (1,123) bytes decoded.
|
|
660
|
+
* - `distance` — replication radius in chunk units, 0-8 (clamped); defaults to 8.
|
|
661
|
+
* - `decayRate` — decay algorithm 0-5 (see {@link sendActorUpdate}); defaults to 0.
|
|
662
|
+
* - `sequenceNumber` — optional uint8 (0-255) correlation id.
|
|
663
|
+
* @returns `true` when accepted for sending — **not** confirmation of delivery.
|
|
664
|
+
* @throws {RangeError} when the payload is too large; nothing is sent.
|
|
665
|
+
* @throws {CrowdyRealtimeError} `code === 'BINARY_RELAY_UNAVAILABLE'`: `retryable: false`
|
|
666
|
+
* when the client is not on the binary relay, `true` when the relay is not connected
|
|
667
|
+
* (yet); nothing is sent.
|
|
668
|
+
*/
|
|
669
|
+
async sendGenericSpatial(input) {
|
|
670
|
+
await this.awaitGameplayTokenReady();
|
|
671
|
+
if (!this.subs.usingBinaryTransport()) {
|
|
672
|
+
throw new CrowdyRealtimeError('sendGenericSpatial needs the binary relay (realtime.binaryTransport): the GraphQL API has no mutation for opcode 140', { code: 'BINARY_RELAY_UNAVAILABLE', retryable: false });
|
|
673
|
+
}
|
|
674
|
+
if (!this.subs.binarySendReady())
|
|
675
|
+
await this.subs.ensureBinaryReady(2000);
|
|
676
|
+
const sent = await this.subs.sendBinaryFrame((ctx) => serializeGenericSpatial(ctx, input));
|
|
677
|
+
this.record('genericSpatial', input);
|
|
678
|
+
return sent;
|
|
679
|
+
}
|
|
644
680
|
/**
|
|
645
681
|
* Publish a message to a channel. Delivered to every active member of the
|
|
646
682
|
* channel (regardless of location) as a `ChannelMessageNotification` on their
|
|
@@ -1663,7 +1663,7 @@ export declare enum CheckoutPurpose {
|
|
|
1663
1663
|
PropertyTokens = "PROPERTY_TOKENS",
|
|
1664
1664
|
/**
|
|
1665
1665
|
* @deprecated Legacy recurring subscription for a paid shared app slot. No longer purchasable via createCheckout; retained for historical checkouts and webhook reconciliation.
|
|
1666
|
-
* @deprecated Shared apps
|
|
1666
|
+
* @deprecated Shared apps are billed for metered usage from the org wallet. Publish via publishAppToShared and top up with ORG_WALLET_TOPUP.
|
|
1667
1667
|
*/
|
|
1668
1668
|
SharedAppSubscription = "SHARED_APP_SUBSCRIPTION"
|
|
1669
1669
|
}
|
|
@@ -4784,7 +4784,7 @@ export type Mutation = {
|
|
|
4784
4784
|
mintAppToken: AppTokenResponse;
|
|
4785
4785
|
/** Mint a grid-scoped token from the app token you hold (DN-10). The result can call only a short, fixed list of gameplay fields, and each is confined to the grid: world reads and replication sends must address a chunk inside it (a send's origin; its reach follows distance), and channels must be the grid's own. refreshAppToken and logout are refused, so the token cannot widen or tear down its parent. Requires an app token (not a session token, not another grid token), and the caller must own the grid or hold run_client_code on it. */
|
|
4786
4786
|
mintGridToken: GridTokenResponse;
|
|
4787
|
-
/** Publishes an app to the shared game-api environment. Free under the org's app-slot quota (result.free = true); beyond the quota, publish still succeeds and
|
|
4787
|
+
/** Publishes an app to the shared game-api environment. Free under the org's app-slot quota (result.free = true); beyond the quota, publish still succeeds and metered usage is charged to the org wallet. Requires the 'manage_apps' permission on the app's org. Blocked when SHARED_GAME_API_URL is not configured. */
|
|
4788
4788
|
publishAppToShared: PublishAppResult;
|
|
4789
4789
|
/** Store acceptance of the current required legal documents (Game Terms, API Terms, SDK Developer Terms, Free Tier and Billing Basis, Overworld Privacy Policy) and the age-of-majority attestation. Both arguments must be true; a false value stores nothing and is refused with LEGAL_ACCEPTANCE_REQUIRED. Idempotent for a version already stored. Requires a session token. Gameplay tokens stay refused until this has succeeded for the current document set. */
|
|
4790
4790
|
recordPlayerConsents: Scalars['Boolean']['output'];
|
|
@@ -4838,7 +4838,7 @@ export type Mutation = {
|
|
|
4838
4838
|
revokeTierAccessRule: TierAccessRule;
|
|
4839
4839
|
/** Reverts every voxel edit made by `userId` in `appId` between `from` and `to`, returning one RollbackVoxelEventResult per affected voxel (`applied` tells you whether each was actually changed). DEFAULTS to dryRun=true, which only PREVIEWS the planned reversions without writing; pass dryRun=false to actually apply them (DESTRUCTIVE — mutates world state). A reverted voxel’s edit-log row takes the earlier edit’s type, state and author and the ROLLBACK’s time as its createdAt, so a client reading edits `since` its last sync sees the revert. When the app’s wilderness is closed (`wildernessOpen` false), an applied rollback that would write any chunk of closed, unclaimed wilderness is refused (403) before it writes anything; a dry run is not. Requires a valid bearer token AND the `manage_apps` permission on the org that owns `appId` (super admins bypass). */
|
|
4840
4840
|
rollbackVoxelUpdates: Array<RollbackVoxelEventResult>;
|
|
4841
|
-
/** OPERATOR ONLY. Runs the shared-usage
|
|
4841
|
+
/** OPERATOR ONLY. Runs the shared-usage tick once instead of waiting for the ~60s cron: reserved-throughput billing, the itemised statement of the last closed clock hour, and the usage-gate evaluation of every shared app. Metered usage is priced and charged by the ledger's settlement, about once a minute, not by this tick. Backdating usage rows is a local-test fixture, not something this mutation does on a live tier. */
|
|
4842
4842
|
runSharedUsageBillingTick: Scalars['Boolean']['output'];
|
|
4843
4843
|
/** Send an actor (player/NPC) state update for spatial replication to nearby chunks. Requires a bearer game token; opens a UDP proxy session automatically if none exists. Returns Boolean! that is true only when the datagram was ACCEPTED FOR SENDING to the game server — it does NOT confirm the world applied the update. There is NO separate per-request success response: the game server fans the update out to every client in the target chunk INCLUDING the sender, so you observe your own applied update as an ActorUpdateNotification carrying the same sequenceNumber (ActorUpdateResponse is legacy and is never emitted). Failures arrive ASYNCHRONOUSLY as a GenericErrorResponse; both are correlated by the request sequenceNumber (correlation only — not an idempotency key; the server does not dedupe replays). Subscribe to udpNotifications before sending so the self-notification/error is not missed. */
|
|
4844
4844
|
sendActorUpdate: Scalars['Boolean']['output'];
|
|
@@ -4880,7 +4880,7 @@ export type Mutation = {
|
|
|
4880
4880
|
setAppVisibility: App;
|
|
4881
4881
|
/** Enables or disables off-session auto-billing for an org and updates its thresholds. When enabled and the wallet falls to lowWaterThresholdCents, the saved payment method is charged rechargeAmountCents (requires setupSharedPaymentMethod first). Pass limitCents=null for no per-period cap. Requires the 'manage_billing' org permission. */
|
|
4882
4882
|
setAutoBilling: OrgAutoBilling;
|
|
4883
|
-
/** OPERATOR ONLY. Sets a metered dimension's price, the UNIT that price is quoted in, its free allowances, or any combination, and returns the new row alongside the values that moved. THIS IS THE ONLY SANCTIONED WAY TO CHANGE A PRICE OR A UNIT: the schema seeds use ON CONFLICT DO NOTHING, so a rate reaches a tier once at install and a unit corrected in the declaration never reaches a tier that already exists. Refuses an unknown or unmetered metric (a rate for a dimension nothing meters bills nobody while appearing configured), refuses a negative price, refuses unitLabel without unitQuantity (which would restate the rate card while the arithmetic kept the old divisor), and refuses a call that would change nothing. A unit change that also moves the money needs acknowledgeRepricing: true, so restating a price and cutting it cannot be confused. priceBands sets a graduated schedule (SHARED aggregate_data_volume only; band 1 becomes priceCents) and clearPriceBands returns the dimension to one flat price; while a dimension is banded a bare priceCents or a unit change is refused. NOT RETROACTIVE:
|
|
4883
|
+
/** OPERATOR ONLY. Sets a metered dimension's price, the UNIT that price is quoted in, its free allowances, or any combination, and returns the new row alongside the values that moved. THIS IS THE ONLY SANCTIONED WAY TO CHANGE A PRICE OR A UNIT: the schema seeds use ON CONFLICT DO NOTHING, so a rate reaches a tier once at install and a unit corrected in the declaration never reaches a tier that already exists. Refuses an unknown or unmetered metric (a rate for a dimension nothing meters bills nobody while appearing configured), refuses a negative price, refuses unitLabel without unitQuantity (which would restate the rate card while the arithmetic kept the old divisor), and refuses a call that would change nothing. A unit change that also moves the money needs acknowledgeRepricing: true, so restating a price and cutting it cannot be confused. priceBands sets a graduated schedule (SHARED aggregate_data_volume only; band 1 becomes priceCents) and clearPriceBands returns the dimension to one flat price; while a dimension is banded a bare priceCents or a unit change is refused. NOT RETROACTIVE: the ledger keeps the rate and allowance in force when a (payer, dimension, period) is first charged, so a change applies from each dimension's next period and nothing already charged is repriced. Takes effect within about a minute — the settlement reloads the card on every run, so no restart is needed. */
|
|
4884
4884
|
setBillingRate: SetRateCardResult;
|
|
4885
4885
|
/** Replace a member's channel roles with the given set (not additive — roles not listed are removed). Requires the 'manage_roles' channel permission (app admins bypass). Re-pushes the member's effective send permission to Buddy so their ability to post updates immediately. */
|
|
4886
4886
|
setChannelMemberRoles: GroupMember;
|
|
@@ -6444,7 +6444,7 @@ export type PlayerSpendCap = {
|
|
|
6444
6444
|
/** The owning player user id. */
|
|
6445
6445
|
userId: Scalars['BigInt']['output'];
|
|
6446
6446
|
};
|
|
6447
|
-
/** One
|
|
6447
|
+
/** One player usage charge from the hourly cents-era billing: a (player, app, closed clock hour) row. The lossless ledger, on by default, replaced that billing and writes no rows here, so the list ends where the ledger took over; usage since is in playerWalletTransactions as "usage_debit" entries. amountCents = platformCents + markupCents: what the platform charged and what the studio added. */
|
|
6448
6448
|
export type PlayerUsageCharge = {
|
|
6449
6449
|
__typename?: 'PlayerUsageCharge';
|
|
6450
6450
|
/** Total debited cents. */
|
|
@@ -6491,7 +6491,7 @@ export type PlayerWallet = {
|
|
|
6491
6491
|
/** Wallet id. */
|
|
6492
6492
|
walletId: Scalars['BigInt']['output'];
|
|
6493
6493
|
};
|
|
6494
|
-
/** One player-wallet ledger entry: top-ups,
|
|
6494
|
+
/** One player-wallet ledger entry: top-ups, usage debits, auto-recharges, refunds, purchases, payouts and adjustments. A usage debit carries the app and charges what one dimension's running total for its period now costs beyond what was already charged, the app's markup included, so a period can bring several debits as its usage arrives; its description names the dimension and the period. */
|
|
6495
6495
|
export type PlayerWalletTransaction = {
|
|
6496
6496
|
__typename?: 'PlayerWalletTransaction';
|
|
6497
6497
|
/**
|
|
@@ -6514,11 +6514,11 @@ export type PlayerWalletTransaction = {
|
|
|
6514
6514
|
createdAt: Scalars['DateTime']['output'];
|
|
6515
6515
|
/** Human description. */
|
|
6516
6516
|
description: Maybe<Scalars['String']['output']>;
|
|
6517
|
-
/** External reference
|
|
6517
|
+
/** External reference: the checkout or PaymentIntent id of a top-up, or for a usage debit the ledger charge it settles ("charge:<chargeId>:<n>", the n-th debit of that charge). */
|
|
6518
6518
|
referenceId: Maybe<Scalars['String']['output']>;
|
|
6519
6519
|
/** Transaction id. */
|
|
6520
6520
|
transactionId: Scalars['BigInt']['output'];
|
|
6521
|
-
/** What produced this entry. The complete set of values this API writes: "topup" (credit from a completed checkout, positive), "auto_recharge" (off-session automatic recharge, positive), "payout_credit" (marketplace seller payout, positive), "refund" (marketplace refund returned to the buyer, positive), "usage_debit" (
|
|
6521
|
+
/** What produced this entry. The complete set of values this API writes: "topup" (credit from a completed checkout, positive), "auto_recharge" (off-session automatic recharge, positive), "payout_credit" (marketplace seller payout, positive), "refund" (marketplace refund returned to the buyer, positive), "usage_debit" (metered player usage in one app: the increase in what one dimension's period total costs since the last debit for it, markup included, negative), "purchase" (marketplace purchase, negative), "adjustment" (operator or dispute-clawback correction, signed). */
|
|
6522
6522
|
transactionType: Scalars['String']['output'];
|
|
6523
6523
|
/** The owning player user id. */
|
|
6524
6524
|
userId: Scalars['BigInt']['output'];
|
|
@@ -6705,7 +6705,7 @@ export type Query = {
|
|
|
6705
6705
|
billingCharges: Array<BillingCharge>;
|
|
6706
6706
|
/** OPERATOR ONLY. Every organization currently marked billing_exempt. An exemption nobody can enumerate is an exemption that outlives its reason. */
|
|
6707
6707
|
billingExemptOrgs: Array<BillingExemptOrgType>;
|
|
6708
|
-
/** OPERATOR ONLY. The metered rate card for a scope: every priced dimension with its unit, price and
|
|
6708
|
+
/** OPERATOR ONLY. The metered rate card for a scope: every priced dimension with its unit, price, free allowance and the period that allowance resets on. SHARED is organization usage charged to the org wallet as "shared_usage"; PLAYER is a player's own metered usage charged to the player wallet as "usage_debit". A dimension priced at 0 is metered but not charged. Read-only. Customers read the same rates through `meteredRateCard`, which is public and omits the operator note. */
|
|
6709
6709
|
billingRateCard: Array<RateCardEntryType>;
|
|
6710
6710
|
/** Amounts the platform could not bill this org for, with the reason (an exempt org, a provider with no generation record, a process that died with metered usage in memory). Requires 'view_billing' on the org. */
|
|
6711
6711
|
billingWriteOffs: Array<BillingWriteOff>;
|
|
@@ -6943,11 +6943,14 @@ export type Query = {
|
|
|
6943
6943
|
playerRuntimeStates: Array<PlayerRuntimeState>;
|
|
6944
6944
|
/** The caller's self-set spend caps (global and per-app) with running counters. The effective runtime limit is min(developer policy, self-cap, wallet balance). */
|
|
6945
6945
|
playerSpendCaps: Array<PlayerSpendCap>;
|
|
6946
|
-
/**
|
|
6946
|
+
/**
|
|
6947
|
+
* The caller's hourly player-usage charges from the cents-era billing, newest first, optionally filtered by app. Nothing has been added since the lossless ledger took over; current usage charges are the "usage_debit" entries in playerWalletTransactions.
|
|
6948
|
+
* @deprecated Reads the hourly cents-era charge rows, which the lossless ledger does not write. Read playerWalletTransactions: each "usage_debit" entry is one charge, per app, markup included.
|
|
6949
|
+
*/
|
|
6947
6950
|
playerUsageCharges: Array<PlayerUsageCharge>;
|
|
6948
6951
|
/** The caller's player wallet, created empty on first access (never null). Platform-scoped: one wallet, across every org and app, pays for the player's mods past their monthly trial and any Agentic Studio model requests charged to them; org billing never touches it. Fund it via createCheckout purpose PLAYER_WALLET_TOPUP. */
|
|
6949
6952
|
playerWalletBalance: PlayerWallet;
|
|
6950
|
-
/** The caller's player-wallet ledger, newest first: top-ups,
|
|
6953
|
+
/** The caller's player-wallet ledger, newest first: top-ups, usage debits (per app, the app's markup included), auto-recharges, refunds, purchases, payouts and adjustments. Each usage debit names its dimension and period, and an over-charge credited back appears as an adjustment. */
|
|
6951
6954
|
playerWalletTransactions: Array<PlayerWalletTransaction>;
|
|
6952
6955
|
/** Whether portaling the calling user into an app needs a consent prompt. Trusted (first-party) apps and already-granted apps return consentRequired=false. The Overworld calls this before createPortalAuthorizationCode. Requires a SESSION token. */
|
|
6953
6956
|
portalConsent: PortalConsentState;
|
|
@@ -7620,7 +7623,7 @@ export type RateCardBandType = {
|
|
|
7620
7623
|
/** Exclusive upper edge of this band on the period's running total, in raw metric units, as a BigInt decimal string. A band covers units from the previous band's edge up to this one. Null on the last band, which has no upper edge. */
|
|
7621
7624
|
upToUnits: Maybe<Scalars['BigInt']['output']>;
|
|
7622
7625
|
};
|
|
7623
|
-
/** One priced dimension: its rate and, where it has one, its
|
|
7626
|
+
/** One priced dimension: its rate and, where it has one, its free allowance and the period that allowance resets on. A dimension with a price of 0 is metered but not charged. */
|
|
7624
7627
|
export type RateCardEntryType = {
|
|
7625
7628
|
__typename?: 'RateCardEntryType';
|
|
7626
7629
|
/** ISO currency code. USD today. */
|
|
@@ -7660,7 +7663,7 @@ export type RateChangeType = {
|
|
|
7660
7663
|
/** The value after this call, as a decimal string. */
|
|
7661
7664
|
updated: Scalars['String']['output'];
|
|
7662
7665
|
};
|
|
7663
|
-
/** Which rate card. SHARED prices organization metered usage
|
|
7666
|
+
/** Which rate card. SHARED prices an organization's metered usage in shared-environment apps, charged to the org wallet as "shared_usage" entries. PLAYER prices a player's own metered usage (mod compute, egress, model storage and player-paid model tokens), charged to the player wallet as "usage_debit" entries with the app's markup added. Both settle about once a minute: each (payer, dimension, period) is charged what its running total now costs beyond what was already charged for it. */
|
|
7664
7667
|
export declare enum RateScope {
|
|
7665
7668
|
Player = "PLAYER",
|
|
7666
7669
|
Shared = "SHARED"
|
|
@@ -9182,7 +9185,7 @@ export type WalletTransaction = {
|
|
|
9182
9185
|
referenceId: Maybe<Scalars['String']['output']>;
|
|
9183
9186
|
/** Unique transaction id (BigInt as a decimal string). */
|
|
9184
9187
|
transactionId: Scalars['BigInt']['output'];
|
|
9185
|
-
/** What produced this transaction. The complete set of values this API writes: "topup" (wallet credit from a completed checkout, positive), "admin_credit" (operator credit applied without a payment provider, positive), "auto_recharge" (off-session automatic wallet recharge, positive), "shared_usage" (
|
|
9188
|
+
/** What produced this transaction. The complete set of values this API writes: "topup" (wallet credit from a completed checkout, positive), "admin_credit" (operator credit applied without a payment provider, positive), "auto_recharge" (off-session automatic wallet recharge, positive), "shared_usage" (metered shared-environment usage: the increase in what one dimension's period total costs since the last charge for it, negative), "agent_usage" (Crowdy Studio agent run charged at provider cost, negative), "reserved_throughput" (monthly or prorated reserved capacity -- realtime bytes/s or GraphQL operations/s -- charged in addition to metered usage rather than including any of it, negative), "markup_payout" (the app developer's markup on a player's metered usage, credited to the org in the same transaction as the player debit that produced it, positive), "refund" (a payment-provider refund of a top-up, the credited amount leaving the wallet again, negative), "chargeback" (a card dispute on an org top-up, clawed back from the org wallet, negative). No other value is written; earlier versions of this description also listed "usage" and "environment_usage", neither of which was ever produced. */
|
|
9186
9189
|
transactionType: Scalars['String']['output'];
|
|
9187
9190
|
/** Wallet this transaction belongs to (BigInt as a decimal string). */
|
|
9188
9191
|
walletId: Scalars['BigInt']['output'];
|