@dcl/ecs 7.24.1-27294863236.commit-bff98c4 → 7.24.1-27386133361.commit-558451f

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 (19) hide show
  1. package/dist/components/extended/AudioSource.d.ts +5 -3
  2. package/dist/components/extended/AudioSource.js +7 -7
  3. package/dist/components/generated/pb/decentraland/sdk/components/avatar_locomotion_settings.gen.d.ts +0 -6
  4. package/dist/components/generated/pb/decentraland/sdk/components/avatar_locomotion_settings.gen.js +0 -30
  5. package/dist/components/generated/pb/decentraland/sdk/components/avatar_shape.gen.d.ts +0 -8
  6. package/dist/components/generated/pb/decentraland/sdk/components/avatar_shape.gen.js +0 -9
  7. package/dist/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.d.ts +0 -3
  8. package/dist/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.js +1 -10
  9. package/dist/systems/triggerArea.js +2 -1
  10. package/dist-cjs/components/extended/AudioSource.d.ts +5 -3
  11. package/dist-cjs/components/extended/AudioSource.js +7 -7
  12. package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_locomotion_settings.gen.d.ts +0 -6
  13. package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_locomotion_settings.gen.js +0 -30
  14. package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_shape.gen.d.ts +0 -8
  15. package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_shape.gen.js +1 -10
  16. package/dist-cjs/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.d.ts +0 -3
  17. package/dist-cjs/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.js +1 -10
  18. package/dist-cjs/systems/triggerArea.js +2 -1
  19. package/package.json +2 -2
@@ -8,11 +8,13 @@ export interface AudioSourceComponentDefinitionExtended extends LastWriteWinElem
8
8
  /**
9
9
  * @public
10
10
  *
11
- * Set playing=true the sound `$name`
12
- * @param entity - entity with AudioSource component
11
+ * Play the sound `src` on the given entity. Creates the AudioSource component
12
+ * if it does not yet exist. Always emits a CRDT PUT, so repeated calls with
13
+ * identical parameters reliably retrigger playback.
14
+ * @param entity - target entity (AudioSource will be created if missing)
13
15
  * @param src - the path to the sound to play
14
16
  * @param resetCursor - the sound starts at 0 or continues from the current cursor position
15
- * @returns true in successful playing, false if it doesn't find the AudioSource component
17
+ * @returns always true; retained for backwards compatibility
16
18
  */
17
19
  playSound(entity: Entity, src: string, resetCursor?: boolean): boolean;
18
20
  /**
@@ -4,13 +4,13 @@ export function defineAudioSourceComponent(engine) {
4
4
  return {
5
5
  ...theComponent,
6
6
  playSound(entity, src, resetCursor = true) {
7
- // Get the mutable to modify
8
- const audioSource = theComponent.getMutableOrNull(entity);
9
- if (!audioSource)
10
- return false;
11
- audioSource.audioClipUrl = src;
12
- audioSource.playing = true;
13
- audioSource.currentTime = resetCursor ? 0 : audioSource.currentTime;
7
+ const existing = theComponent.getOrNull(entity);
8
+ theComponent.createOrReplace(entity, {
9
+ ...existing,
10
+ audioClipUrl: src,
11
+ playing: true,
12
+ currentTime: resetCursor ? 0 : existing?.currentTime ?? 0
13
+ });
14
14
  return true;
15
15
  },
16
16
  stopSound(entity, resetCursor = true) {
@@ -19,12 +19,6 @@ export interface PBAvatarLocomotionSettings {
19
19
  runJumpHeight?: number | undefined;
20
20
  /** Cooldown time after a hard landing before the avatar can move again (in seconds) */
21
21
  hardLandingCooldown?: number | undefined;
22
- /** Height of the double jump (in meters) */
23
- doubleJumpHeight?: number | undefined;
24
- /** Maximum speed when gliding (in meters per second) */
25
- glidingSpeed?: number | undefined;
26
- /** Maximum falling speed when gliding (in meters per second) */
27
- glidingFallingSpeed?: number | undefined;
28
22
  }
29
23
  /**
30
24
  * @public
@@ -9,9 +9,6 @@ function createBasePBAvatarLocomotionSettings() {
9
9
  jumpHeight: undefined,
10
10
  runJumpHeight: undefined,
11
11
  hardLandingCooldown: undefined,
12
- doubleJumpHeight: undefined,
13
- glidingSpeed: undefined,
14
- glidingFallingSpeed: undefined,
15
12
  };
16
13
  }
17
14
  /**
@@ -38,15 +35,6 @@ export var PBAvatarLocomotionSettings;
38
35
  if (message.hardLandingCooldown !== undefined) {
39
36
  writer.uint32(53).float(message.hardLandingCooldown);
40
37
  }
41
- if (message.doubleJumpHeight !== undefined) {
42
- writer.uint32(61).float(message.doubleJumpHeight);
43
- }
44
- if (message.glidingSpeed !== undefined) {
45
- writer.uint32(69).float(message.glidingSpeed);
46
- }
47
- if (message.glidingFallingSpeed !== undefined) {
48
- writer.uint32(77).float(message.glidingFallingSpeed);
49
- }
50
38
  return writer;
51
39
  }
52
40
  PBAvatarLocomotionSettings.encode = encode;
@@ -93,24 +81,6 @@ export var PBAvatarLocomotionSettings;
93
81
  }
94
82
  message.hardLandingCooldown = reader.float();
95
83
  continue;
96
- case 7:
97
- if (tag !== 61) {
98
- break;
99
- }
100
- message.doubleJumpHeight = reader.float();
101
- continue;
102
- case 8:
103
- if (tag !== 69) {
104
- break;
105
- }
106
- message.glidingSpeed = reader.float();
107
- continue;
108
- case 9:
109
- if (tag !== 77) {
110
- break;
111
- }
112
- message.glidingFallingSpeed = reader.float();
113
- continue;
114
84
  }
115
85
  if ((tag & 7) === 4 || tag === 0) {
116
86
  break;
@@ -1,13 +1,5 @@
1
1
  import _m0 from "protobufjs/minimal";
2
2
  import { Color3 } from "../../common/colors.gen";
3
- /** Mask for which bones an animation applies to. */
4
- /**
5
- * @public
6
- */
7
- export declare const enum AvatarEmoteMask {
8
- AEM_FULL_BODY = 0,
9
- AEM_UPPER_BODY = 1
10
- }
11
3
  /**
12
4
  * The AvatarShape component contains the information required to draw and animate avatar, acting as
13
5
  * a simplified GLTF container for this specific case.
@@ -3,15 +3,6 @@ import Long from "long";
3
3
  import _m0 from "protobufjs/minimal";
4
4
  import { Color3 } from "../../common/colors.gen";
5
5
  const protobufPackageSarasa = "decentraland.sdk.components";
6
- /** Mask for which bones an animation applies to. */
7
- /**
8
- * @public
9
- */
10
- export var AvatarEmoteMask;
11
- (function (AvatarEmoteMask) {
12
- AvatarEmoteMask[AvatarEmoteMask["AEM_FULL_BODY"] = 0] = "AEM_FULL_BODY";
13
- AvatarEmoteMask[AvatarEmoteMask["AEM_UPPER_BODY"] = 1] = "AEM_UPPER_BODY";
14
- })(AvatarEmoteMask || (AvatarEmoteMask = {}));
15
6
  function createBasePBAvatarShape() {
16
7
  return {
17
8
  id: "",
@@ -6,7 +6,6 @@ import { CameraTransition } from "./common/camera_transition.gen";
6
6
  * an 'instant' transition (like using speed/time = 0)
7
7
  * * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
8
8
  * the holding entity transform).
9
- * * The fov defines the Field of View of the virtual camera
10
9
  */
11
10
  /**
12
11
  * @public
@@ -14,8 +13,6 @@ import { CameraTransition } from "./common/camera_transition.gen";
14
13
  export interface PBVirtualCamera {
15
14
  defaultTransition?: CameraTransition | undefined;
16
15
  lookAtEntity?: number | undefined;
17
- /** default: 60 */
18
- fov?: number | undefined;
19
16
  }
20
17
  /**
21
18
  * @public
@@ -3,7 +3,7 @@ import _m0 from "protobufjs/minimal";
3
3
  import { CameraTransition } from "./common/camera_transition.gen";
4
4
  const protobufPackageSarasa = "decentraland.sdk.components";
5
5
  function createBasePBVirtualCamera() {
6
- return { defaultTransition: undefined, lookAtEntity: undefined, fov: undefined };
6
+ return { defaultTransition: undefined, lookAtEntity: undefined };
7
7
  }
8
8
  /**
9
9
  * @public
@@ -17,9 +17,6 @@ export var PBVirtualCamera;
17
17
  if (message.lookAtEntity !== undefined) {
18
18
  writer.uint32(16).uint32(message.lookAtEntity);
19
19
  }
20
- if (message.fov !== undefined) {
21
- writer.uint32(29).float(message.fov);
22
- }
23
20
  return writer;
24
21
  }
25
22
  PBVirtualCamera.encode = encode;
@@ -42,12 +39,6 @@ export var PBVirtualCamera;
42
39
  }
43
40
  message.lookAtEntity = reader.uint32();
44
41
  continue;
45
- case 3:
46
- if (tag !== 29) {
47
- break;
48
- }
49
- message.fov = reader.float();
50
- continue;
51
42
  }
52
43
  if ((tag & 7) === 4 || tag === 0) {
53
44
  break;
@@ -177,7 +177,8 @@ export function createTriggerAreaEventsSystem(engine) {
177
177
  // Pass 2: synthesize per-tick onStay callbacks
178
178
  // -----------------------------------------------------------------------
179
179
  // Only run if an onStay callback is registered and there are tracked triggerers.
180
- if (data.triggerCallbackMap.has(1 /* TriggerAreaEventType.TAET_STAY */) && data.insideTriggerers.size > 0) {
180
+ if (data.triggerCallbackMap.has(1 /* TriggerAreaEventType.TAET_STAY */) &&
181
+ data.insideTriggerers.size > 0) {
181
182
  const onStay = data.triggerCallbackMap.get(1 /* TriggerAreaEventType.TAET_STAY */);
182
183
  const currentTimestamp = Date.now();
183
184
  for (const [triggererEntity, cachedResult] of data.insideTriggerers) {
@@ -8,11 +8,13 @@ export interface AudioSourceComponentDefinitionExtended extends LastWriteWinElem
8
8
  /**
9
9
  * @public
10
10
  *
11
- * Set playing=true the sound `$name`
12
- * @param entity - entity with AudioSource component
11
+ * Play the sound `src` on the given entity. Creates the AudioSource component
12
+ * if it does not yet exist. Always emits a CRDT PUT, so repeated calls with
13
+ * identical parameters reliably retrigger playback.
14
+ * @param entity - target entity (AudioSource will be created if missing)
13
15
  * @param src - the path to the sound to play
14
16
  * @param resetCursor - the sound starts at 0 or continues from the current cursor position
15
- * @returns true in successful playing, false if it doesn't find the AudioSource component
17
+ * @returns always true; retained for backwards compatibility
16
18
  */
17
19
  playSound(entity: Entity, src: string, resetCursor?: boolean): boolean;
18
20
  /**
@@ -7,13 +7,13 @@ function defineAudioSourceComponent(engine) {
7
7
  return {
8
8
  ...theComponent,
9
9
  playSound(entity, src, resetCursor = true) {
10
- // Get the mutable to modify
11
- const audioSource = theComponent.getMutableOrNull(entity);
12
- if (!audioSource)
13
- return false;
14
- audioSource.audioClipUrl = src;
15
- audioSource.playing = true;
16
- audioSource.currentTime = resetCursor ? 0 : audioSource.currentTime;
10
+ const existing = theComponent.getOrNull(entity);
11
+ theComponent.createOrReplace(entity, {
12
+ ...existing,
13
+ audioClipUrl: src,
14
+ playing: true,
15
+ currentTime: resetCursor ? 0 : existing?.currentTime ?? 0
16
+ });
17
17
  return true;
18
18
  },
19
19
  stopSound(entity, resetCursor = true) {
@@ -19,12 +19,6 @@ export interface PBAvatarLocomotionSettings {
19
19
  runJumpHeight?: number | undefined;
20
20
  /** Cooldown time after a hard landing before the avatar can move again (in seconds) */
21
21
  hardLandingCooldown?: number | undefined;
22
- /** Height of the double jump (in meters) */
23
- doubleJumpHeight?: number | undefined;
24
- /** Maximum speed when gliding (in meters per second) */
25
- glidingSpeed?: number | undefined;
26
- /** Maximum falling speed when gliding (in meters per second) */
27
- glidingFallingSpeed?: number | undefined;
28
22
  }
29
23
  /**
30
24
  * @public
@@ -15,9 +15,6 @@ function createBasePBAvatarLocomotionSettings() {
15
15
  jumpHeight: undefined,
16
16
  runJumpHeight: undefined,
17
17
  hardLandingCooldown: undefined,
18
- doubleJumpHeight: undefined,
19
- glidingSpeed: undefined,
20
- glidingFallingSpeed: undefined,
21
18
  };
22
19
  }
23
20
  /**
@@ -44,15 +41,6 @@ var PBAvatarLocomotionSettings;
44
41
  if (message.hardLandingCooldown !== undefined) {
45
42
  writer.uint32(53).float(message.hardLandingCooldown);
46
43
  }
47
- if (message.doubleJumpHeight !== undefined) {
48
- writer.uint32(61).float(message.doubleJumpHeight);
49
- }
50
- if (message.glidingSpeed !== undefined) {
51
- writer.uint32(69).float(message.glidingSpeed);
52
- }
53
- if (message.glidingFallingSpeed !== undefined) {
54
- writer.uint32(77).float(message.glidingFallingSpeed);
55
- }
56
44
  return writer;
57
45
  }
58
46
  PBAvatarLocomotionSettings.encode = encode;
@@ -99,24 +87,6 @@ var PBAvatarLocomotionSettings;
99
87
  }
100
88
  message.hardLandingCooldown = reader.float();
101
89
  continue;
102
- case 7:
103
- if (tag !== 61) {
104
- break;
105
- }
106
- message.doubleJumpHeight = reader.float();
107
- continue;
108
- case 8:
109
- if (tag !== 69) {
110
- break;
111
- }
112
- message.glidingSpeed = reader.float();
113
- continue;
114
- case 9:
115
- if (tag !== 77) {
116
- break;
117
- }
118
- message.glidingFallingSpeed = reader.float();
119
- continue;
120
90
  }
121
91
  if ((tag & 7) === 4 || tag === 0) {
122
92
  break;
@@ -1,13 +1,5 @@
1
1
  import _m0 from "protobufjs/minimal";
2
2
  import { Color3 } from "../../common/colors.gen";
3
- /** Mask for which bones an animation applies to. */
4
- /**
5
- * @public
6
- */
7
- export declare const enum AvatarEmoteMask {
8
- AEM_FULL_BODY = 0,
9
- AEM_UPPER_BODY = 1
10
- }
11
3
  /**
12
4
  * The AvatarShape component contains the information required to draw and animate avatar, acting as
13
5
  * a simplified GLTF container for this specific case.
@@ -3,21 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PBAvatarShape = exports.AvatarEmoteMask = void 0;
6
+ exports.PBAvatarShape = void 0;
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
10
  const colors_gen_1 = require("../../common/colors.gen");
11
11
  const protobufPackageSarasa = "decentraland.sdk.components";
12
- /** Mask for which bones an animation applies to. */
13
- /**
14
- * @public
15
- */
16
- var AvatarEmoteMask;
17
- (function (AvatarEmoteMask) {
18
- AvatarEmoteMask[AvatarEmoteMask["AEM_FULL_BODY"] = 0] = "AEM_FULL_BODY";
19
- AvatarEmoteMask[AvatarEmoteMask["AEM_UPPER_BODY"] = 1] = "AEM_UPPER_BODY";
20
- })(AvatarEmoteMask = exports.AvatarEmoteMask || (exports.AvatarEmoteMask = {}));
21
12
  function createBasePBAvatarShape() {
22
13
  return {
23
14
  id: "",
@@ -6,7 +6,6 @@ import { CameraTransition } from "./common/camera_transition.gen";
6
6
  * an 'instant' transition (like using speed/time = 0)
7
7
  * * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
8
8
  * the holding entity transform).
9
- * * The fov defines the Field of View of the virtual camera
10
9
  */
11
10
  /**
12
11
  * @public
@@ -14,8 +13,6 @@ import { CameraTransition } from "./common/camera_transition.gen";
14
13
  export interface PBVirtualCamera {
15
14
  defaultTransition?: CameraTransition | undefined;
16
15
  lookAtEntity?: number | undefined;
17
- /** default: 60 */
18
- fov?: number | undefined;
19
16
  }
20
17
  /**
21
18
  * @public
@@ -9,7 +9,7 @@ const minimal_1 = __importDefault(require("protobufjs/minimal"));
9
9
  const camera_transition_gen_1 = require("./common/camera_transition.gen");
10
10
  const protobufPackageSarasa = "decentraland.sdk.components";
11
11
  function createBasePBVirtualCamera() {
12
- return { defaultTransition: undefined, lookAtEntity: undefined, fov: undefined };
12
+ return { defaultTransition: undefined, lookAtEntity: undefined };
13
13
  }
14
14
  /**
15
15
  * @public
@@ -23,9 +23,6 @@ var PBVirtualCamera;
23
23
  if (message.lookAtEntity !== undefined) {
24
24
  writer.uint32(16).uint32(message.lookAtEntity);
25
25
  }
26
- if (message.fov !== undefined) {
27
- writer.uint32(29).float(message.fov);
28
- }
29
26
  return writer;
30
27
  }
31
28
  PBVirtualCamera.encode = encode;
@@ -48,12 +45,6 @@ var PBVirtualCamera;
48
45
  }
49
46
  message.lookAtEntity = reader.uint32();
50
47
  continue;
51
- case 3:
52
- if (tag !== 29) {
53
- break;
54
- }
55
- message.fov = reader.float();
56
- continue;
57
48
  }
58
49
  if ((tag & 7) === 4 || tag === 0) {
59
50
  break;
@@ -203,7 +203,8 @@ function createTriggerAreaEventsSystem(engine) {
203
203
  // Pass 2: synthesize per-tick onStay callbacks
204
204
  // -----------------------------------------------------------------------
205
205
  // Only run if an onStay callback is registered and there are tracked triggerers.
206
- if (data.triggerCallbackMap.has(1 /* TriggerAreaEventType.TAET_STAY */) && data.insideTriggerers.size > 0) {
206
+ if (data.triggerCallbackMap.has(1 /* TriggerAreaEventType.TAET_STAY */) &&
207
+ data.insideTriggerers.size > 0) {
207
208
  const onStay = data.triggerCallbackMap.get(1 /* TriggerAreaEventType.TAET_STAY */);
208
209
  const currentTimestamp = Date.now();
209
210
  for (const [triggererEntity, cachedResult] of data.insideTriggerers) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcl/ecs",
3
3
  "description": "Decentraland ECS",
4
- "version": "7.24.1-27294863236.commit-bff98c4",
4
+ "version": "7.24.1-27386133361.commit-558451f",
5
5
  "author": "DCL",
6
6
  "bugs": "https://github.com/decentraland/ecs/issues",
7
7
  "files": [
@@ -34,5 +34,5 @@
34
34
  "dependencies": {},
35
35
  "types": "./dist/index.d.ts",
36
36
  "typings": "./dist/index.d.ts",
37
- "commit": "bff98c4afb9ed7049bac75a496cbfae2a5681518"
37
+ "commit": "558451f7deaac1ece95b58a178ab8b291e524479"
38
38
  }