hytopia 0.8.6-devtrace-1 → 0.8.6-devtrace-allocs

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 (59) hide show
  1. package/bun-server.mjs +168 -166
  2. package/docs/server.array3number.md +13 -0
  3. package/docs/server.array4number.md +13 -0
  4. package/docs/server.audiomanager.getallaudios.md +38 -1
  5. package/docs/server.audiomanager.getallentityattachedaudios.md +17 -1
  6. package/docs/server.audiomanager.getallloopedaudios.md +38 -1
  7. package/docs/server.audiomanager.getalloneshotaudios.md +38 -1
  8. package/docs/server.audiomanager.md +4 -4
  9. package/docs/server.blocktype._constructor_.md +15 -1
  10. package/docs/server.blocktype.blocktyperegistry.md +13 -0
  11. package/docs/server.blocktype.md +22 -1
  12. package/docs/server.blocktyperegistry.getallblocktypes.md +38 -1
  13. package/docs/server.blocktyperegistry.md +1 -1
  14. package/docs/server.chunk._constructor_.md +15 -1
  15. package/docs/server.chunk.chunklattice.md +13 -0
  16. package/docs/server.chunk.md +22 -1
  17. package/docs/server.chunklattice.getallchunks.md +38 -1
  18. package/docs/server.chunklattice.md +22 -1
  19. package/docs/server.chunklattice.world.md +13 -0
  20. package/docs/server.chunklatticeevent.md +14 -0
  21. package/docs/server.chunklatticeeventpayloads._chunk_lattice.add_chunk_.md +16 -0
  22. package/docs/server.chunklatticeeventpayloads.md +19 -0
  23. package/docs/server.entitymanager.getallentities.md +38 -1
  24. package/docs/server.entitymanager.md +1 -1
  25. package/docs/server.lightmanager.getalllights.md +38 -1
  26. package/docs/server.lightmanager.md +1 -1
  27. package/docs/server.md +67 -1
  28. package/docs/server.particleemitter.burst.md +54 -0
  29. package/docs/server.particleemitter.md +14 -0
  30. package/docs/server.particleemitterevent.md +14 -0
  31. package/docs/server.particleemittereventpayloads._particle_emitter.burst_.md +16 -0
  32. package/docs/server.particleemittereventpayloads.md +19 -0
  33. package/docs/server.particleemittermanager.getallparticleemitters.md +38 -1
  34. package/docs/server.particleemittermanager.md +1 -1
  35. package/docs/server.rgbcolor.md +1 -1
  36. package/docs/server.sceneuimanager.getallsceneuis.md +38 -1
  37. package/docs/server.sceneuimanager.md +1 -1
  38. package/docs/server.telemetry.getprocessstats.md +56 -0
  39. package/docs/server.telemetry.initializesentry.md +74 -0
  40. package/docs/server.telemetry.md +126 -0
  41. package/docs/server.telemetry.sentry.md +23 -0
  42. package/docs/server.telemetry.startspan.md +91 -0
  43. package/docs/server.telemetryspanoperation.md +258 -0
  44. package/docs/server.telemetryspanoptions.md +18 -0
  45. package/docs/server.tickallocator.filter.md +72 -0
  46. package/docs/server.tickallocator.getarray.md +72 -0
  47. package/docs/server.tickallocator.getarray3number.md +56 -0
  48. package/docs/server.tickallocator.getarray4number.md +56 -0
  49. package/docs/server.tickallocator.getobject.md +72 -0
  50. package/docs/server.tickallocator.getset.md +72 -0
  51. package/docs/server.tickallocator.map.md +72 -0
  52. package/docs/server.tickallocator.md +163 -0
  53. package/docs/server.tickallocator.reset.md +17 -0
  54. package/docs/server.world.md +21 -0
  55. package/docs/server.world.tickallocator.md +13 -0
  56. package/node-server.mjs +173 -171
  57. package/package.json +1 -1
  58. package/server.api.json +2175 -312
  59. package/server.d.ts +328 -32
@@ -9,8 +9,45 @@ Retrieves all spawned Light instances for the world.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- getAllLights(): Light[];
12
+ getAllLights(tickAllocated?: boolean): Light[];
13
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
+ tickAllocated
36
+
37
+
38
+ </td><td>
39
+
40
+ boolean
41
+
42
+
43
+ </td><td>
44
+
45
+ _(Optional)_ Whether to use the tick allocator to allocate the returned array of Light instances. The allocated array will be collected and released at the end of the current tick if true. Only use this if you know what you're doing.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
14
51
  **Returns:**
15
52
 
16
53
  [Light](./server.light.md)<!-- -->\[\]
@@ -98,7 +98,7 @@ Retrieves all spawned Light instances attached to a specific entity.
98
98
  </td></tr>
99
99
  <tr><td>
100
100
 
101
- [getAllLights()](./server.lightmanager.getalllights.md)
101
+ [getAllLights(tickAllocated)](./server.lightmanager.getalllights.md)
102
102
 
103
103
 
104
104
  </td><td>
package/docs/server.md CHANGED
@@ -445,6 +445,28 @@ A simple entity controller with basic movement functions.
445
445
  Represents the physics simulation for a world.
446
446
 
447
447
 
448
+ </td></tr>
449
+ <tr><td>
450
+
451
+ [Telemetry](./server.telemetry.md)
452
+
453
+
454
+ </td><td>
455
+
456
+ Manages performance telemetry and error tracking through your Sentry.io account.
457
+
458
+
459
+ </td></tr>
460
+ <tr><td>
461
+
462
+ [TickAllocator](./server.tickallocator.md)
463
+
464
+
465
+ </td><td>
466
+
467
+ High-performance tick-scoped allocator for temporary objects, arrays, and buffers. All allocations are automatically bulk-released when reset() is called.
468
+
469
+
448
470
  </td></tr>
449
471
  <tr><td>
450
472
 
@@ -783,6 +805,17 @@ Event types a SceneUI instance can emit. See [SceneUIEventPayloads](./server.sce
783
805
  Event types a Simulation instance can emit. See [SimulationEventPayloads](./server.simulationeventpayloads.md) for the payloads.
784
806
 
785
807
 
808
+ </td></tr>
809
+ <tr><td>
810
+
811
+ [TelemetrySpanOperation](./server.telemetryspanoperation.md)
812
+
813
+
814
+ </td><td>
815
+
816
+ Performance telemetry span operation types.
817
+
818
+
786
819
  </td></tr>
787
820
  <tr><td>
788
821
 
@@ -1261,7 +1294,7 @@ A quaternion.
1261
1294
 
1262
1295
  </td><td>
1263
1296
 
1264
- A RGB color.
1297
+ A RGB color. r, g and b expect a value between 0 and 255.
1265
1298
 
1266
1299
 
1267
1300
  </td></tr>
@@ -1517,6 +1550,28 @@ Description
1517
1550
  </th></tr></thead>
1518
1551
  <tbody><tr><td>
1519
1552
 
1553
+ [Array3Number](./server.array3number.md)
1554
+
1555
+
1556
+ </td><td>
1557
+
1558
+ A 3-element number array.
1559
+
1560
+
1561
+ </td></tr>
1562
+ <tr><td>
1563
+
1564
+ [Array4Number](./server.array4number.md)
1565
+
1566
+
1567
+ </td><td>
1568
+
1569
+ A 4-element number array.
1570
+
1571
+
1572
+ </td></tr>
1573
+ <tr><td>
1574
+
1520
1575
  [ColliderOptions](./server.collideroptions.md)
1521
1576
 
1522
1577
 
@@ -1866,6 +1921,17 @@ Additional mass properties for a RigidBody.
1866
1921
  The options for a rigid body.
1867
1922
 
1868
1923
 
1924
+ </td></tr>
1925
+ <tr><td>
1926
+
1927
+ [TelemetrySpanOptions](./server.telemetryspanoptions.md)
1928
+
1929
+
1930
+ </td><td>
1931
+
1932
+ Options for creating a telemetry span.
1933
+
1934
+
1869
1935
  </td></tr>
1870
1936
  <tr><td>
1871
1937
 
@@ -0,0 +1,54 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [ParticleEmitter](./server.particleemitter.md) &gt; [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
+
@@ -806,6 +806,20 @@ Description
806
806
  </th></tr></thead>
807
807
  <tbody><tr><td>
808
808
 
809
+ [burst(count)](./server.particleemitter.burst.md)
810
+
811
+
812
+ </td><td>
813
+
814
+
815
+ </td><td>
816
+
817
+ Creates a burst of particles, regardless of pause state.
818
+
819
+
820
+ </td></tr>
821
+ <tr><td>
822
+
809
823
  [despawn()](./server.particleemitter.despawn.md)
810
824
 
811
825
 
@@ -32,6 +32,20 @@ Description
32
32
  </th></tr></thead>
33
33
  <tbody><tr><td>
34
34
 
35
+ BURST
36
+
37
+
38
+ </td><td>
39
+
40
+ `"PARTICLE_EMITTER.BURST"`
41
+
42
+
43
+ </td><td>
44
+
45
+
46
+ </td></tr>
47
+ <tr><td>
48
+
35
49
  DESPAWN
36
50
 
37
51
 
@@ -0,0 +1,16 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [ParticleEmitterEventPayloads](./server.particleemittereventpayloads.md) &gt; ["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
+ ```
@@ -37,6 +37,25 @@ Description
37
37
  </th></tr></thead>
38
38
  <tbody><tr><td>
39
39
 
40
+ ["PARTICLE\_EMITTER.BURST"](./server.particleemittereventpayloads._particle_emitter.burst_.md)
41
+
42
+
43
+ </td><td>
44
+
45
+
46
+ </td><td>
47
+
48
+ { particleEmitter: [ParticleEmitter](./server.particleemitter.md)<!-- -->; count: number; }
49
+
50
+
51
+ </td><td>
52
+
53
+ Emitted when a ParticleEmitter bursts the specified number of particles.
54
+
55
+
56
+ </td></tr>
57
+ <tr><td>
58
+
40
59
  ["PARTICLE\_EMITTER.DESPAWN"](./server.particleemittereventpayloads._particle_emitter.despawn_.md)
41
60
 
42
61
 
@@ -9,8 +9,45 @@ Retrieves all spawned ParticleEmitter instances for the world.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- getAllParticleEmitters(): ParticleEmitter[];
12
+ getAllParticleEmitters(tickAllocated?: boolean): ParticleEmitter[];
13
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
+ tickAllocated
36
+
37
+
38
+ </td><td>
39
+
40
+ boolean
41
+
42
+
43
+ </td><td>
44
+
45
+ _(Optional)_ Whether to use the tick allocator to allocate the returned array of ParticleEmitter instances. The allocated array will be collected and released at the end of the current tick if true. Only use this if you know what you're doing.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
14
51
  **Returns:**
15
52
 
16
53
  [ParticleEmitter](./server.particleemitter.md)<!-- -->\[\]
@@ -98,7 +98,7 @@ Retrieves all spawned ParticleEmitter instances attached to a specific entity.
98
98
  </td></tr>
99
99
  <tr><td>
100
100
 
101
- [getAllParticleEmitters()](./server.particleemittermanager.getallparticleemitters.md)
101
+ [getAllParticleEmitters(tickAllocated)](./server.particleemittermanager.getallparticleemitters.md)
102
102
 
103
103
 
104
104
  </td><td>
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## RgbColor interface
6
6
 
7
- A RGB color.
7
+ A RGB color. r, g and b expect a value between 0 and 255.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -9,8 +9,45 @@ Retrieves all loaded SceneUI instances for the world.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- getAllSceneUIs(): SceneUI[];
12
+ getAllSceneUIs(tickAllocated?: boolean): SceneUI[];
13
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
+ tickAllocated
36
+
37
+
38
+ </td><td>
39
+
40
+ boolean
41
+
42
+
43
+ </td><td>
44
+
45
+ _(Optional)_ Whether to use the tick allocator to allocate the returned array of SceneUI instances. The allocated array will be collected and released at the end of the current tick if true. Only use this if you know what you're doing.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
14
51
  **Returns:**
15
52
 
16
53
  [SceneUI](./server.sceneui.md)<!-- -->\[\]
@@ -98,7 +98,7 @@ Retrieves all loaded SceneUI instances attached to a specific entity.
98
98
  </td></tr>
99
99
  <tr><td>
100
100
 
101
- [getAllSceneUIs()](./server.sceneuimanager.getallsceneuis.md)
101
+ [getAllSceneUIs(tickAllocated)](./server.sceneuimanager.getallsceneuis.md)
102
102
 
103
103
 
104
104
  </td><td>
@@ -0,0 +1,56 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Telemetry](./server.telemetry.md) &gt; [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&lt;string, any&gt;
54
+
55
+ Process statistics including heap usage, RSS memory, and capacity metrics.
56
+
@@ -0,0 +1,74 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Telemetry](./server.telemetry.md) &gt; [initializeSentry](./server.telemetry.initializesentry.md)
4
+
5
+ ## Telemetry.initializeSentry() method
6
+
7
+ Initializes Sentry telemetry with the provided DSN.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ static initializeSentry(sentryDsn: string, tickTimeMsThreshold?: 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
+ sentryDsn
36
+
37
+
38
+ </td><td>
39
+
40
+ string
41
+
42
+
43
+ </td><td>
44
+
45
+ The Sentry Data Source Name (DSN) for your project.
46
+
47
+
48
+ </td></tr>
49
+ <tr><td>
50
+
51
+ tickTimeMsThreshold
52
+
53
+
54
+ </td><td>
55
+
56
+ number
57
+
58
+
59
+ </td><td>
60
+
61
+ _(Optional)_ The tick duration that must be exceeded to send a performance span to Sentry for a given tick. Defaults to 50ms.
62
+
63
+
64
+ </td></tr>
65
+ </tbody></table>
66
+
67
+ **Returns:**
68
+
69
+ void
70
+
71
+ ## Remarks
72
+
73
+ This method configures Sentry for error tracking and performance monitoring. It sets up filtering to only send performance spans that exceed the provided threshold duration, reducing noise and costs. The initialization includes game-specific tags and process statistics attachment.
74
+
@@ -0,0 +1,126 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Telemetry](./server.telemetry.md)
4
+
5
+ ## Telemetry class
6
+
7
+ Manages performance telemetry and error tracking through your Sentry.io account.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export default class Telemetry
13
+ ```
14
+
15
+ ## Remarks
16
+
17
+ The Telemetry class provides low-overhead performance monitoring and error tracking through Sentry (https://sentry.io) integration and your provided Sentry DSN. It automatically tracks critical game loop operations like physics simulation, entity updates, network synchronization, and more. The system only sends telemetry data when errors or slow-tick performance issues are detected, minimizing bandwidth and storage costs.
18
+
19
+ ## Example
20
+
21
+
22
+ ```typescript
23
+ // Initialize Sentry for production telemetry
24
+ Telemetry.initializeSentry('MY_SENTRY_PROJECT_DSN');
25
+
26
+ // Wrap performance-critical code in spans
27
+ Telemetry.startSpan({
28
+ operation: TelemetrySpanOperation.CUSTOM_OPERATION,
29
+ attributes: { // any arbitrary attributes you want to attach to the span
30
+ playerCount: world.playerManager.connectedPlayers.length,
31
+ entityCount: world.entityManager.entityCount,
32
+ },
33
+ }, () => {
34
+ // Your performance-critical code here
35
+ performExpensiveOperation();
36
+ });
37
+
38
+ // Get current process statistics
39
+ const stats = Telemetry.getProcessStats();
40
+ console.log(`Heap usage: ${stats.jsHeapUsagePercent * 100}%`);
41
+ ```
42
+
43
+ ## Methods
44
+
45
+ <table><thead><tr><th>
46
+
47
+ Method
48
+
49
+
50
+ </th><th>
51
+
52
+ Modifiers
53
+
54
+
55
+ </th><th>
56
+
57
+ Description
58
+
59
+
60
+ </th></tr></thead>
61
+ <tbody><tr><td>
62
+
63
+ [getProcessStats(asMeasurement)](./server.telemetry.getprocessstats.md)
64
+
65
+
66
+ </td><td>
67
+
68
+ `static`
69
+
70
+
71
+ </td><td>
72
+
73
+ Gets current process memory and performance statistics.
74
+
75
+
76
+ </td></tr>
77
+ <tr><td>
78
+
79
+ [initializeSentry(sentryDsn, tickTimeMsThreshold)](./server.telemetry.initializesentry.md)
80
+
81
+
82
+ </td><td>
83
+
84
+ `static`
85
+
86
+
87
+ </td><td>
88
+
89
+ Initializes Sentry telemetry with the provided DSN.
90
+
91
+
92
+ </td></tr>
93
+ <tr><td>
94
+
95
+ [sentry()](./server.telemetry.sentry.md)
96
+
97
+
98
+ </td><td>
99
+
100
+ `static`
101
+
102
+
103
+ </td><td>
104
+
105
+ Gets the Sentry SDK instance for advanced telemetry operations.
106
+
107
+
108
+ </td></tr>
109
+ <tr><td>
110
+
111
+ [startSpan(options, callback)](./server.telemetry.startspan.md)
112
+
113
+
114
+ </td><td>
115
+
116
+ `static`
117
+
118
+
119
+ </td><td>
120
+
121
+ Executes a callback function within a performance monitoring span.
122
+
123
+
124
+ </td></tr>
125
+ </tbody></table>
126
+
@@ -0,0 +1,23 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Telemetry](./server.telemetry.md) &gt; [sentry](./server.telemetry.sentry.md)
4
+
5
+ ## Telemetry.sentry() method
6
+
7
+ Gets the Sentry SDK instance for advanced telemetry operations.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ static sentry(): typeof Sentry;
13
+ ```
14
+ **Returns:**
15
+
16
+ typeof Sentry
17
+
18
+ The Sentry SDK instance.
19
+
20
+ ## Remarks
21
+
22
+ This method provides direct access to the Sentry SDK for operations not covered by the Telemetry wrapper, such as custom error reporting, user context setting, or advanced span manipulation.
23
+