hytopia 0.1.98 → 0.2.0

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 (68) hide show
  1. package/docs/server.entity.height.md +13 -0
  2. package/docs/server.entity.md +22 -1
  3. package/docs/server.entity.opacity.md +1 -1
  4. package/docs/server.modelregistry.getheight.md +55 -0
  5. package/docs/server.modelregistry.md +14 -0
  6. package/docs/server.player.md +21 -0
  7. package/docs/server.player.profilepictureurl.md +13 -0
  8. package/examples/pathfinding/index.ts +4 -4
  9. package/examples/payload-game/index.ts +12 -10
  10. package/examples/zombies-fps/README.md +5 -0
  11. package/examples/zombies-fps/assets/audio/music/bg.mp3 +0 -0
  12. package/examples/zombies-fps/assets/audio/sfx/pistol-reload.mp3 +0 -0
  13. package/examples/zombies-fps/assets/audio/sfx/pistol-shoot.mp3 +0 -0
  14. package/examples/zombies-fps/assets/audio/sfx/player-hurt.mp3 +0 -0
  15. package/examples/zombies-fps/assets/audio/sfx/purchase.mp3 +0 -0
  16. package/examples/zombies-fps/assets/audio/sfx/rifle-reload.mp3 +0 -0
  17. package/examples/zombies-fps/assets/audio/sfx/rifle-shoot.mp3 +0 -0
  18. package/examples/zombies-fps/assets/audio/sfx/ripper-idle.mp3 +0 -0
  19. package/examples/zombies-fps/assets/audio/sfx/roulette.mp3 +0 -0
  20. package/examples/zombies-fps/assets/audio/sfx/shotgun-reload.mp3 +0 -0
  21. package/examples/zombies-fps/assets/audio/sfx/shotgun-shoot.mp3 +0 -0
  22. package/examples/zombies-fps/assets/audio/sfx/wave-start.mp3 +0 -0
  23. package/examples/zombies-fps/assets/audio/sfx/zombie-idle.mp3 +0 -0
  24. package/examples/zombies-fps/assets/icons/ak-47.png +0 -0
  25. package/examples/zombies-fps/assets/icons/ar-15.png +0 -0
  26. package/examples/zombies-fps/assets/icons/auto-pistol.png +0 -0
  27. package/examples/zombies-fps/assets/icons/auto-shotgun.png +0 -0
  28. package/examples/zombies-fps/assets/icons/heart.png +0 -0
  29. package/examples/zombies-fps/assets/icons/pistol.png +0 -0
  30. package/examples/zombies-fps/assets/icons/shotgun.png +0 -0
  31. package/examples/zombies-fps/assets/models/environment/bombbox.gltf +1 -0
  32. package/examples/zombies-fps/assets/models/environment/bullet-hole.gltf +1 -0
  33. package/examples/zombies-fps/assets/models/environment/healthkit.gltf +1 -0
  34. package/examples/zombies-fps/assets/models/environment/muzzle-flash.gltf +1 -0
  35. package/examples/zombies-fps/assets/models/items/ak-47.glb +0 -0
  36. package/examples/zombies-fps/assets/models/items/ar-15.glb +0 -0
  37. package/examples/zombies-fps/assets/models/items/auto-pistol.glb +0 -0
  38. package/examples/zombies-fps/assets/models/items/auto-shotgun.glb +0 -0
  39. package/examples/zombies-fps/assets/models/items/shotgun.glb +0 -0
  40. package/examples/zombies-fps/assets/models/npcs/ripper-boss.gltf +1 -0
  41. package/examples/zombies-fps/assets/models/players/soldier-player.gltf +1 -1
  42. package/examples/zombies-fps/assets/models/projectiles/bullet-trace.gltf +1 -0
  43. package/examples/zombies-fps/assets/ui/index.html +620 -27
  44. package/examples/zombies-fps/classes/EnemyEntity.ts +183 -4
  45. package/examples/zombies-fps/classes/GameManager.ts +165 -0
  46. package/examples/zombies-fps/classes/GamePlayerEntity.ts +263 -14
  47. package/examples/zombies-fps/classes/GunEntity.ts +225 -13
  48. package/examples/zombies-fps/classes/InteractableEntity.ts +9 -0
  49. package/examples/zombies-fps/classes/PurchaseBarrierEntity.ts +70 -17
  50. package/examples/zombies-fps/classes/WeaponCrateEntity.ts +173 -0
  51. package/examples/zombies-fps/classes/enemies/RipperEntity.ts +67 -0
  52. package/examples/zombies-fps/classes/enemies/ZombieEntity.ts +30 -0
  53. package/examples/zombies-fps/classes/guns/AK47Entity.ts +43 -0
  54. package/examples/zombies-fps/classes/guns/AR15Entity.ts +32 -0
  55. package/examples/zombies-fps/classes/guns/AutoPistolEntity.ts +36 -0
  56. package/examples/zombies-fps/classes/guns/AutoShotgunEntity.ts +37 -0
  57. package/examples/zombies-fps/classes/guns/PistolEntity.ts +23 -15
  58. package/examples/zombies-fps/classes/guns/ShotgunEntity.ts +92 -0
  59. package/examples/zombies-fps/gameConfig.ts +125 -21
  60. package/examples/zombies-fps/index.ts +14 -31
  61. package/package.json +1 -1
  62. package/server.api.json +126 -18
  63. package/server.d.ts +17 -5
  64. package/server.js +98 -90
  65. package/tsdoc-metadata.json +1 -1
  66. package/examples/zombies-fps/assets/audio/sfx/pistol-shoot-1.mp3 +0 -0
  67. package/examples/zombies-fps/assets/audio/sfx/pistol-shoot-2.mp3 +0 -0
  68. package/examples/zombies-fps/classes/guns/BulletEntity.ts +0 -0
package/server.api.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.47.11",
4
+ "toolVersion": "7.50.0",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -7115,7 +7115,7 @@
7115
7115
  {
7116
7116
  "kind": "Reference",
7117
7117
  "text": "RAPIER.Collider",
7118
- "canonicalReference": "@dimforge/rapier3d-compat!Collider:class"
7118
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Collider:class"
7119
7119
  },
7120
7120
  {
7121
7121
  "kind": "Content",
@@ -9391,7 +9391,7 @@
9391
9391
  {
9392
9392
  "kind": "Reference",
9393
9393
  "text": "RAPIER.Vector",
9394
- "canonicalReference": "@dimforge/rapier3d-compat!Vector:interface"
9394
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector:interface"
9395
9395
  },
9396
9396
  {
9397
9397
  "kind": "Content",
@@ -9400,7 +9400,7 @@
9400
9400
  {
9401
9401
  "kind": "Reference",
9402
9402
  "text": "RAPIER.Vector",
9403
- "canonicalReference": "@dimforge/rapier3d-compat!Vector:interface"
9403
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector:interface"
9404
9404
  },
9405
9405
  {
9406
9406
  "kind": "Content",
@@ -9729,6 +9729,36 @@
9729
9729
  "isAbstract": false,
9730
9730
  "name": "despawn"
9731
9731
  },
9732
+ {
9733
+ "kind": "Property",
9734
+ "canonicalReference": "server!Entity#height:member",
9735
+ "docComment": "/**\n * The height of the entity's model or block entity's y*2 half extents.\n */\n",
9736
+ "excerptTokens": [
9737
+ {
9738
+ "kind": "Content",
9739
+ "text": "get height(): "
9740
+ },
9741
+ {
9742
+ "kind": "Content",
9743
+ "text": "number"
9744
+ },
9745
+ {
9746
+ "kind": "Content",
9747
+ "text": ";"
9748
+ }
9749
+ ],
9750
+ "isReadonly": true,
9751
+ "isOptional": false,
9752
+ "releaseTag": "Public",
9753
+ "name": "height",
9754
+ "propertyTypeTokenRange": {
9755
+ "startIndex": 1,
9756
+ "endIndex": 2
9757
+ },
9758
+ "isStatic": false,
9759
+ "isProtected": false,
9760
+ "isAbstract": false
9761
+ },
9732
9762
  {
9733
9763
  "kind": "Property",
9734
9764
  "canonicalReference": "server!Entity#id:member",
@@ -10413,7 +10443,7 @@
10413
10443
  },
10414
10444
  {
10415
10445
  "kind": "Content",
10416
- "text": "number | undefined"
10446
+ "text": "number"
10417
10447
  },
10418
10448
  {
10419
10449
  "kind": "Content",
@@ -17182,6 +17212,54 @@
17182
17212
  "isAbstract": false,
17183
17213
  "name": "getBoundingBox"
17184
17214
  },
17215
+ {
17216
+ "kind": "Method",
17217
+ "canonicalReference": "server!ModelRegistry#getHeight:member(1)",
17218
+ "docComment": "/**\n * Retrieves the Y-axis height of a model for a scale of 1.\n *\n * @param modelUri - The URI of the model to retrieve the height for.\n *\n * @returns The height of the model.\n */\n",
17219
+ "excerptTokens": [
17220
+ {
17221
+ "kind": "Content",
17222
+ "text": "getHeight(modelUri: "
17223
+ },
17224
+ {
17225
+ "kind": "Content",
17226
+ "text": "string"
17227
+ },
17228
+ {
17229
+ "kind": "Content",
17230
+ "text": "): "
17231
+ },
17232
+ {
17233
+ "kind": "Content",
17234
+ "text": "number"
17235
+ },
17236
+ {
17237
+ "kind": "Content",
17238
+ "text": ";"
17239
+ }
17240
+ ],
17241
+ "isStatic": false,
17242
+ "returnTypeTokenRange": {
17243
+ "startIndex": 3,
17244
+ "endIndex": 4
17245
+ },
17246
+ "releaseTag": "Public",
17247
+ "isProtected": false,
17248
+ "overloadIndex": 1,
17249
+ "parameters": [
17250
+ {
17251
+ "parameterName": "modelUri",
17252
+ "parameterTypeTokenRange": {
17253
+ "startIndex": 1,
17254
+ "endIndex": 2
17255
+ },
17256
+ "isOptional": false
17257
+ }
17258
+ ],
17259
+ "isOptional": false,
17260
+ "isAbstract": false,
17261
+ "name": "getHeight"
17262
+ },
17185
17263
  {
17186
17264
  "kind": "Method",
17187
17265
  "canonicalReference": "server!ModelRegistry#getNodeNames:member(1)",
@@ -18208,6 +18286,36 @@
18208
18286
  "isAbstract": false,
18209
18287
  "name": "leaveWorld"
18210
18288
  },
18289
+ {
18290
+ "kind": "Property",
18291
+ "canonicalReference": "server!Player#profilePictureUrl:member",
18292
+ "docComment": "/**\n * The profile picture URL for the player.\n */\n",
18293
+ "excerptTokens": [
18294
+ {
18295
+ "kind": "Content",
18296
+ "text": "readonly profilePictureUrl: "
18297
+ },
18298
+ {
18299
+ "kind": "Content",
18300
+ "text": "string | undefined"
18301
+ },
18302
+ {
18303
+ "kind": "Content",
18304
+ "text": ";"
18305
+ }
18306
+ ],
18307
+ "isReadonly": true,
18308
+ "isOptional": false,
18309
+ "releaseTag": "Public",
18310
+ "name": "profilePictureUrl",
18311
+ "propertyTypeTokenRange": {
18312
+ "startIndex": 1,
18313
+ "endIndex": 2
18314
+ },
18315
+ "isStatic": false,
18316
+ "isProtected": false,
18317
+ "isAbstract": false
18318
+ },
18211
18319
  {
18212
18320
  "kind": "Property",
18213
18321
  "canonicalReference": "server!Player#ui:member",
@@ -24715,7 +24823,7 @@
24715
24823
  {
24716
24824
  "kind": "Reference",
24717
24825
  "text": "RAPIER.InteractionGroups",
24718
- "canonicalReference": "@dimforge/rapier3d-compat!InteractionGroups:type"
24826
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!InteractionGroups:type"
24719
24827
  },
24720
24828
  {
24721
24829
  "kind": "Content",
@@ -24799,7 +24907,7 @@
24799
24907
  {
24800
24908
  "kind": "Reference",
24801
24909
  "text": "RAPIER.QueryFilterFlags",
24802
- "canonicalReference": "@dimforge/rapier3d-compat!QueryFilterFlags:enum"
24910
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!QueryFilterFlags:enum"
24803
24911
  },
24804
24912
  {
24805
24913
  "kind": "Content",
@@ -24808,7 +24916,7 @@
24808
24916
  {
24809
24917
  "kind": "Reference",
24810
24918
  "text": "RAPIER.Collider",
24811
- "canonicalReference": "@dimforge/rapier3d-compat!Collider:class"
24919
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Collider:class"
24812
24920
  },
24813
24921
  {
24814
24922
  "kind": "Content",
@@ -24817,7 +24925,7 @@
24817
24925
  {
24818
24926
  "kind": "Reference",
24819
24927
  "text": "RAPIER.RigidBody",
24820
- "canonicalReference": "@dimforge/rapier3d-compat!RigidBody:class"
24928
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!RigidBody:class"
24821
24929
  },
24822
24930
  {
24823
24931
  "kind": "Content",
@@ -24826,7 +24934,7 @@
24826
24934
  {
24827
24935
  "kind": "Reference",
24828
24936
  "text": "RAPIER.Collider",
24829
- "canonicalReference": "@dimforge/rapier3d-compat!Collider:class"
24937
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Collider:class"
24830
24938
  },
24831
24939
  {
24832
24940
  "kind": "Content",
@@ -26717,7 +26825,7 @@
26717
26825
  {
26718
26826
  "kind": "Reference",
26719
26827
  "text": "RAPIER.RigidBody",
26720
- "canonicalReference": "@dimforge/rapier3d-compat!RigidBody:class"
26828
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!RigidBody:class"
26721
26829
  },
26722
26830
  {
26723
26831
  "kind": "Content",
@@ -30358,7 +30466,7 @@
30358
30466
  {
30359
30467
  "kind": "Reference",
30360
30468
  "text": "RAPIER.ColliderHandle",
30361
- "canonicalReference": "@dimforge/rapier3d-compat!ColliderHandle:type"
30469
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!ColliderHandle:type"
30362
30470
  },
30363
30471
  {
30364
30472
  "kind": "Content",
@@ -30367,7 +30475,7 @@
30367
30475
  {
30368
30476
  "kind": "Reference",
30369
30477
  "text": "RAPIER.ColliderHandle",
30370
- "canonicalReference": "@dimforge/rapier3d-compat!ColliderHandle:type"
30478
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!ColliderHandle:type"
30371
30479
  },
30372
30480
  {
30373
30481
  "kind": "Content",
@@ -30429,7 +30537,7 @@
30429
30537
  {
30430
30538
  "kind": "Reference",
30431
30539
  "text": "RAPIER.Vector3",
30432
- "canonicalReference": "@dimforge/rapier3d-compat!Vector3:class"
30540
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector3:class"
30433
30541
  },
30434
30542
  {
30435
30543
  "kind": "Content",
@@ -30520,7 +30628,7 @@
30520
30628
  {
30521
30629
  "kind": "Reference",
30522
30630
  "text": "RAPIER.Vector3",
30523
- "canonicalReference": "@dimforge/rapier3d-compat!Vector3:class"
30631
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector3:class"
30524
30632
  },
30525
30633
  {
30526
30634
  "kind": "Content",
@@ -30529,7 +30637,7 @@
30529
30637
  {
30530
30638
  "kind": "Reference",
30531
30639
  "text": "RAPIER.Vector3",
30532
- "canonicalReference": "@dimforge/rapier3d-compat!Vector3:class"
30640
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector3:class"
30533
30641
  },
30534
30642
  {
30535
30643
  "kind": "Content",
@@ -30624,7 +30732,7 @@
30624
30732
  {
30625
30733
  "kind": "Reference",
30626
30734
  "text": "RAPIER.Vector3",
30627
- "canonicalReference": "@dimforge/rapier3d-compat!Vector3:class"
30735
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector3:class"
30628
30736
  },
30629
30737
  {
30630
30738
  "kind": "Content",
@@ -30737,7 +30845,7 @@
30737
30845
  {
30738
30846
  "kind": "Reference",
30739
30847
  "text": "RapierSdpMatrix3",
30740
- "canonicalReference": "@dimforge/rapier3d-compat!SdpMatrix3:class"
30848
+ "canonicalReference": "@dimforge/rapier3d-compat-simd!SdpMatrix3:class"
30741
30849
  },
30742
30850
  {
30743
30851
  "kind": "Content",
package/server.d.ts CHANGED
@@ -1,13 +1,12 @@
1
- /// <reference types="node" />
2
-
3
1
  import type { AnyPacket } from '@hytopia.com/server-protocol';
4
2
  import http from 'http';
5
3
  import type { IncomingMessage } from 'http';
6
4
  import type { InputSchema } from '@hytopia.com/server-protocol';
7
5
  import type { IPacket } from '@hytopia.com/server-protocol';
6
+ import type { LobbyMembershipDto } from '@hytopia.com/creative-lib/dist/impl/getSession';
8
7
  import protocol from '@hytopia.com/server-protocol';
9
- import RAPIER from '@dimforge/rapier3d-compat';
10
- import { SdpMatrix3 } from '@dimforge/rapier3d-compat';
8
+ import RAPIER from '@dimforge/rapier3d-compat-simd';
9
+ import { SdpMatrix3 } from '@dimforge/rapier3d-compat-simd';
11
10
  import type { Socket as Socket_2 } from 'net';
12
11
  import { WebSocket as WebSocket_2 } from 'ws';
13
12
 
@@ -1376,6 +1375,8 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
1376
1375
  get blockTextureUri(): string | undefined;
1377
1376
  /** The controller for the entity. */
1378
1377
  get controller(): BaseEntityController | undefined;
1378
+ /** The height of the entity's model or block entity's y*2 half extents. */
1379
+ get height(): number;
1379
1380
  /** The playback rate of the entity's model animations. */
1380
1381
  get modelAnimationsPlaybackRate(): number;
1381
1382
  /** The nodes to hide on the entity's model. */
@@ -1389,7 +1390,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
1389
1390
  /** The name of the entity. */
1390
1391
  get name(): string;
1391
1392
  /** The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque. */
1392
- get opacity(): number | undefined;
1393
+ get opacity(): number;
1393
1394
  /** The parent entity of the entity. */
1394
1395
  get parent(): Entity | undefined;
1395
1396
  /** The name of the parent's node (if parent is a model entity) this entity is attached to when spawned. */
@@ -2157,6 +2158,13 @@ export declare class ModelRegistry {
2157
2158
  * @returns The bounding box of the model.
2158
2159
  */
2159
2160
  getBoundingBox(modelUri: string): ModelBoundingBox;
2161
+ /**
2162
+ * Retrieves the Y-axis height of a model for a scale of 1.
2163
+ *
2164
+ * @param modelUri - The URI of the model to retrieve the height for.
2165
+ * @returns The height of the model.
2166
+ */
2167
+ getHeight(modelUri: string): number;
2160
2168
  /**
2161
2169
  * Retrieves the names of all nodes in a model.
2162
2170
  *
@@ -2288,6 +2296,8 @@ export declare class PathfindingEntityController extends SimpleEntityController
2288
2296
 
2289
2297
 
2290
2298
 
2299
+
2300
+
2291
2301
  }
2292
2302
 
2293
2303
  /**
@@ -2332,6 +2342,8 @@ export declare class Player {
2332
2342
  readonly id: string;
2333
2343
  /** The unique HYTOPIA username for the player. */
2334
2344
  readonly username: string;
2345
+ /** The profile picture URL for the player. */
2346
+ readonly profilePictureUrl: string | undefined;
2335
2347
  /** The camera for the player. */
2336
2348
  readonly camera: PlayerCamera;
2337
2349