hytopia 0.8.6-dev4 → 0.8.6-dev6
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/bun-server.mjs +164 -166
- package/docs/server.array3number.md +13 -0
- package/docs/server.array4number.md +13 -0
- package/docs/server.audiomanager.getallaudios.md +38 -1
- package/docs/server.audiomanager.getallentityattachedaudios.md +1 -1
- package/docs/server.audiomanager.md +1 -1
- package/docs/server.blocktype._constructor_.md +15 -1
- package/docs/server.blocktype.blocktyperegistry.md +13 -0
- package/docs/server.blocktype.md +22 -1
- package/docs/server.blocktyperegistry.getallblocktypes.md +38 -1
- package/docs/server.blocktyperegistry.md +1 -1
- package/docs/server.chunk._constructor_.md +15 -1
- package/docs/server.chunk.chunklattice.md +13 -0
- package/docs/server.chunk.md +22 -1
- package/docs/server.chunklattice.getallchunks.md +38 -1
- package/docs/server.chunklattice.md +22 -1
- package/docs/server.chunklattice.world.md +13 -0
- package/docs/server.chunklatticeevent.md +0 -14
- package/docs/server.chunklatticeeventpayloads.md +0 -19
- package/docs/server.entitymanager.getallentities.md +38 -1
- package/docs/server.entitymanager.md +1 -1
- package/docs/server.lightmanager.getalllights.md +38 -1
- package/docs/server.lightmanager.md +1 -1
- package/docs/server.md +25 -25
- package/docs/server.particleemitter.md +0 -14
- package/docs/server.particleemitterevent.md +0 -14
- package/docs/server.particleemittereventpayloads.md +0 -19
- package/docs/server.particleemittermanager.getallparticleemitters.md +38 -1
- package/docs/server.particleemittermanager.md +1 -1
- package/docs/server.rgbcolor.md +1 -1
- package/docs/server.sceneuimanager.getallsceneuis.md +38 -1
- package/docs/server.sceneuimanager.md +1 -1
- package/docs/server.tickallocator.getarray.md +72 -0
- package/docs/server.tickallocator.getarray3number.md +56 -0
- package/docs/server.tickallocator.getarray4number.md +56 -0
- package/docs/server.tickallocator.getobject.md +72 -0
- package/docs/server.tickallocator.getset.md +72 -0
- package/docs/server.tickallocator.map.md +72 -0
- package/docs/server.tickallocator.md +149 -0
- package/docs/server.tickallocator.reset.md +17 -0
- package/docs/server.world.md +21 -0
- package/docs/server.world.tickallocator.md +13 -0
- package/node-server.mjs +170 -172
- package/package.json +1 -1
- package/server.api.json +737 -670
- package/server.d.ts +145 -153
- package/docs/server.chunklatticeeventpayloads._chunk_lattice.add_chunk_.md +0 -16
- package/docs/server.particleemitter.burst.md +0 -54
- package/docs/server.particleemittereventpayloads._particle_emitter.burst_.md +0 -16
- package/docs/server.telemetry.getprocessstats.md +0 -56
- package/docs/server.telemetry.initializesentry.md +0 -74
- package/docs/server.telemetry.md +0 -126
- package/docs/server.telemetry.sentry.md +0 -23
- package/docs/server.telemetry.startspan.md +0 -91
- package/docs/server.telemetryspanoperation.md +0 -244
- package/docs/server.telemetryspanoptions.md +0 -18
package/server.d.ts
CHANGED
|
@@ -5,14 +5,19 @@ 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';
|
|
8
9
|
import protocol from '@hytopia.com/server-protocol';
|
|
9
10
|
import RAPIER from '@dimforge/rapier3d-simd-compat';
|
|
10
11
|
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';
|
|
14
13
|
import { WebSocket as WebSocket_2 } from 'ws';
|
|
15
14
|
|
|
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
|
+
|
|
16
21
|
/**
|
|
17
22
|
* Represents a audio playback in a world.
|
|
18
23
|
*
|
|
@@ -273,15 +278,18 @@ export declare class AudioManager {
|
|
|
273
278
|
/**
|
|
274
279
|
* Retrieves all loaded audio instances for the world.
|
|
275
280
|
*
|
|
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
|
+
*
|
|
276
286
|
* @returns An array of audio instances.
|
|
277
287
|
*/
|
|
278
|
-
getAllAudios(): Audio[];
|
|
288
|
+
getAllAudios(tickAllocated?: boolean): Audio[];
|
|
279
289
|
/**
|
|
280
290
|
* Retrieves all loaded audio instances attached to a specific entity.
|
|
281
291
|
*
|
|
282
292
|
* @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
|
-
|
|
285
293
|
* @returns An array of audio instances.
|
|
286
294
|
*/
|
|
287
295
|
getAllEntityAttachedAudios(entity: Entity): Audio[];
|
|
@@ -606,14 +614,17 @@ export declare class BlockType extends EventRouter implements protocol.Serializa
|
|
|
606
614
|
|
|
607
615
|
|
|
608
616
|
|
|
617
|
+
|
|
609
618
|
/**
|
|
610
619
|
* Creates a new block type instance.
|
|
611
620
|
* @param world - The world the block type is for.
|
|
612
621
|
* @param options - The options for the block type.
|
|
613
622
|
*/
|
|
614
|
-
constructor(options?: BlockTypeOptions);
|
|
623
|
+
constructor(blockTypeRegistry: BlockTypeRegistry, options?: BlockTypeOptions);
|
|
615
624
|
/** The unique identifier for the block type. */
|
|
616
625
|
get id(): number;
|
|
626
|
+
/** The block type registry that the block type belongs to. */
|
|
627
|
+
get blockTypeRegistry(): BlockTypeRegistry;
|
|
617
628
|
/** The collider options for the block type. */
|
|
618
629
|
get colliderOptions(): VoxelsColliderOptions;
|
|
619
630
|
/** The half extents size of the block type. */
|
|
@@ -705,9 +716,15 @@ export declare class BlockTypeRegistry extends EventRouter implements protocol.S
|
|
|
705
716
|
get world(): World;
|
|
706
717
|
/**
|
|
707
718
|
* 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
|
+
*
|
|
708
725
|
* @returns An array of all registered block types.
|
|
709
726
|
*/
|
|
710
|
-
getAllBlockTypes(): BlockType[];
|
|
727
|
+
getAllBlockTypes(tickAllocated?: boolean): BlockType[];
|
|
711
728
|
/**
|
|
712
729
|
* Get a registered block type by its id.
|
|
713
730
|
* @param id - The id of the block type to get.
|
|
@@ -865,12 +882,15 @@ export declare class ChatManager extends EventRouter {
|
|
|
865
882
|
export declare class Chunk implements protocol.Serializable {
|
|
866
883
|
|
|
867
884
|
|
|
885
|
+
|
|
868
886
|
/**
|
|
869
887
|
* Creates a new chunk instance.
|
|
870
888
|
*/
|
|
871
|
-
constructor(originCoordinate: Vector3Like);
|
|
889
|
+
constructor(chunkLattice: ChunkLattice, originCoordinate: Vector3Like);
|
|
872
890
|
/** The blocks in the chunk as a flat Uint8Array[4096], each index as 0 or a block type id. */
|
|
873
891
|
get blocks(): Readonly<Uint8Array>;
|
|
892
|
+
/** The chunk lattice that the chunk belongs to. */
|
|
893
|
+
get chunkLattice(): ChunkLattice;
|
|
874
894
|
/** The origin coordinate of the chunk. */
|
|
875
895
|
get originCoordinate(): Vector3Like;
|
|
876
896
|
/**
|
|
@@ -931,6 +951,8 @@ export declare class ChunkLattice extends EventRouter {
|
|
|
931
951
|
constructor(world: World);
|
|
932
952
|
/** The number of chunks in the lattice. */
|
|
933
953
|
get chunkCount(): number;
|
|
954
|
+
/** The world that the chunk lattice belongs to. */
|
|
955
|
+
get world(): World;
|
|
934
956
|
/**
|
|
935
957
|
* Removes and clears all chunks and their blocks from the lattice.
|
|
936
958
|
*/
|
|
@@ -969,9 +991,15 @@ export declare class ChunkLattice extends EventRouter {
|
|
|
969
991
|
getOrCreateChunk(globalCoordinate: Vector3Like): Chunk;
|
|
970
992
|
/**
|
|
971
993
|
* 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
|
+
*
|
|
972
1000
|
* @returns An array of all chunks in the lattice.
|
|
973
1001
|
*/
|
|
974
|
-
getAllChunks(): Chunk[];
|
|
1002
|
+
getAllChunks(tickAllocated?: boolean): Chunk[];
|
|
975
1003
|
/**
|
|
976
1004
|
* Check if a block exists at a specific global coordinate.
|
|
977
1005
|
* @param globalCoordinate - The global coordinate of the block to check.
|
|
@@ -998,18 +1026,12 @@ export declare class ChunkLattice extends EventRouter {
|
|
|
998
1026
|
|
|
999
1027
|
/** Event types a ChunkLattice instance can emit. See {@link ChunkLatticeEventPayloads} for the payloads. @public */
|
|
1000
1028
|
export declare enum ChunkLatticeEvent {
|
|
1001
|
-
ADD_CHUNK = "CHUNK_LATTICE.ADD_CHUNK",
|
|
1002
1029
|
REMOVE_CHUNK = "CHUNK_LATTICE.REMOVE_CHUNK",
|
|
1003
1030
|
SET_BLOCK = "CHUNK_LATTICE.SET_BLOCK"
|
|
1004
1031
|
}
|
|
1005
1032
|
|
|
1006
1033
|
/** Event payloads for ChunkLattice emitted events. @public */
|
|
1007
1034
|
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
|
-
};
|
|
1013
1035
|
/** Emitted when a chunk is removed from the lattice. */
|
|
1014
1036
|
[ChunkLatticeEvent.REMOVE_CHUNK]: {
|
|
1015
1037
|
chunkLattice: ChunkLattice;
|
|
@@ -2117,9 +2139,15 @@ export declare class EntityManager {
|
|
|
2117
2139
|
|
|
2118
2140
|
/**
|
|
2119
2141
|
* 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
|
+
*
|
|
2120
2148
|
* @returns All spawned entities in the world.
|
|
2121
2149
|
*/
|
|
2122
|
-
getAllEntities(): Entity[];
|
|
2150
|
+
getAllEntities(tickAllocated?: boolean): Entity[];
|
|
2123
2151
|
/**
|
|
2124
2152
|
* Gets all spawned player entities in the world.
|
|
2125
2153
|
* @returns All spawned player entities in the world.
|
|
@@ -2769,9 +2797,14 @@ export declare class LightManager {
|
|
|
2769
2797
|
/**
|
|
2770
2798
|
* Retrieves all spawned Light instances for the world.
|
|
2771
2799
|
*
|
|
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
|
+
*
|
|
2772
2805
|
* @returns An array of Light instances.
|
|
2773
2806
|
*/
|
|
2774
|
-
getAllLights(): Light[];
|
|
2807
|
+
getAllLights(tickAllocated?: boolean): Light[];
|
|
2775
2808
|
/**
|
|
2776
2809
|
* Retrieves all spawned Light instances attached to a specific entity.
|
|
2777
2810
|
*
|
|
@@ -3870,12 +3903,6 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
|
|
|
3870
3903
|
* @param velocityVariance - The velocity variance of an emitted particle.
|
|
3871
3904
|
*/
|
|
3872
3905
|
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;
|
|
3879
3906
|
/**
|
|
3880
3907
|
* Despawns the ParticleEmitter from the world.
|
|
3881
3908
|
*/
|
|
@@ -3899,7 +3926,6 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
|
|
|
3899
3926
|
|
|
3900
3927
|
/** Event types a ParticleEmitter instance can emit. See {@link ParticleEmitterEventPayloads} @public */
|
|
3901
3928
|
export declare enum ParticleEmitterEvent {
|
|
3902
|
-
BURST = "PARTICLE_EMITTER.BURST",
|
|
3903
3929
|
DESPAWN = "PARTICLE_EMITTER.DESPAWN",
|
|
3904
3930
|
SET_ALPHA_TEST = "PARTICLE_EMITTER.SET_ALPHA_TEST",
|
|
3905
3931
|
SET_ATTACHED_TO_ENTITY = "PARTICLE_EMITTER.SET_ATTACHED_TO_ENTITY",
|
|
@@ -3935,11 +3961,6 @@ export declare enum ParticleEmitterEvent {
|
|
|
3935
3961
|
|
|
3936
3962
|
/** Event payloads for ParticleEmitter emitted events. @public */
|
|
3937
3963
|
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
|
-
};
|
|
3943
3964
|
/** Emitted when a ParticleEmitter is despawned. */
|
|
3944
3965
|
[ParticleEmitterEvent.DESPAWN]: {
|
|
3945
3966
|
particleEmitter: ParticleEmitter;
|
|
@@ -4117,9 +4138,14 @@ export declare class ParticleEmitterManager {
|
|
|
4117
4138
|
/**
|
|
4118
4139
|
* Retrieves all spawned ParticleEmitter instances for the world.
|
|
4119
4140
|
*
|
|
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
|
+
*
|
|
4120
4146
|
* @returns An array of ParticleEmitter instances.
|
|
4121
4147
|
*/
|
|
4122
|
-
getAllParticleEmitters(): ParticleEmitter[];
|
|
4148
|
+
getAllParticleEmitters(tickAllocated?: boolean): ParticleEmitter[];
|
|
4123
4149
|
/**
|
|
4124
4150
|
* Retrieves all spawned ParticleEmitter instances attached to a specific entity.
|
|
4125
4151
|
*
|
|
@@ -5213,7 +5239,7 @@ export declare type RaycastOptions = {
|
|
|
5213
5239
|
solidMode?: boolean;
|
|
5214
5240
|
} & FilterOptions;
|
|
5215
5241
|
|
|
5216
|
-
/** A RGB color.
|
|
5242
|
+
/** A RGB color. @public */
|
|
5217
5243
|
export declare interface RgbColor {
|
|
5218
5244
|
r: number;
|
|
5219
5245
|
g: number;
|
|
@@ -5750,9 +5776,14 @@ export declare class SceneUIManager {
|
|
|
5750
5776
|
/**
|
|
5751
5777
|
* Retrieves all loaded SceneUI instances for the world.
|
|
5752
5778
|
*
|
|
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
|
+
*
|
|
5753
5784
|
* @returns An array of SceneUI instances.
|
|
5754
5785
|
*/
|
|
5755
|
-
getAllSceneUIs(): SceneUI[];
|
|
5786
|
+
getAllSceneUIs(tickAllocated?: boolean): SceneUI[];
|
|
5756
5787
|
/**
|
|
5757
5788
|
* Retrieves all loaded SceneUI instances attached to a specific entity.
|
|
5758
5789
|
*
|
|
@@ -6093,129 +6124,87 @@ export declare function startServer(init: ((() => void) | ((world: World) => voi
|
|
|
6093
6124
|
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"];
|
|
6094
6125
|
|
|
6095
6126
|
/**
|
|
6096
|
-
*
|
|
6127
|
+
* High-performance tick-scoped allocator for temporary objects, arrays, and buffers.
|
|
6128
|
+
* All allocations are automatically bulk-released when reset() is called.
|
|
6097
6129
|
*
|
|
6098
6130
|
* @remarks
|
|
6099
|
-
*
|
|
6100
|
-
*
|
|
6101
|
-
*
|
|
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.
|
|
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.
|
|
6105
6134
|
*
|
|
6106
6135
|
* @example
|
|
6107
6136
|
* ```typescript
|
|
6108
|
-
* //
|
|
6109
|
-
*
|
|
6110
|
-
*
|
|
6111
|
-
*
|
|
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
|
-
* });
|
|
6137
|
+
* // Allocate during tick
|
|
6138
|
+
* const position = tickAllocator.getArray3Number();
|
|
6139
|
+
* const rotation = tickAllocator.getArray4Number();
|
|
6140
|
+
* const data = tickAllocator.getObject<EntitySchema>();
|
|
6122
6141
|
*
|
|
6123
|
-
* //
|
|
6124
|
-
*
|
|
6125
|
-
* console.log(`Heap usage: ${stats.jsHeapUsagePercent * 100}%`);
|
|
6142
|
+
* // At end of tick - bulk release everything
|
|
6143
|
+
* tickAllocator.reset();
|
|
6126
6144
|
* ```
|
|
6127
6145
|
*
|
|
6128
6146
|
* @public
|
|
6129
6147
|
*/
|
|
6130
|
-
export declare class
|
|
6148
|
+
export declare class TickAllocator {
|
|
6149
|
+
|
|
6150
|
+
|
|
6151
|
+
|
|
6152
|
+
|
|
6153
|
+
|
|
6154
|
+
|
|
6155
|
+
|
|
6156
|
+
|
|
6157
|
+
|
|
6158
|
+
|
|
6131
6159
|
/**
|
|
6132
|
-
* Gets
|
|
6133
|
-
*
|
|
6134
|
-
* @
|
|
6135
|
-
* @returns
|
|
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.
|
|
6136
6164
|
*/
|
|
6137
|
-
|
|
6165
|
+
getArray<T extends unknown[] = unknown[]>(copyFromA?: Iterable<unknown>, copyFromB?: Iterable<unknown>): T;
|
|
6138
6166
|
/**
|
|
6139
|
-
*
|
|
6140
|
-
*
|
|
6141
|
-
* @
|
|
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.
|
|
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.
|
|
6150
6170
|
*/
|
|
6151
|
-
|
|
6171
|
+
getArray3Number(copyFrom?: Array3Number | Set<number>): Array3Number;
|
|
6152
6172
|
/**
|
|
6153
|
-
*
|
|
6154
|
-
*
|
|
6155
|
-
* @
|
|
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
|
-
* ```
|
|
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.
|
|
6177
6176
|
*/
|
|
6178
|
-
|
|
6177
|
+
getArray4Number(copyFrom?: Array4Number | Set<number>): Array4Number;
|
|
6179
6178
|
/**
|
|
6180
|
-
* Gets
|
|
6181
|
-
*
|
|
6182
|
-
* @
|
|
6183
|
-
*
|
|
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.
|
|
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.
|
|
6188
6183
|
*/
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6184
|
+
getObject<T extends Record<string, unknown> = Record<string, unknown>>(copyFromA?: T, copyFromB?: T): T;
|
|
6185
|
+
/**
|
|
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.
|
|
6190
|
+
*/
|
|
6191
|
+
getSet<T>(copyFromA?: Set<T> | T[], copyFromB?: Set<T> | T[]): Set<T>;
|
|
6192
|
+
/**
|
|
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.
|
|
6199
|
+
*/
|
|
6200
|
+
map<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U): U[];
|
|
6201
|
+
/**
|
|
6202
|
+
* Releases all allocated objects back to their respective pools.
|
|
6203
|
+
* This is intended to be called at the end of a tick.
|
|
6204
|
+
*/
|
|
6205
|
+
reset(): void;
|
|
6209
6206
|
}
|
|
6210
6207
|
|
|
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
|
-
|
|
6219
6208
|
/** The options for a trimesh collider. @public */
|
|
6220
6209
|
export declare interface TrimeshColliderOptions extends BaseColliderOptions {
|
|
6221
6210
|
shape: ColliderShape.TRIMESH;
|
|
@@ -6830,6 +6819,7 @@ export declare class World extends EventRouter implements protocol.Serializable
|
|
|
6830
6819
|
|
|
6831
6820
|
|
|
6832
6821
|
|
|
6822
|
+
|
|
6833
6823
|
|
|
6834
6824
|
|
|
6835
6825
|
/**
|
|
@@ -6842,40 +6832,32 @@ export declare class World extends EventRouter implements protocol.Serializable
|
|
|
6842
6832
|
get ambientLightColor(): RgbColor;
|
|
6843
6833
|
/** The intensity of the ambient light. */
|
|
6844
6834
|
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;
|
|
6845
6841
|
/** The color of the directional light. */
|
|
6846
6842
|
get directionalLightColor(): RgbColor;
|
|
6847
6843
|
/** The intensity of the directional light. */
|
|
6848
6844
|
get directionalLightIntensity(): number;
|
|
6849
6845
|
/** The position the directional light originates from. */
|
|
6850
6846
|
get directionalLightPosition(): Vector3Like;
|
|
6847
|
+
/** The entity manager for the world. */
|
|
6848
|
+
get entityManager(): EntityManager;
|
|
6851
6849
|
/** The color of the fog, if not explicitly set, defaults to ambient light color. */
|
|
6852
6850
|
get fogColor(): RgbColor | undefined;
|
|
6853
6851
|
/** The maximum distance from the camera at which fog stops being applied. */
|
|
6854
6852
|
get fogFar(): number;
|
|
6855
6853
|
/** The minimum distance from the camera to start applying fog. */
|
|
6856
6854
|
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;
|
|
6875
6855
|
/** The light manager for the world. */
|
|
6876
6856
|
get lightManager(): LightManager;
|
|
6877
6857
|
/** The world loop for the world. */
|
|
6878
6858
|
get loop(): WorldLoop;
|
|
6859
|
+
/** The name of the world. */
|
|
6860
|
+
get name(): string;
|
|
6879
6861
|
|
|
6880
6862
|
/** The particle emitter manager for the world. */
|
|
6881
6863
|
get particleEmitterManager(): ParticleEmitterManager;
|
|
@@ -6883,6 +6865,16 @@ export declare class World extends EventRouter implements protocol.Serializable
|
|
|
6883
6865
|
get sceneUIManager(): SceneUIManager;
|
|
6884
6866
|
/** The simulation for the world. */
|
|
6885
6867
|
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;
|
|
6886
6878
|
/**
|
|
6887
6879
|
* Loads a map into the world, clearing any prior map.
|
|
6888
6880
|
* @param map - The map to load.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [ChunkLatticeEventPayloads](./server.chunklatticeeventpayloads.md) > ["CHUNK\_LATTICE.ADD\_CHUNK"](./server.chunklatticeeventpayloads._chunk_lattice.add_chunk_.md)
|
|
4
|
-
|
|
5
|
-
## ChunkLatticeEventPayloads."CHUNK\_LATTICE.ADD\_CHUNK" property
|
|
6
|
-
|
|
7
|
-
Emitted when a chunk is added to the lattice.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
[ChunkLatticeEvent.ADD_CHUNK]: {
|
|
13
|
-
chunkLattice: ChunkLattice;
|
|
14
|
-
chunk: Chunk;
|
|
15
|
-
};
|
|
16
|
-
```
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [ParticleEmitter](./server.particleemitter.md) > [burst](./server.particleemitter.burst.md)
|
|
4
|
-
|
|
5
|
-
## ParticleEmitter.burst() method
|
|
6
|
-
|
|
7
|
-
Creates a burst of particles, regardless of pause state.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
burst(count: number): void;
|
|
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
|
-
count
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
number
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
The number of particles to burst.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
|
|
51
|
-
**Returns:**
|
|
52
|
-
|
|
53
|
-
void
|
|
54
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [ParticleEmitterEventPayloads](./server.particleemittereventpayloads.md) > ["PARTICLE\_EMITTER.BURST"](./server.particleemittereventpayloads._particle_emitter.burst_.md)
|
|
4
|
-
|
|
5
|
-
## ParticleEmitterEventPayloads."PARTICLE\_EMITTER.BURST" property
|
|
6
|
-
|
|
7
|
-
Emitted when a ParticleEmitter bursts the specified number of particles.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
[ParticleEmitterEvent.BURST]: {
|
|
13
|
-
particleEmitter: ParticleEmitter;
|
|
14
|
-
count: number;
|
|
15
|
-
};
|
|
16
|
-
```
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [Telemetry](./server.telemetry.md) > [getProcessStats](./server.telemetry.getprocessstats.md)
|
|
4
|
-
|
|
5
|
-
## Telemetry.getProcessStats() method
|
|
6
|
-
|
|
7
|
-
Gets current process memory and performance statistics.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
static getProcessStats(asMeasurement?: boolean): Record<string, any>;
|
|
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
|
-
asMeasurement
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
boolean
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
_(Optional)_ Whether to return data in Sentry measurement format with units.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
|
|
51
|
-
**Returns:**
|
|
52
|
-
|
|
53
|
-
Record<string, any>
|
|
54
|
-
|
|
55
|
-
Process statistics including heap usage, RSS memory, and capacity metrics.
|
|
56
|
-
|