hytopia 0.7.7 → 0.7.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.7.7",
3
+ "version": "0.7.9",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./node-server.mjs",
package/server.api.json CHANGED
@@ -2139,7 +2139,7 @@
2139
2139
  {
2140
2140
  "kind": "Method",
2141
2141
  "canonicalReference": "server!AudioManager#getAllAudios:member(1)",
2142
- "docComment": "/**\n * Retrieves all loaded audio instances for the world.\n *\n * @param tickAllocated - Whether to use the tick allocator to allocate the returned array of Audio 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.\n *\n * @returns An array of audio instances.\n */\n",
2142
+ "docComment": "/**\n * Retrieves all loaded audio instances for the world.\n *\n * @param tickAllocated - If true, uses the tick allocator and frees the allocated array at the end of the current tick. false by default.\n *\n * @returns An array of audio instances.\n */\n",
2143
2143
  "excerptTokens": [
2144
2144
  {
2145
2145
  "kind": "Content",
@@ -2192,7 +2192,7 @@
2192
2192
  {
2193
2193
  "kind": "Method",
2194
2194
  "canonicalReference": "server!AudioManager#getAllEntityAttachedAudios:member(1)",
2195
- "docComment": "/**\n * Retrieves all loaded audio instances attached to a specific entity.\n *\n * @param entity - The entity to get attached audio instances for.\n *\n * @returns An array of audio instances.\n */\n",
2195
+ "docComment": "/**\n * Retrieves all loaded audio instances attached to a specific entity.\n *\n * @param entity - The entity to get attached audio instances for.\n *\n * @param tickAllocated - If true, uses the tick allocator and frees the allocated array at the end of the current tick. false by default.\n *\n * @returns An array of audio instances.\n */\n",
2196
2196
  "excerptTokens": [
2197
2197
  {
2198
2198
  "kind": "Content",
@@ -2203,6 +2203,14 @@
2203
2203
  "text": "Entity",
2204
2204
  "canonicalReference": "server!Entity:class"
2205
2205
  },
2206
+ {
2207
+ "kind": "Content",
2208
+ "text": ", tickAllocated?: "
2209
+ },
2210
+ {
2211
+ "kind": "Content",
2212
+ "text": "boolean"
2213
+ },
2206
2214
  {
2207
2215
  "kind": "Content",
2208
2216
  "text": "): "
@@ -2223,8 +2231,8 @@
2223
2231
  ],
2224
2232
  "isStatic": false,
2225
2233
  "returnTypeTokenRange": {
2226
- "startIndex": 3,
2227
- "endIndex": 5
2234
+ "startIndex": 5,
2235
+ "endIndex": 7
2228
2236
  },
2229
2237
  "releaseTag": "Public",
2230
2238
  "isProtected": false,
@@ -2237,6 +2245,14 @@
2237
2245
  "endIndex": 2
2238
2246
  },
2239
2247
  "isOptional": false
2248
+ },
2249
+ {
2250
+ "parameterName": "tickAllocated",
2251
+ "parameterTypeTokenRange": {
2252
+ "startIndex": 3,
2253
+ "endIndex": 4
2254
+ },
2255
+ "isOptional": true
2240
2256
  }
2241
2257
  ],
2242
2258
  "isOptional": false,
@@ -2246,11 +2262,19 @@
2246
2262
  {
2247
2263
  "kind": "Method",
2248
2264
  "canonicalReference": "server!AudioManager#getAllLoopedAudios:member(1)",
2249
- "docComment": "/**\n * Retrieves all looped audio instances for the world.\n *\n * @returns An array of audio instances.\n */\n",
2265
+ "docComment": "/**\n * Retrieves all looped audio instances for the world.\n *\n * @param tickAllocated - If true, uses the tick allocator and frees the allocated array at the end of the current tick. false by default.\n *\n * @returns An array of audio instances.\n */\n",
2250
2266
  "excerptTokens": [
2251
2267
  {
2252
2268
  "kind": "Content",
2253
- "text": "getAllLoopedAudios(): "
2269
+ "text": "getAllLoopedAudios(tickAllocated?: "
2270
+ },
2271
+ {
2272
+ "kind": "Content",
2273
+ "text": "boolean"
2274
+ },
2275
+ {
2276
+ "kind": "Content",
2277
+ "text": "): "
2254
2278
  },
2255
2279
  {
2256
2280
  "kind": "Reference",
@@ -2268,13 +2292,22 @@
2268
2292
  ],
2269
2293
  "isStatic": false,
2270
2294
  "returnTypeTokenRange": {
2271
- "startIndex": 1,
2272
- "endIndex": 3
2295
+ "startIndex": 3,
2296
+ "endIndex": 5
2273
2297
  },
2274
2298
  "releaseTag": "Public",
2275
2299
  "isProtected": false,
2276
2300
  "overloadIndex": 1,
2277
- "parameters": [],
2301
+ "parameters": [
2302
+ {
2303
+ "parameterName": "tickAllocated",
2304
+ "parameterTypeTokenRange": {
2305
+ "startIndex": 1,
2306
+ "endIndex": 2
2307
+ },
2308
+ "isOptional": true
2309
+ }
2310
+ ],
2278
2311
  "isOptional": false,
2279
2312
  "isAbstract": false,
2280
2313
  "name": "getAllLoopedAudios"
@@ -2282,11 +2315,19 @@
2282
2315
  {
2283
2316
  "kind": "Method",
2284
2317
  "canonicalReference": "server!AudioManager#getAllOneshotAudios:member(1)",
2285
- "docComment": "/**\n * Retrieves all oneshot (non-looped) audio instances for the world.\n *\n * @returns An array of audio instances.\n */\n",
2318
+ "docComment": "/**\n * Retrieves all oneshot (non-looped) audio instances for the world.\n *\n * @param tickAllocated - If true, uses the tick allocator and frees the allocated array at the end of the current tick. false by default.\n *\n * @returns An array of audio instances.\n */\n",
2286
2319
  "excerptTokens": [
2287
2320
  {
2288
2321
  "kind": "Content",
2289
- "text": "getAllOneshotAudios(): "
2322
+ "text": "getAllOneshotAudios(tickAllocated?: "
2323
+ },
2324
+ {
2325
+ "kind": "Content",
2326
+ "text": "boolean"
2327
+ },
2328
+ {
2329
+ "kind": "Content",
2330
+ "text": "): "
2290
2331
  },
2291
2332
  {
2292
2333
  "kind": "Reference",
@@ -2304,13 +2345,22 @@
2304
2345
  ],
2305
2346
  "isStatic": false,
2306
2347
  "returnTypeTokenRange": {
2307
- "startIndex": 1,
2308
- "endIndex": 3
2348
+ "startIndex": 3,
2349
+ "endIndex": 5
2309
2350
  },
2310
2351
  "releaseTag": "Public",
2311
2352
  "isProtected": false,
2312
2353
  "overloadIndex": 1,
2313
- "parameters": [],
2354
+ "parameters": [
2355
+ {
2356
+ "parameterName": "tickAllocated",
2357
+ "parameterTypeTokenRange": {
2358
+ "startIndex": 1,
2359
+ "endIndex": 2
2360
+ },
2361
+ "isOptional": true
2362
+ }
2363
+ ],
2314
2364
  "isOptional": false,
2315
2365
  "isAbstract": false,
2316
2366
  "name": "getAllOneshotAudios"
@@ -29068,6 +29118,54 @@
29068
29118
  "isProtected": false,
29069
29119
  "isAbstract": false
29070
29120
  },
29121
+ {
29122
+ "kind": "Method",
29123
+ "canonicalReference": "server!ParticleEmitter#burst:member(1)",
29124
+ "docComment": "/**\n * Creates a burst of particles, regardless of pause state.\n *\n * @param count - The number of particles to burst.\n */\n",
29125
+ "excerptTokens": [
29126
+ {
29127
+ "kind": "Content",
29128
+ "text": "burst(count: "
29129
+ },
29130
+ {
29131
+ "kind": "Content",
29132
+ "text": "number"
29133
+ },
29134
+ {
29135
+ "kind": "Content",
29136
+ "text": "): "
29137
+ },
29138
+ {
29139
+ "kind": "Content",
29140
+ "text": "void"
29141
+ },
29142
+ {
29143
+ "kind": "Content",
29144
+ "text": ";"
29145
+ }
29146
+ ],
29147
+ "isStatic": false,
29148
+ "returnTypeTokenRange": {
29149
+ "startIndex": 3,
29150
+ "endIndex": 4
29151
+ },
29152
+ "releaseTag": "Public",
29153
+ "isProtected": false,
29154
+ "overloadIndex": 1,
29155
+ "parameters": [
29156
+ {
29157
+ "parameterName": "count",
29158
+ "parameterTypeTokenRange": {
29159
+ "startIndex": 1,
29160
+ "endIndex": 2
29161
+ },
29162
+ "isOptional": false
29163
+ }
29164
+ ],
29165
+ "isOptional": false,
29166
+ "isAbstract": false,
29167
+ "name": "burst"
29168
+ },
29071
29169
  {
29072
29170
  "kind": "Property",
29073
29171
  "canonicalReference": "server!ParticleEmitter#colorEnd:member",
@@ -31547,6 +31645,27 @@
31547
31645
  "name": "ParticleEmitterEvent",
31548
31646
  "preserveMemberOrder": false,
31549
31647
  "members": [
31648
+ {
31649
+ "kind": "EnumMember",
31650
+ "canonicalReference": "server!ParticleEmitterEvent.BURST:member",
31651
+ "docComment": "",
31652
+ "excerptTokens": [
31653
+ {
31654
+ "kind": "Content",
31655
+ "text": "BURST = "
31656
+ },
31657
+ {
31658
+ "kind": "Content",
31659
+ "text": "\"PARTICLE_EMITTER.BURST\""
31660
+ }
31661
+ ],
31662
+ "initializerTokenRange": {
31663
+ "startIndex": 1,
31664
+ "endIndex": 2
31665
+ },
31666
+ "releaseTag": "Public",
31667
+ "name": "BURST"
31668
+ },
31550
31669
  {
31551
31670
  "kind": "EnumMember",
31552
31671
  "canonicalReference": "server!ParticleEmitterEvent.DESPAWN:member",
@@ -32215,6 +32334,51 @@
32215
32334
  "name": "ParticleEmitterEventPayloads",
32216
32335
  "preserveMemberOrder": false,
32217
32336
  "members": [
32337
+ {
32338
+ "kind": "PropertySignature",
32339
+ "canonicalReference": "server!ParticleEmitterEventPayloads#\"PARTICLE_EMITTER.BURST\":member",
32340
+ "docComment": "/**\n * Emitted when a ParticleEmitter bursts the specified number of particles.\n */\n",
32341
+ "excerptTokens": [
32342
+ {
32343
+ "kind": "Content",
32344
+ "text": "["
32345
+ },
32346
+ {
32347
+ "kind": "Reference",
32348
+ "text": "ParticleEmitterEvent.BURST",
32349
+ "canonicalReference": "server!ParticleEmitterEvent.BURST:member"
32350
+ },
32351
+ {
32352
+ "kind": "Content",
32353
+ "text": "]: "
32354
+ },
32355
+ {
32356
+ "kind": "Content",
32357
+ "text": "{\n particleEmitter: "
32358
+ },
32359
+ {
32360
+ "kind": "Reference",
32361
+ "text": "ParticleEmitter",
32362
+ "canonicalReference": "server!ParticleEmitter:class"
32363
+ },
32364
+ {
32365
+ "kind": "Content",
32366
+ "text": ";\n count: number;\n }"
32367
+ },
32368
+ {
32369
+ "kind": "Content",
32370
+ "text": ";"
32371
+ }
32372
+ ],
32373
+ "isReadonly": false,
32374
+ "isOptional": false,
32375
+ "releaseTag": "Public",
32376
+ "name": "\"PARTICLE_EMITTER.BURST\"",
32377
+ "propertyTypeTokenRange": {
32378
+ "startIndex": 3,
32379
+ "endIndex": 6
32380
+ }
32381
+ },
32218
32382
  {
32219
32383
  "kind": "PropertySignature",
32220
32384
  "canonicalReference": "server!ParticleEmitterEventPayloads#\"PARTICLE_EMITTER.DESPAWN\":member",
@@ -49649,6 +49813,83 @@
49649
49813
  "name": "TickAllocator",
49650
49814
  "preserveMemberOrder": false,
49651
49815
  "members": [
49816
+ {
49817
+ "kind": "Method",
49818
+ "canonicalReference": "server!TickAllocator#filter:member(1)",
49819
+ "docComment": "/**\n * Filters an array using a callback function.\n *\n * @param array - The array to filter.\n *\n * @param callback - The callback function to filter the array.\n *\n * @typeParam T - The type of the array.\n *\n * @returns A new array with the filtered values.\n */\n",
49820
+ "excerptTokens": [
49821
+ {
49822
+ "kind": "Content",
49823
+ "text": "filter<T>(array: "
49824
+ },
49825
+ {
49826
+ "kind": "Content",
49827
+ "text": "T[]"
49828
+ },
49829
+ {
49830
+ "kind": "Content",
49831
+ "text": ", callback: "
49832
+ },
49833
+ {
49834
+ "kind": "Content",
49835
+ "text": "(value: T, index: number, array: T[]) => boolean"
49836
+ },
49837
+ {
49838
+ "kind": "Content",
49839
+ "text": "): "
49840
+ },
49841
+ {
49842
+ "kind": "Content",
49843
+ "text": "T[]"
49844
+ },
49845
+ {
49846
+ "kind": "Content",
49847
+ "text": ";"
49848
+ }
49849
+ ],
49850
+ "typeParameters": [
49851
+ {
49852
+ "typeParameterName": "T",
49853
+ "constraintTokenRange": {
49854
+ "startIndex": 0,
49855
+ "endIndex": 0
49856
+ },
49857
+ "defaultTypeTokenRange": {
49858
+ "startIndex": 0,
49859
+ "endIndex": 0
49860
+ }
49861
+ }
49862
+ ],
49863
+ "isStatic": false,
49864
+ "returnTypeTokenRange": {
49865
+ "startIndex": 5,
49866
+ "endIndex": 6
49867
+ },
49868
+ "releaseTag": "Public",
49869
+ "isProtected": false,
49870
+ "overloadIndex": 1,
49871
+ "parameters": [
49872
+ {
49873
+ "parameterName": "array",
49874
+ "parameterTypeTokenRange": {
49875
+ "startIndex": 1,
49876
+ "endIndex": 2
49877
+ },
49878
+ "isOptional": false
49879
+ },
49880
+ {
49881
+ "parameterName": "callback",
49882
+ "parameterTypeTokenRange": {
49883
+ "startIndex": 3,
49884
+ "endIndex": 4
49885
+ },
49886
+ "isOptional": false
49887
+ }
49888
+ ],
49889
+ "isOptional": false,
49890
+ "isAbstract": false,
49891
+ "name": "filter"
49892
+ },
49652
49893
  {
49653
49894
  "kind": "Method",
49654
49895
  "canonicalReference": "server!TickAllocator#getArray:member(1)",
package/server.d.ts CHANGED
@@ -279,10 +279,8 @@ export declare class AudioManager {
279
279
  /**
280
280
  * Retrieves all loaded audio instances for the world.
281
281
  *
282
- * @param tickAllocated - Whether to use the tick allocator to allocate the
283
- * returned array of Audio instances. The allocated array will be collected
284
- * and released at the end of the current tick if true. Only use this if
285
- * you know what you're doing.
282
+ * @param tickAllocated - If true, uses the tick allocator and frees
283
+ * the allocated array at the end of the current tick. false by default.
286
284
  *
287
285
  * @returns An array of audio instances.
288
286
  */
@@ -291,21 +289,30 @@ export declare class AudioManager {
291
289
  * Retrieves all loaded audio instances attached to a specific entity.
292
290
  *
293
291
  * @param entity - The entity to get attached audio instances for.
292
+ * @param tickAllocated - If true, uses the tick allocator and frees
293
+ * the allocated array at the end of the current tick. false by default.
294
+
294
295
  * @returns An array of audio instances.
295
296
  */
296
- getAllEntityAttachedAudios(entity: Entity): Audio[];
297
+ getAllEntityAttachedAudios(entity: Entity, tickAllocated?: boolean): Audio[];
297
298
  /**
298
299
  * Retrieves all looped audio instances for the world.
299
300
  *
301
+ * @param tickAllocated - If true, uses the tick allocator and frees
302
+ * the allocated array at the end of the current tick. false by default.
303
+ *
300
304
  * @returns An array of audio instances.
301
305
  */
302
- getAllLoopedAudios(): Audio[];
306
+ getAllLoopedAudios(tickAllocated?: boolean): Audio[];
303
307
  /**
304
308
  * Retrieves all oneshot (non-looped) audio instances for the world.
305
309
  *
310
+ * @param tickAllocated - If true, uses the tick allocator and frees
311
+ * the allocated array at the end of the current tick. false by default.
312
+ *
306
313
  * @returns An array of audio instances.
307
314
  */
308
- getAllOneshotAudios(): Audio[];
315
+ getAllOneshotAudios(tickAllocated?: boolean): Audio[];
309
316
 
310
317
  /**
311
318
  * Unregisters and stops an audio instance from the audio manager.
@@ -3910,6 +3917,12 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3910
3917
  * @param velocityVariance - The velocity variance of an emitted particle.
3911
3918
  */
3912
3919
  setVelocityVariance(velocityVariance: Vector3Like): void;
3920
+ /**
3921
+ * Creates a burst of particles, regardless of pause state.
3922
+ *
3923
+ * @param count - The number of particles to burst.
3924
+ */
3925
+ burst(count: number): void;
3913
3926
  /**
3914
3927
  * Despawns the ParticleEmitter from the world.
3915
3928
  */
@@ -3933,6 +3946,7 @@ export declare class ParticleEmitter extends EventRouter implements protocol.Ser
3933
3946
 
3934
3947
  /** Event types a ParticleEmitter instance can emit. See {@link ParticleEmitterEventPayloads} @public */
3935
3948
  export declare enum ParticleEmitterEvent {
3949
+ BURST = "PARTICLE_EMITTER.BURST",
3936
3950
  DESPAWN = "PARTICLE_EMITTER.DESPAWN",
3937
3951
  SET_ALPHA_TEST = "PARTICLE_EMITTER.SET_ALPHA_TEST",
3938
3952
  SET_ATTACHED_TO_ENTITY = "PARTICLE_EMITTER.SET_ATTACHED_TO_ENTITY",
@@ -3968,6 +3982,11 @@ export declare enum ParticleEmitterEvent {
3968
3982
 
3969
3983
  /** Event payloads for ParticleEmitter emitted events. @public */
3970
3984
  export declare interface ParticleEmitterEventPayloads {
3985
+ /** Emitted when a ParticleEmitter bursts the specified number of particles. */
3986
+ [ParticleEmitterEvent.BURST]: {
3987
+ particleEmitter: ParticleEmitter;
3988
+ count: number;
3989
+ };
3971
3990
  /** Emitted when a ParticleEmitter is despawned. */
3972
3991
  [ParticleEmitterEvent.DESPAWN]: {
3973
3992
  particleEmitter: ParticleEmitter;
@@ -6288,6 +6307,14 @@ export declare class TickAllocator {
6288
6307
 
6289
6308
 
6290
6309
 
6310
+ /**
6311
+ * Filters an array using a callback function.
6312
+ * @typeParam T - The type of the array.
6313
+ * @param array - The array to filter.
6314
+ * @param callback - The callback function to filter the array.
6315
+ * @returns A new array with the filtered values.
6316
+ */
6317
+ filter<T>(array: T[], callback: (value: T, index: number, array: T[]) => boolean): T[];
6291
6318
  /**
6292
6319
  * Gets a generic array from the pool.
6293
6320
  * Array is reset to empty state and ready for use.