hytopia 0.8.6-dev6 → 0.8.6-dev6nopool

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/bun-server.mjs +166 -164
  2. package/docs/server.audiomanager.getallaudios.md +1 -38
  3. package/docs/server.audiomanager.getallentityattachedaudios.md +1 -1
  4. package/docs/server.audiomanager.md +1 -1
  5. package/docs/server.blocktype._constructor_.md +1 -15
  6. package/docs/server.blocktype.md +1 -22
  7. package/docs/server.blocktyperegistry.getallblocktypes.md +1 -38
  8. package/docs/server.blocktyperegistry.md +1 -1
  9. package/docs/server.chunk._constructor_.md +1 -15
  10. package/docs/server.chunk.md +1 -22
  11. package/docs/server.chunklattice.getallchunks.md +1 -38
  12. package/docs/server.chunklattice.md +1 -22
  13. package/docs/server.chunklatticeevent.md +14 -0
  14. package/docs/server.chunklatticeeventpayloads._chunk_lattice.add_chunk_.md +16 -0
  15. package/docs/server.chunklatticeeventpayloads.md +19 -0
  16. package/docs/server.entitymanager.getallentities.md +1 -38
  17. package/docs/server.entitymanager.md +1 -1
  18. package/docs/server.lightmanager.getalllights.md +1 -38
  19. package/docs/server.lightmanager.md +1 -1
  20. package/docs/server.md +25 -25
  21. package/docs/server.particleemitter.burst.md +54 -0
  22. package/docs/server.particleemitter.md +14 -0
  23. package/docs/server.particleemitterevent.md +14 -0
  24. package/docs/server.particleemittereventpayloads._particle_emitter.burst_.md +16 -0
  25. package/docs/server.particleemittereventpayloads.md +19 -0
  26. package/docs/server.particleemittermanager.getallparticleemitters.md +1 -38
  27. package/docs/server.particleemittermanager.md +1 -1
  28. package/docs/server.rgbcolor.md +1 -1
  29. package/docs/server.sceneuimanager.getallsceneuis.md +1 -38
  30. package/docs/server.sceneuimanager.md +1 -1
  31. package/docs/server.telemetry.getprocessstats.md +56 -0
  32. package/docs/server.telemetry.initializesentry.md +74 -0
  33. package/docs/server.telemetry.md +126 -0
  34. package/docs/server.telemetry.sentry.md +23 -0
  35. package/docs/server.telemetry.startspan.md +91 -0
  36. package/docs/server.telemetryspanoperation.md +244 -0
  37. package/docs/server.telemetryspanoptions.md +18 -0
  38. package/docs/server.world.md +0 -21
  39. package/node-server.mjs +172 -170
  40. package/package.json +1 -1
  41. package/server.api.json +670 -737
  42. package/server.d.ts +153 -145
  43. package/docs/server.array3number.md +0 -13
  44. package/docs/server.array4number.md +0 -13
  45. package/docs/server.blocktype.blocktyperegistry.md +0 -13
  46. package/docs/server.chunk.chunklattice.md +0 -13
  47. package/docs/server.chunklattice.world.md +0 -13
  48. package/docs/server.tickallocator.getarray.md +0 -72
  49. package/docs/server.tickallocator.getarray3number.md +0 -56
  50. package/docs/server.tickallocator.getarray4number.md +0 -56
  51. package/docs/server.tickallocator.getobject.md +0 -72
  52. package/docs/server.tickallocator.getset.md +0 -72
  53. package/docs/server.tickallocator.map.md +0 -72
  54. package/docs/server.tickallocator.md +0 -149
  55. package/docs/server.tickallocator.reset.md +0 -17
  56. package/docs/server.world.tickallocator.md +0 -13
package/server.d.ts CHANGED
@@ -5,19 +5,14 @@ import http from 'http';
5
5
  import type { IncomingMessage } from 'http';
6
6
  import type { InputSchema } from '@hytopia.com/server-protocol';
7
7
  import type { LobbyMembershipDto } from '@hytopia.com/creative-lib/dist/impl/getSession';
8
- import mediasoup from 'mediasoup';
9
8
  import protocol from '@hytopia.com/server-protocol';
10
9
  import RAPIER from '@dimforge/rapier3d-simd-compat';
11
10
  import { SdpMatrix3 } from '@dimforge/rapier3d-simd-compat';
11
+ import * as Sentry from '@sentry/node';
12
12
  import type { Socket } from 'net';
13
+ import type { types } from 'mediasoup';
13
14
  import { WebSocket as WebSocket_2 } from 'ws';
14
15
 
15
- /** A 3-element number array. @public */
16
- export declare type Array3Number = [number, number, number];
17
-
18
- /** A 4-element number array. @public */
19
- export declare type Array4Number = [number, number, number, number];
20
-
21
16
  /**
22
17
  * Represents a audio playback in a world.
23
18
  *
@@ -278,18 +273,15 @@ export declare class AudioManager {
278
273
  /**
279
274
  * Retrieves all loaded audio instances for the world.
280
275
  *
281
- * @param tickAllocated - Whether to use the tick allocator to allocate the
282
- * returned array of Audio instances. The allocated array will be collected
283
- * and released at the end of the current tick if true. Only use this if
284
- * you know what you're doing.
285
- *
286
276
  * @returns An array of audio instances.
287
277
  */
288
- getAllAudios(tickAllocated?: boolean): Audio[];
278
+ getAllAudios(): Audio[];
289
279
  /**
290
280
  * Retrieves all loaded audio instances attached to a specific entity.
291
281
  *
292
282
  * @param entity - The entity to get attached audio instances for.
283
+ * the allocated array at the end of the current tick. false by default.
284
+
293
285
  * @returns An array of audio instances.
294
286
  */
295
287
  getAllEntityAttachedAudios(entity: Entity): Audio[];
@@ -614,17 +606,14 @@ export declare class BlockType extends EventRouter implements protocol.Serializa
614
606
 
615
607
 
616
608
 
617
-
618
609
  /**
619
610
  * Creates a new block type instance.
620
611
  * @param world - The world the block type is for.
621
612
  * @param options - The options for the block type.
622
613
  */
623
- constructor(blockTypeRegistry: BlockTypeRegistry, options?: BlockTypeOptions);
614
+ constructor(options?: BlockTypeOptions);
624
615
  /** The unique identifier for the block type. */
625
616
  get id(): number;
626
- /** The block type registry that the block type belongs to. */
627
- get blockTypeRegistry(): BlockTypeRegistry;
628
617
  /** The collider options for the block type. */
629
618
  get colliderOptions(): VoxelsColliderOptions;
630
619
  /** The half extents size of the block type. */
@@ -716,15 +705,9 @@ export declare class BlockTypeRegistry extends EventRouter implements protocol.S
716
705
  get world(): World;
717
706
  /**
718
707
  * Get all registered block types.
719
- *
720
- * @param tickAllocated - Whether to use the tick allocator to allocate the
721
- * returned array of BlockType instances. The allocated array will be collected
722
- * and released at the end of the current tick if true. Only use this if
723
- * you know what you're doing.
724
- *
725
708
  * @returns An array of all registered block types.
726
709
  */
727
- getAllBlockTypes(tickAllocated?: boolean): BlockType[];
710
+ getAllBlockTypes(): BlockType[];
728
711
  /**
729
712
  * Get a registered block type by its id.
730
713
  * @param id - The id of the block type to get.
@@ -882,15 +865,12 @@ export declare class ChatManager extends EventRouter {
882
865
  export declare class Chunk implements protocol.Serializable {
883
866
 
884
867
 
885
-
886
868
  /**
887
869
  * Creates a new chunk instance.
888
870
  */
889
- constructor(chunkLattice: ChunkLattice, originCoordinate: Vector3Like);
871
+ constructor(originCoordinate: Vector3Like);
890
872
  /** The blocks in the chunk as a flat Uint8Array[4096], each index as 0 or a block type id. */
891
873
  get blocks(): Readonly<Uint8Array>;
892
- /** The chunk lattice that the chunk belongs to. */
893
- get chunkLattice(): ChunkLattice;
894
874
  /** The origin coordinate of the chunk. */
895
875
  get originCoordinate(): Vector3Like;
896
876
  /**
@@ -951,8 +931,6 @@ export declare class ChunkLattice extends EventRouter {
951
931
  constructor(world: World);
952
932
  /** The number of chunks in the lattice. */
953
933
  get chunkCount(): number;
954
- /** The world that the chunk lattice belongs to. */
955
- get world(): World;
956
934
  /**
957
935
  * Removes and clears all chunks and their blocks from the lattice.
958
936
  */
@@ -991,15 +969,9 @@ export declare class ChunkLattice extends EventRouter {
991
969
  getOrCreateChunk(globalCoordinate: Vector3Like): Chunk;
992
970
  /**
993
971
  * Get all chunks in the lattice.
994
- *
995
- * @param tickAllocated - Whether to use the tick allocator to allocate the
996
- * returned array of Chunk instances. The allocated array will be collected
997
- * and released at the end of the current tick if true. Only use this if
998
- * you know what you're doing.
999
- *
1000
972
  * @returns An array of all chunks in the lattice.
1001
973
  */
1002
- getAllChunks(tickAllocated?: boolean): Chunk[];
974
+ getAllChunks(): Chunk[];
1003
975
  /**
1004
976
  * Check if a block exists at a specific global coordinate.
1005
977
  * @param globalCoordinate - The global coordinate of the block to check.
@@ -1026,12 +998,18 @@ export declare class ChunkLattice extends EventRouter {
1026
998
 
1027
999
  /** Event types a ChunkLattice instance can emit. See {@link ChunkLatticeEventPayloads} for the payloads. @public */
1028
1000
  export declare enum ChunkLatticeEvent {
1001
+ ADD_CHUNK = "CHUNK_LATTICE.ADD_CHUNK",
1029
1002
  REMOVE_CHUNK = "CHUNK_LATTICE.REMOVE_CHUNK",
1030
1003
  SET_BLOCK = "CHUNK_LATTICE.SET_BLOCK"
1031
1004
  }
1032
1005
 
1033
1006
  /** Event payloads for ChunkLattice emitted events. @public */
1034
1007
  export declare interface ChunkLatticeEventPayloads {
1008
+ /** Emitted when a chunk is added to the lattice. */
1009
+ [ChunkLatticeEvent.ADD_CHUNK]: {
1010
+ chunkLattice: ChunkLattice;
1011
+ chunk: Chunk;
1012
+ };
1035
1013
  /** Emitted when a chunk is removed from the lattice. */
1036
1014
  [ChunkLatticeEvent.REMOVE_CHUNK]: {
1037
1015
  chunkLattice: ChunkLattice;
@@ -2139,15 +2117,9 @@ export declare class EntityManager {
2139
2117
 
2140
2118
  /**
2141
2119
  * Gets all spawned entities in the world.
2142
- *
2143
- * @param tickAllocated - Whether to use the tick allocator to allocate the
2144
- * returned array of Entity instances. The allocated array will be collected
2145
- * and released at the end of the current tick if true. Only use this if
2146
- * you know what you're doing.
2147
- *
2148
2120
  * @returns All spawned entities in the world.
2149
2121
  */
2150
- getAllEntities(tickAllocated?: boolean): Entity[];
2122
+ getAllEntities(): Entity[];
2151
2123
  /**
2152
2124
  * Gets all spawned player entities in the world.
2153
2125
  * @returns All spawned player entities in the world.
@@ -2797,14 +2769,9 @@ export declare class LightManager {
2797
2769
  /**
2798
2770
  * Retrieves all spawned Light instances for the world.
2799
2771
  *
2800
- * @param tickAllocated - Whether to use the tick allocator to allocate the
2801
- * returned array of Light instances. The allocated array will be collected
2802
- * and released at the end of the current tick if true. Only use this if
2803
- * you know what you're doing.
2804
- *
2805
2772
  * @returns An array of Light instances.
2806
2773
  */
2807
- getAllLights(tickAllocated?: boolean): Light[];
2774
+ getAllLights(): Light[];
2808
2775
  /**
2809
2776
  * Retrieves all spawned Light instances attached to a specific entity.
2810
2777
  *
@@ -3903,6 +3870,12 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3903
3870
  * @param velocityVariance - The velocity variance of an emitted particle.
3904
3871
  */
3905
3872
  setVelocityVariance(velocityVariance: Vector3Like): void;
3873
+ /**
3874
+ * Creates a burst of particles, regardless of pause state.
3875
+ *
3876
+ * @param count - The number of particles to burst.
3877
+ */
3878
+ burst(count: number): void;
3906
3879
  /**
3907
3880
  * Despawns the ParticleEmitter from the world.
3908
3881
  */
@@ -3926,6 +3899,7 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3926
3899
 
3927
3900
  /** Event types a ParticleEmitter instance can emit. See {@link ParticleEmitterEventPayloads} @public */
3928
3901
  export declare enum ParticleEmitterEvent {
3902
+ BURST = "PARTICLE_EMITTER.BURST",
3929
3903
  DESPAWN = "PARTICLE_EMITTER.DESPAWN",
3930
3904
  SET_ALPHA_TEST = "PARTICLE_EMITTER.SET_ALPHA_TEST",
3931
3905
  SET_ATTACHED_TO_ENTITY = "PARTICLE_EMITTER.SET_ATTACHED_TO_ENTITY",
@@ -3961,6 +3935,11 @@ export declare enum ParticleEmitterEvent {
3961
3935
 
3962
3936
  /** Event payloads for ParticleEmitter emitted events. @public */
3963
3937
  export declare interface ParticleEmitterEventPayloads {
3938
+ /** Emitted when a ParticleEmitter bursts the specified number of particles. */
3939
+ [ParticleEmitterEvent.BURST]: {
3940
+ particleEmitter: ParticleEmitter;
3941
+ count: number;
3942
+ };
3964
3943
  /** Emitted when a ParticleEmitter is despawned. */
3965
3944
  [ParticleEmitterEvent.DESPAWN]: {
3966
3945
  particleEmitter: ParticleEmitter;
@@ -4138,14 +4117,9 @@ export declare class ParticleEmitterManager {
4138
4117
  /**
4139
4118
  * Retrieves all spawned ParticleEmitter instances for the world.
4140
4119
  *
4141
- * @param tickAllocated - Whether to use the tick allocator to allocate the
4142
- * returned array of ParticleEmitter instances. The allocated array will be collected
4143
- * and released at the end of the current tick if true. Only use this if
4144
- * you know what you're doing.
4145
- *
4146
4120
  * @returns An array of ParticleEmitter instances.
4147
4121
  */
4148
- getAllParticleEmitters(tickAllocated?: boolean): ParticleEmitter[];
4122
+ getAllParticleEmitters(): ParticleEmitter[];
4149
4123
  /**
4150
4124
  * Retrieves all spawned ParticleEmitter instances attached to a specific entity.
4151
4125
  *
@@ -5239,7 +5213,7 @@ export declare type RaycastOptions = {
5239
5213
  solidMode?: boolean;
5240
5214
  } & FilterOptions;
5241
5215
 
5242
- /** A RGB color. @public */
5216
+ /** A RGB color. r, g and b expect a value between 0 and 255. @public */
5243
5217
  export declare interface RgbColor {
5244
5218
  r: number;
5245
5219
  g: number;
@@ -5776,14 +5750,9 @@ export declare class SceneUIManager {
5776
5750
  /**
5777
5751
  * Retrieves all loaded SceneUI instances for the world.
5778
5752
  *
5779
- * @param tickAllocated - Whether to use the tick allocator to allocate the
5780
- * returned array of SceneUI instances. The allocated array will be collected
5781
- * and released at the end of the current tick if true. Only use this if
5782
- * you know what you're doing.
5783
- *
5784
5753
  * @returns An array of SceneUI instances.
5785
5754
  */
5786
- getAllSceneUIs(tickAllocated?: boolean): SceneUI[];
5755
+ getAllSceneUIs(): SceneUI[];
5787
5756
  /**
5788
5757
  * Retrieves all loaded SceneUI instances attached to a specific entity.
5789
5758
  *
@@ -6124,87 +6093,129 @@ export declare function startServer(init: ((() => void) | ((world: World) => voi
6124
6093
  export declare const SUPPORTED_INPUT_KEYS: readonly ["w", "a", "s", "d", "sp", "sh", "tb", "ml", "mr", "q", "e", "r", "f", "z", "x", "c", "v", "u", "i", "o", "j", "k", "l", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
6125
6094
 
6126
6095
  /**
6127
- * High-performance tick-scoped allocator for temporary objects, arrays, and buffers.
6128
- * All allocations are automatically bulk-released when reset() is called.
6096
+ * Manages performance telemetry and error tracking through your Sentry.io account.
6129
6097
  *
6130
6098
  * @remarks
6131
- * TickAllocator maintains separate pools for different data types and tracks all
6132
- * allocations made during a tick cycle. Objects are reused across ticks to eliminate
6133
- * garbage collection overhead in hot paths like network synchronization.
6099
+ * The Telemetry class provides low-overhead performance monitoring
6100
+ * and error tracking through Sentry (https://sentry.io) integration
6101
+ * and your provided Sentry DSN. It automatically tracks critical game loop
6102
+ * operations like physics simulation, entity updates, network synchronization,
6103
+ * and more. The system only sends telemetry data when errors or slow-tick
6104
+ * performance issues are detected, minimizing bandwidth and storage costs.
6134
6105
  *
6135
6106
  * @example
6136
6107
  * ```typescript
6137
- * // Allocate during tick
6138
- * const position = tickAllocator.getArray3Number();
6139
- * const rotation = tickAllocator.getArray4Number();
6140
- * const data = tickAllocator.getObject<EntitySchema>();
6108
+ * // Initialize Sentry for production telemetry
6109
+ * Telemetry.initializeSentry('MY_SENTRY_PROJECT_DSN');
6110
+ *
6111
+ * // Wrap performance-critical code in spans
6112
+ * Telemetry.startSpan({
6113
+ * operation: TelemetrySpanOperation.CUSTOM_OPERATION,
6114
+ * attributes: { // any arbitrary attributes you want to attach to the span
6115
+ * playerCount: world.playerManager.connectedPlayers.length,
6116
+ * entityCount: world.entityManager.entityCount,
6117
+ * },
6118
+ * }, () => {
6119
+ * // Your performance-critical code here
6120
+ * performExpensiveOperation();
6121
+ * });
6141
6122
  *
6142
- * // At end of tick - bulk release everything
6143
- * tickAllocator.reset();
6123
+ * // Get current process statistics
6124
+ * const stats = Telemetry.getProcessStats();
6125
+ * console.log(`Heap usage: ${stats.jsHeapUsagePercent * 100}%`);
6144
6126
  * ```
6145
6127
  *
6146
6128
  * @public
6147
6129
  */
6148
- export declare class TickAllocator {
6149
-
6150
-
6151
-
6152
-
6153
-
6154
-
6155
-
6156
-
6157
-
6158
-
6130
+ export declare class Telemetry {
6159
6131
  /**
6160
- * Gets a generic array from the pool.
6161
- * Array is reset to empty state and ready for use.
6162
- * @typeParam T - The array type.
6163
- * @returns A reusable array.
6164
- */
6165
- getArray<T extends unknown[] = unknown[]>(copyFromA?: Iterable<unknown>, copyFromB?: Iterable<unknown>): T;
6166
- /**
6167
- * Gets a 3-element number array from the pool.
6168
- * Array is reset to [0, 0, 0] and ready for use.
6169
- * @returns A reusable 3-element array.
6170
- */
6171
- getArray3Number(copyFrom?: Array3Number | Set<number>): Array3Number;
6172
- /**
6173
- * Gets a 4-element number array from the pool.
6174
- * Array is reset to [0, 0, 0, 0] and ready for use.
6175
- * @returns A reusable 4-element array.
6176
- */
6177
- getArray4Number(copyFrom?: Array4Number | Set<number>): Array4Number;
6178
- /**
6179
- * Gets a plain object from the pool.
6180
- * Object is reset to empty state and ready for use.
6181
- * @typeParam T - The type interface for the object.
6182
- * @returns A reusable plain object.
6132
+ * Gets current process memory and performance statistics.
6133
+ *
6134
+ * @param asMeasurement - Whether to return data in Sentry measurement format with units.
6135
+ * @returns Process statistics including heap usage, RSS memory, and capacity metrics.
6183
6136
  */
6184
- getObject<T extends Record<string, unknown> = Record<string, unknown>>(copyFromA?: T, copyFromB?: T): T;
6137
+ static getProcessStats(asMeasurement?: boolean): Record<string, any>;
6185
6138
  /**
6186
- * Gets a set from the pool.
6187
- * Set is reset to empty state and ready for use.
6188
- * @typeParam T - The type of the set.
6189
- * @returns A reusable set.
6139
+ * Initializes Sentry telemetry with the provided DSN.
6140
+ *
6141
+ * @remarks
6142
+ * This method configures Sentry for error tracking and performance monitoring.
6143
+ * It sets up filtering to only send performance spans that exceed the
6144
+ * provided threshold duration, reducing noise and costs. The initialization
6145
+ * includes game-specific tags and process statistics attachment.
6146
+ *
6147
+ * @param sentryDsn - The Sentry Data Source Name (DSN) for your project.
6148
+ * @param tickTimeMsThreshold - The tick duration that must be exceeded to
6149
+ * send a performance span to Sentry for a given tick. Defaults to 50ms.
6190
6150
  */
6191
- getSet<T>(copyFromA?: Set<T> | T[], copyFromB?: Set<T> | T[]): Set<T>;
6151
+ static initializeSentry(sentryDsn: string, tickTimeMsThreshold?: number): void;
6192
6152
  /**
6193
- * Maps an array to a new array using a callback function.
6194
- * @typeParam T - The type of the array.
6195
- * @typeParam U - The type of the resulting array.
6196
- * @param array - The array to map.
6197
- * @param callback - The callback function to map the array.
6198
- * @returns A new array with the mapped values.
6153
+ * Executes a callback function within a performance monitoring span.
6154
+ *
6155
+ * @remarks
6156
+ * This method provides zero-overhead performance monitoring in development
6157
+ * environments. In production with Sentry enabled and `SENTRY_ENABLE_TRACING=true`,
6158
+ * it creates performance spans for monitoring. The span data is only transmitted
6159
+ * to Sentry when performance issues are detected.
6160
+ *
6161
+ * @param options - Configuration for the telemetry span including operation type and attributes.
6162
+ * @param callback - The function to execute within the performance span.
6163
+ * @returns The return value of the callback function.
6164
+ *
6165
+ * @example
6166
+ * ```typescript
6167
+ * const result = Telemetry.startSpan({
6168
+ * operation: TelemetrySpanOperation.ENTITIES_TICK,
6169
+ * attributes: {
6170
+ * entityCount: entities.length,
6171
+ * worldId: world.id,
6172
+ * },
6173
+ * }, () => {
6174
+ * return processEntities(entities);
6175
+ * });
6176
+ * ```
6199
6177
  */
6200
- map<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U): U[];
6178
+ static startSpan<T>(options: TelemetrySpanOptions, callback: (span?: Sentry.Span) => T): T;
6201
6179
  /**
6202
- * Releases all allocated objects back to their respective pools.
6203
- * This is intended to be called at the end of a tick.
6180
+ * Gets the Sentry SDK instance for advanced telemetry operations.
6181
+ *
6182
+ * @remarks
6183
+ * This method provides direct access to the Sentry SDK for operations
6184
+ * not covered by the Telemetry wrapper, such as custom error reporting,
6185
+ * user context setting, or advanced span manipulation.
6186
+ *
6187
+ * @returns The Sentry SDK instance.
6204
6188
  */
6205
- reset(): void;
6189
+ static sentry(): typeof Sentry;
6190
+ }
6191
+
6192
+ /** Performance telemetry span operation types. @public */
6193
+ export declare enum TelemetrySpanOperation {
6194
+ BUILD_PACKETS = "build_packets",
6195
+ ENTITIES_EMIT_UPDATES = "entities_emit_updates",
6196
+ ENTITIES_TICK = "entities_tick",
6197
+ NETWORK_SYNCHRONIZE = "network_synchronize",
6198
+ NETWORK_SYNCHRONIZE_CLEANUP = "network_synchronize_cleanup",
6199
+ PHYSICS_CLEANUP = "physics_cleanup",
6200
+ PHYSICS_STEP = "physics_step",
6201
+ SEND_ALL_PACKETS = "send_all_packets",
6202
+ SEND_PACKETS = "send_packets",
6203
+ SERIALIZE_FREE_BUFFERS = "serialize_free_buffers",
6204
+ SERIALIZE_PACKETS = "serialize_packets",
6205
+ SERIALIZE_PACKETS_ENCODE = "serialize_packets_encode",
6206
+ SIMULATION_STEP = "simulation_step",
6207
+ TICKER_TICK = "ticker_tick",
6208
+ WORLD_TICK = "world_tick"
6206
6209
  }
6207
6210
 
6211
+ /** Options for creating a telemetry span. @public */
6212
+ export declare type TelemetrySpanOptions = {
6213
+ /** The operation being measured. */
6214
+ operation: TelemetrySpanOperation | string;
6215
+ /** Additional attributes to attach to the span for context. */
6216
+ attributes?: Record<string, string | number>;
6217
+ };
6218
+
6208
6219
  /** The options for a trimesh collider. @public */
6209
6220
  export declare interface TrimeshColliderOptions extends BaseColliderOptions {
6210
6221
  shape: ColliderShape.TRIMESH;
@@ -6819,7 +6830,6 @@ export declare class World extends EventRouter implements protocol.Serializable
6819
6830
 
6820
6831
 
6821
6832
 
6822
-
6823
6833
 
6824
6834
 
6825
6835
  /**
@@ -6832,32 +6842,40 @@ export declare class World extends EventRouter implements protocol.Serializable
6832
6842
  get ambientLightColor(): RgbColor;
6833
6843
  /** The intensity of the ambient light. */
6834
6844
  get ambientLightIntensity(): number;
6835
- /** The block type registry for the world. */
6836
- get blockTypeRegistry(): BlockTypeRegistry;
6837
- /** The chat manager for the world. */
6838
- get chatManager(): ChatManager;
6839
- /** The chunk lattice for the world. */
6840
- get chunkLattice(): ChunkLattice;
6841
6845
  /** The color of the directional light. */
6842
6846
  get directionalLightColor(): RgbColor;
6843
6847
  /** The intensity of the directional light. */
6844
6848
  get directionalLightIntensity(): number;
6845
6849
  /** The position the directional light originates from. */
6846
6850
  get directionalLightPosition(): Vector3Like;
6847
- /** The entity manager for the world. */
6848
- get entityManager(): EntityManager;
6849
6851
  /** The color of the fog, if not explicitly set, defaults to ambient light color. */
6850
6852
  get fogColor(): RgbColor | undefined;
6851
6853
  /** The maximum distance from the camera at which fog stops being applied. */
6852
6854
  get fogFar(): number;
6853
6855
  /** The minimum distance from the camera to start applying fog. */
6854
6856
  get fogNear(): number;
6857
+ /** The name of the world. */
6858
+ get name(): string;
6859
+ /** The intensity of the world's skybox brightness. */
6860
+ get skyboxIntensity(): number;
6861
+ /** The URI of the skybox cubemap for the world. */
6862
+ get skyboxUri(): string;
6863
+ /** The audio manager for the world. */
6864
+ get audioManager(): AudioManager;
6865
+ /** An arbitrary identifier tag of the world. Useful for your own logic. */
6866
+ get tag(): string | undefined;
6867
+ /** The block type registry for the world. */
6868
+ get blockTypeRegistry(): BlockTypeRegistry;
6869
+ /** The chat manager for the world. */
6870
+ get chatManager(): ChatManager;
6871
+ /** The chunk lattice for the world. */
6872
+ get chunkLattice(): ChunkLattice;
6873
+ /** The entity manager for the world. */
6874
+ get entityManager(): EntityManager;
6855
6875
  /** The light manager for the world. */
6856
6876
  get lightManager(): LightManager;
6857
6877
  /** The world loop for the world. */
6858
6878
  get loop(): WorldLoop;
6859
- /** The name of the world. */
6860
- get name(): string;
6861
6879
 
6862
6880
  /** The particle emitter manager for the world. */
6863
6881
  get particleEmitterManager(): ParticleEmitterManager;
@@ -6865,16 +6883,6 @@ export declare class World extends EventRouter implements protocol.Serializable
6865
6883
  get sceneUIManager(): SceneUIManager;
6866
6884
  /** The simulation for the world. */
6867
6885
  get simulation(): Simulation;
6868
- /** The intensity of the world's skybox brightness. */
6869
- get skyboxIntensity(): number;
6870
- /** The URI of the skybox cubemap for the world. */
6871
- get skyboxUri(): string;
6872
- /** The audio manager for the world. */
6873
- get audioManager(): AudioManager;
6874
- /** An arbitrary identifier tag of the world. Useful for your own logic. */
6875
- get tag(): string | undefined;
6876
- /** The tick allocator for the world. */
6877
- get tickAllocator(): TickAllocator;
6878
6886
  /**
6879
6887
  * Loads a map into the world, clearing any prior map.
6880
6888
  * @param map - The map to load.
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Array3Number](./server.array3number.md)
4
-
5
- ## Array3Number type
6
-
7
- A 3-element number array.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- export type Array3Number = [number, number, number];
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Array4Number](./server.array4number.md)
4
-
5
- ## Array4Number type
6
-
7
- A 4-element number array.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- export type Array4Number = [number, number, number, number];
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [BlockType](./server.blocktype.md) &gt; [blockTypeRegistry](./server.blocktype.blocktyperegistry.md)
4
-
5
- ## BlockType.blockTypeRegistry property
6
-
7
- The block type registry that the block type belongs to.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- get blockTypeRegistry(): BlockTypeRegistry;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [Chunk](./server.chunk.md) &gt; [chunkLattice](./server.chunk.chunklattice.md)
4
-
5
- ## Chunk.chunkLattice property
6
-
7
- The chunk lattice that the chunk belongs to.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- get chunkLattice(): ChunkLattice;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [ChunkLattice](./server.chunklattice.md) &gt; [world](./server.chunklattice.world.md)
4
-
5
- ## ChunkLattice.world property
6
-
7
- The world that the chunk lattice belongs to.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- get world(): World;
13
- ```
@@ -1,72 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [TickAllocator](./server.tickallocator.md) &gt; [getArray](./server.tickallocator.getarray.md)
4
-
5
- ## TickAllocator.getArray() method
6
-
7
- Gets a generic array from the pool. Array is reset to empty state and ready for use.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- getArray<T extends unknown[] = unknown[]>(copyFromA?: Iterable<unknown>, copyFromB?: Iterable<unknown>): T;
13
- ```
14
-
15
- ## Parameters
16
-
17
- <table><thead><tr><th>
18
-
19
- Parameter
20
-
21
-
22
- </th><th>
23
-
24
- Type
25
-
26
-
27
- </th><th>
28
-
29
- Description
30
-
31
-
32
- </th></tr></thead>
33
- <tbody><tr><td>
34
-
35
- copyFromA
36
-
37
-
38
- </td><td>
39
-
40
- Iterable&lt;unknown&gt;
41
-
42
-
43
- </td><td>
44
-
45
- _(Optional)_
46
-
47
-
48
- </td></tr>
49
- <tr><td>
50
-
51
- copyFromB
52
-
53
-
54
- </td><td>
55
-
56
- Iterable&lt;unknown&gt;
57
-
58
-
59
- </td><td>
60
-
61
- _(Optional)_
62
-
63
-
64
- </td></tr>
65
- </tbody></table>
66
-
67
- **Returns:**
68
-
69
- T
70
-
71
- A reusable array.
72
-