hytopia 0.3.29 → 0.3.31

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.
@@ -376,7 +376,7 @@ The position of the audio in the world if explicitly set.
376
376
 
377
377
  </td><td>
378
378
 
379
- number \| undefined
379
+ number
380
380
 
381
381
 
382
382
  </td><td>
@@ -9,5 +9,5 @@ The reference distance of the audio if explicitly set.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- get referenceDistance(): number | undefined;
12
+ get referenceDistance(): number;
13
13
  ```
@@ -25,8 +25,8 @@ world.onPlayerJoin = player => {
25
25
  const playerEntity = new PlayerEntity({
26
26
  player,
27
27
  name: 'Player',
28
- modelUri: 'models/player-with-gun.gltf',
29
- modelLoopedAnimations: [ 'idle' ],
28
+ modelUri: 'models/players/player.gltf',
29
+ modelLoopedAnimations: [ 'idle_lower', 'idle_upper' ],
30
30
  modelScale: 0.5,
31
31
  });
32
32
 
@@ -71,7 +71,7 @@ export default abstract class GunEntity extends ItemEntity {
71
71
  uri: options.shootAudioUri,
72
72
  volume: 0.3,
73
73
  referenceDistance: 8,
74
- cutoffDistance: 60,
74
+ cutoffDistance: 100,
75
75
  });
76
76
  }
77
77
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "totalExp": 2400
2
+ "totalExp": 3500
3
3
  }
@@ -119,6 +119,8 @@ function setupJoinNPC(world: World) {
119
119
  }
120
120
  }, 250);
121
121
 
122
+ joinNPC.spawn(world, { x: 1, y: 3.1, z: 15 });
123
+
122
124
  // Create the Scene UI over the NPC
123
125
  const npcMessageUI = new SceneUI({
124
126
  templateId: 'join-npc-message',
@@ -127,8 +129,6 @@ function setupJoinNPC(world: World) {
127
129
  });
128
130
 
129
131
  npcMessageUI.load(world);
130
-
131
- joinNPC.spawn(world, { x: 1, y: 3.1, z: 15 });
132
132
  }
133
133
 
134
134
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.3.29",
3
+ "version": "0.3.31",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.api.json CHANGED
@@ -747,7 +747,7 @@
747
747
  },
748
748
  {
749
749
  "kind": "Content",
750
- "text": "number | undefined"
750
+ "text": "number"
751
751
  },
752
752
  {
753
753
  "kind": "Content",
@@ -8500,7 +8500,7 @@
8500
8500
  {
8501
8501
  "kind": "Reference",
8502
8502
  "text": "RAPIER.Collider",
8503
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Collider:class"
8503
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Collider:class"
8504
8504
  },
8505
8505
  {
8506
8506
  "kind": "Content",
@@ -10408,7 +10408,7 @@
10408
10408
  {
10409
10409
  "kind": "Reference",
10410
10410
  "text": "RAPIER.Vector",
10411
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector:interface"
10411
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Vector:interface"
10412
10412
  },
10413
10413
  {
10414
10414
  "kind": "Content",
@@ -10417,7 +10417,7 @@
10417
10417
  {
10418
10418
  "kind": "Reference",
10419
10419
  "text": "RAPIER.Vector",
10420
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector:interface"
10420
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Vector:interface"
10421
10421
  },
10422
10422
  {
10423
10423
  "kind": "Content",
@@ -27433,7 +27433,7 @@
27433
27433
  {
27434
27434
  "kind": "Class",
27435
27435
  "canonicalReference": "server!PlayerEntity:class",
27436
- "docComment": "/**\n * Represents an entity controlled by a player in a world.\n *\n * @remarks\n *\n * Player entities extend the {@link Entity} class. They can be created and assigned to a player when a player joins a world. PlayerEntity automatically handles mapping player inputs to the associated entity controller of the entity, calling the entity controller's onTickPlayerMovement method when player input has changed.\n *\n * @example\n * ```typescript\n * world.onPlayerJoin = player => {\n * const playerEntity = new PlayerEntity({\n * player,\n * name: 'Player',\n * modelUri: 'models/player-with-gun.gltf',\n * modelLoopedAnimations: [ 'idle' ],\n * modelScale: 0.5,\n * });\n *\n * playerEntity.spawn(world, { x: 10, y: 20, z: 15 });\n * };\n * ```\n *\n * @public\n */\n",
27436
+ "docComment": "/**\n * Represents an entity controlled by a player in a world.\n *\n * @remarks\n *\n * Player entities extend the {@link Entity} class. They can be created and assigned to a player when a player joins a world. PlayerEntity automatically handles mapping player inputs to the associated entity controller of the entity, calling the entity controller's onTickPlayerMovement method when player input has changed.\n *\n * @example\n * ```typescript\n * world.onPlayerJoin = player => {\n * const playerEntity = new PlayerEntity({\n * player,\n * name: 'Player',\n * modelUri: 'models/players/player.gltf',\n * modelLoopedAnimations: [ 'idle_lower', 'idle_upper' ],\n * modelScale: 0.5,\n * });\n *\n * playerEntity.spawn(world, { x: 10, y: 20, z: 15 });\n * };\n * ```\n *\n * @public\n */\n",
27437
27437
  "excerptTokens": [
27438
27438
  {
27439
27439
  "kind": "Content",
@@ -31665,7 +31665,7 @@
31665
31665
  {
31666
31666
  "kind": "Reference",
31667
31667
  "text": "RAPIER.InteractionGroups",
31668
- "canonicalReference": "@dimforge/rapier3d-compat-simd!InteractionGroups:type"
31668
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!InteractionGroups:type"
31669
31669
  },
31670
31670
  {
31671
31671
  "kind": "Content",
@@ -31749,7 +31749,7 @@
31749
31749
  {
31750
31750
  "kind": "Reference",
31751
31751
  "text": "RAPIER.QueryFilterFlags",
31752
- "canonicalReference": "@dimforge/rapier3d-compat-simd!QueryFilterFlags:enum"
31752
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!QueryFilterFlags:enum"
31753
31753
  },
31754
31754
  {
31755
31755
  "kind": "Content",
@@ -31758,7 +31758,7 @@
31758
31758
  {
31759
31759
  "kind": "Reference",
31760
31760
  "text": "RAPIER.Collider",
31761
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Collider:class"
31761
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Collider:class"
31762
31762
  },
31763
31763
  {
31764
31764
  "kind": "Content",
@@ -31767,7 +31767,7 @@
31767
31767
  {
31768
31768
  "kind": "Reference",
31769
31769
  "text": "RAPIER.RigidBody",
31770
- "canonicalReference": "@dimforge/rapier3d-compat-simd!RigidBody:class"
31770
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!RigidBody:class"
31771
31771
  },
31772
31772
  {
31773
31773
  "kind": "Content",
@@ -31776,7 +31776,7 @@
31776
31776
  {
31777
31777
  "kind": "Reference",
31778
31778
  "text": "RAPIER.Collider",
31779
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Collider:class"
31779
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Collider:class"
31780
31780
  },
31781
31781
  {
31782
31782
  "kind": "Content",
@@ -33680,7 +33680,7 @@
33680
33680
  {
33681
33681
  "kind": "Reference",
33682
33682
  "text": "RAPIER.RigidBody",
33683
- "canonicalReference": "@dimforge/rapier3d-compat-simd!RigidBody:class"
33683
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!RigidBody:class"
33684
33684
  },
33685
33685
  {
33686
33686
  "kind": "Content",
@@ -37494,7 +37494,7 @@
37494
37494
  {
37495
37495
  "kind": "Reference",
37496
37496
  "text": "RAPIER.ColliderHandle",
37497
- "canonicalReference": "@dimforge/rapier3d-compat-simd!ColliderHandle:type"
37497
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!ColliderHandle:type"
37498
37498
  },
37499
37499
  {
37500
37500
  "kind": "Content",
@@ -37503,7 +37503,7 @@
37503
37503
  {
37504
37504
  "kind": "Reference",
37505
37505
  "text": "RAPIER.ColliderHandle",
37506
- "canonicalReference": "@dimforge/rapier3d-compat-simd!ColliderHandle:type"
37506
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!ColliderHandle:type"
37507
37507
  },
37508
37508
  {
37509
37509
  "kind": "Content",
@@ -37565,7 +37565,7 @@
37565
37565
  {
37566
37566
  "kind": "Reference",
37567
37567
  "text": "RAPIER.Vector3",
37568
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector3:class"
37568
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Vector3:class"
37569
37569
  },
37570
37570
  {
37571
37571
  "kind": "Content",
@@ -37656,7 +37656,7 @@
37656
37656
  {
37657
37657
  "kind": "Reference",
37658
37658
  "text": "RAPIER.Vector3",
37659
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector3:class"
37659
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Vector3:class"
37660
37660
  },
37661
37661
  {
37662
37662
  "kind": "Content",
@@ -37665,7 +37665,7 @@
37665
37665
  {
37666
37666
  "kind": "Reference",
37667
37667
  "text": "RAPIER.Vector3",
37668
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector3:class"
37668
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Vector3:class"
37669
37669
  },
37670
37670
  {
37671
37671
  "kind": "Content",
@@ -37760,7 +37760,7 @@
37760
37760
  {
37761
37761
  "kind": "Reference",
37762
37762
  "text": "RAPIER.Vector3",
37763
- "canonicalReference": "@dimforge/rapier3d-compat-simd!Vector3:class"
37763
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!Vector3:class"
37764
37764
  },
37765
37765
  {
37766
37766
  "kind": "Content",
@@ -38212,7 +38212,7 @@
38212
38212
  {
38213
38213
  "kind": "Reference",
38214
38214
  "text": "RapierSdpMatrix3",
38215
- "canonicalReference": "@dimforge/rapier3d-compat-simd!SdpMatrix3:class"
38215
+ "canonicalReference": "@dimforge/rapier3d-simd-compat!SdpMatrix3:class"
38216
38216
  },
38217
38217
  {
38218
38218
  "kind": "Content",
package/server.d.ts CHANGED
@@ -4,11 +4,10 @@ import EventEmitter from 'eventemitter3';
4
4
  import http from 'http';
5
5
  import type { IncomingMessage } from 'http';
6
6
  import type { InputSchema } from '@hytopia.com/server-protocol';
7
- import type { IPacket } from '@hytopia.com/server-protocol';
8
7
  import type { LobbyMembershipDto } from '@hytopia.com/creative-lib/dist/impl/getSession';
9
8
  import protocol from '@hytopia.com/server-protocol';
10
- import RAPIER from '@dimforge/rapier3d-compat-simd';
11
- import { SdpMatrix3 } from '@dimforge/rapier3d-compat-simd';
9
+ import RAPIER from '@dimforge/rapier3d-simd-compat';
10
+ import { SdpMatrix3 } from '@dimforge/rapier3d-simd-compat';
12
11
  import type { Socket } from 'net';
13
12
  import { WebSocket as WebSocket_2 } from 'ws';
14
13
 
@@ -86,7 +85,7 @@ export declare class Audio extends EventRouter implements protocol.Serializable
86
85
  /** The playback rate of the audio if explicitly set. */
87
86
  get playbackRate(): number | undefined;
88
87
  /** The reference distance of the audio if explicitly set. */
89
- get referenceDistance(): number | undefined;
88
+ get referenceDistance(): number;
90
89
  /** The server tick at which the audio started playing. */
91
90
  get startTick(): number | undefined;
92
91
  /** The URI of the audio asset. */
@@ -3569,8 +3568,8 @@ export declare type PlayerCameraOrientation = {
3569
3568
  * const playerEntity = new PlayerEntity({
3570
3569
  * player,
3571
3570
  * name: 'Player',
3572
- * modelUri: 'models/player-with-gun.gltf',
3573
- * modelLoopedAnimations: [ 'idle' ],
3571
+ * modelUri: 'models/players/player.gltf',
3572
+ * modelLoopedAnimations: [ 'idle_lower', 'idle_upper' ],
3574
3573
  * modelScale: 0.5,
3575
3574
  * });
3576
3575
  *
@@ -3797,8 +3796,6 @@ export declare class PlayerManager {
3797
3796
  static readonly instance: PlayerManager;
3798
3797
 
3799
3798
 
3800
-
3801
-
3802
3799
  /**
3803
3800
  * Get all connected players.
3804
3801
  * @returns An array of all connected players.