hytopia 0.7.7 → 0.7.8

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.8",
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"
@@ -49649,6 +49699,83 @@
49649
49699
  "name": "TickAllocator",
49650
49700
  "preserveMemberOrder": false,
49651
49701
  "members": [
49702
+ {
49703
+ "kind": "Method",
49704
+ "canonicalReference": "server!TickAllocator#filter:member(1)",
49705
+ "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",
49706
+ "excerptTokens": [
49707
+ {
49708
+ "kind": "Content",
49709
+ "text": "filter<T>(array: "
49710
+ },
49711
+ {
49712
+ "kind": "Content",
49713
+ "text": "T[]"
49714
+ },
49715
+ {
49716
+ "kind": "Content",
49717
+ "text": ", callback: "
49718
+ },
49719
+ {
49720
+ "kind": "Content",
49721
+ "text": "(value: T, index: number, array: T[]) => boolean"
49722
+ },
49723
+ {
49724
+ "kind": "Content",
49725
+ "text": "): "
49726
+ },
49727
+ {
49728
+ "kind": "Content",
49729
+ "text": "T[]"
49730
+ },
49731
+ {
49732
+ "kind": "Content",
49733
+ "text": ";"
49734
+ }
49735
+ ],
49736
+ "typeParameters": [
49737
+ {
49738
+ "typeParameterName": "T",
49739
+ "constraintTokenRange": {
49740
+ "startIndex": 0,
49741
+ "endIndex": 0
49742
+ },
49743
+ "defaultTypeTokenRange": {
49744
+ "startIndex": 0,
49745
+ "endIndex": 0
49746
+ }
49747
+ }
49748
+ ],
49749
+ "isStatic": false,
49750
+ "returnTypeTokenRange": {
49751
+ "startIndex": 5,
49752
+ "endIndex": 6
49753
+ },
49754
+ "releaseTag": "Public",
49755
+ "isProtected": false,
49756
+ "overloadIndex": 1,
49757
+ "parameters": [
49758
+ {
49759
+ "parameterName": "array",
49760
+ "parameterTypeTokenRange": {
49761
+ "startIndex": 1,
49762
+ "endIndex": 2
49763
+ },
49764
+ "isOptional": false
49765
+ },
49766
+ {
49767
+ "parameterName": "callback",
49768
+ "parameterTypeTokenRange": {
49769
+ "startIndex": 3,
49770
+ "endIndex": 4
49771
+ },
49772
+ "isOptional": false
49773
+ }
49774
+ ],
49775
+ "isOptional": false,
49776
+ "isAbstract": false,
49777
+ "name": "filter"
49778
+ },
49652
49779
  {
49653
49780
  "kind": "Method",
49654
49781
  "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.
@@ -6288,6 +6295,14 @@ export declare class TickAllocator {
6288
6295
 
6289
6296
 
6290
6297
 
6298
+ /**
6299
+ * Filters an array using a callback function.
6300
+ * @typeParam T - The type of the array.
6301
+ * @param array - The array to filter.
6302
+ * @param callback - The callback function to filter the array.
6303
+ * @returns A new array with the filtered values.
6304
+ */
6305
+ filter<T>(array: T[], callback: (value: T, index: number, array: T[]) => boolean): T[];
6291
6306
  /**
6292
6307
  * Gets a generic array from the pool.
6293
6308
  * Array is reset to empty state and ready for use.