@hytopia.com/server-protocol 1.2.8 → 1.3.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 (2) hide show
  1. package/package.json +1 -1
  2. package/schemas/Audio.ts +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hytopia.com/server-protocol",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/Audio.ts CHANGED
@@ -3,27 +3,27 @@ import type { JSONSchemaType } from 'ajv';
3
3
  import type { VectorSchema } from './Vector';
4
4
 
5
5
  export type AudioSchema = {
6
- i?: number; // audio id
6
+ i: number; // audio id
7
7
  a?: string; // audio uri
8
8
  d?: number; // duration
9
9
  de?: number; // detune
10
10
  e?: number; // entity attachment, follows entity id
11
11
  g?: number; // gain (0 to 1, or 1+ for distortion)
12
12
  l?: boolean; // loop
13
- o?: boolean; // one shot
14
13
  of?: number; // offset
15
14
  p?: VectorSchema; // spatial position of audio
16
15
  pr?: number; // playback rate (0+)
17
16
  r?: boolean; // restart
18
17
  rd?: number; // reference distance
19
18
  s?: boolean; // stop
19
+ st?: number; // start tick
20
20
  v?: number; // volume (0 to 1)
21
21
  }
22
22
 
23
23
  export const audioSchema: JSONSchemaType<AudioSchema> = {
24
24
  type: 'object',
25
25
  properties: {
26
- i: { type: 'number', nullable: true },
26
+ i: { type: 'number' },
27
27
  a: { type: 'string', nullable: true },
28
28
  d: { type: 'number', nullable: true },
29
29
  de: { type: 'number', nullable: true },
@@ -37,7 +37,9 @@ export const audioSchema: JSONSchemaType<AudioSchema> = {
37
37
  r: { type: 'boolean', nullable: true },
38
38
  rd: { type: 'number', nullable: true },
39
39
  s: { type: 'boolean', nullable: true },
40
+ st: { type: 'number', nullable: true },
40
41
  v: { type: 'number', minimum: 0, maximum: 1, nullable: true },
41
42
  },
43
+ required: ['i'],
42
44
  additionalProperties: false,
43
45
  }