@hytopia.com/server-protocol 1.3.42 → 1.3.43

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.com/server-protocol",
3
- "version": "1.3.42",
3
+ "version": "1.3.43",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/Model.ts CHANGED
@@ -1,26 +1,26 @@
1
1
  import { quaternionSchema } from './Quaternion';
2
- import { modelNodeSchema } from './ModelNode';
2
+ import { modelNodeOverrideSchema } from './ModelNodeOverride';
3
3
  import { vectorSchema } from './Vector';
4
4
  import type { JSONSchemaType } from 'ajv';
5
5
  import type { QuaternionSchema } from './Quaternion';
6
- import type { ModelNodeSchema } from './ModelNode';
6
+ import type { ModelNodeOverrideSchema } from './ModelNodeOverride';
7
7
  import type { VectorSchema } from './Vector';
8
8
 
9
9
  export type ModelSchema = {
10
- i: number; // model id
11
- al?: string[]; // animations looped
12
- ao?: string[]; // animations one shot
13
- ap?: number; // animations playback rate
14
- as?: string[]; // animations stop
15
- bh?: VectorSchema; // block model half extents
16
- bt?: string; // block model texture uri
17
- n?: ModelNodeSchema[]; // model node overrides
18
- p?: VectorSchema; // position
19
- pm?: number; // parent model id (When model is attached to another model)
20
- pn?: string; // parent node name (Optional node attached to when model is attached to another model)
21
- r?: QuaternionSchema; // rotation
22
- rm?: boolean; // removed/remove
23
- u?: string; // model uri
10
+ i: number; // model id
11
+ al?: string[]; // animations looped
12
+ ao?: string[]; // animations one shot
13
+ ap?: number; // animations playback rate
14
+ as?: string[]; // animations stop
15
+ bh?: VectorSchema; // block model half extents
16
+ bt?: string; // block model texture uri
17
+ n?: ModelNodeOverrideSchema[]; // model node overrides
18
+ p?: VectorSchema; // position
19
+ pm?: number; // parent model id (When model is attached to another model)
20
+ pn?: string; // parent node name (Optional node attached to when model is attached to another model)
21
+ r?: QuaternionSchema; // rotation
22
+ rm?: boolean; // removed/remove
23
+ u?: string; // model uri
24
24
  }
25
25
 
26
26
  export const modelSchema: JSONSchemaType<ModelSchema> = {
@@ -33,7 +33,7 @@ export const modelSchema: JSONSchemaType<ModelSchema> = {
33
33
  as: { type: 'array', items: { type: 'string' }, nullable: true },
34
34
  bh: { ...vectorSchema, nullable: true },
35
35
  bt: { type: 'string', nullable: true },
36
- n: { type: 'array', items: { ...modelNodeSchema }, nullable: true },
36
+ n: { type: 'array', items: { ...modelNodeOverrideSchema }, nullable: true },
37
37
  p: { ...vectorSchema, nullable: true },
38
38
  pm: { type: 'number', nullable: true },
39
39
  pn: { type: 'string', nullable: true },
@@ -6,26 +6,26 @@ import type { QuaternionSchema } from './Quaternion';
6
6
  import type { RgbColorSchema } from './RgbColor';
7
7
  import type { VectorSchema } from './Vector';
8
8
 
9
- export type ModelNodeSchema = {
9
+ export type ModelNodeOverrideSchema = {
10
10
  n: string; // node name matcher, supporting wildcards (*), ie *-hand should match left-hand, right-hand nodes.
11
+ h?: boolean; // hidden
11
12
  o?: number; // opacity
12
13
  p?: VectorSchema; // relative position
13
14
  r?: QuaternionSchema; // relative rotation
14
15
  s?: number; // scale
15
16
  t?: RgbColorSchema; // tint color
16
- v?: boolean; // visible
17
17
  }
18
18
 
19
- export const modelNodeSchema: JSONSchemaType<ModelNodeSchema> = {
19
+ export const modelNodeOverrideSchema: JSONSchemaType<ModelNodeOverrideSchema> = {
20
20
  type: 'object',
21
21
  properties: {
22
22
  n: { type: 'string' },
23
+ h: { type: 'boolean', nullable: true },
23
24
  o: { type: 'number', minimum: 0, maximum: 1, nullable: true },
24
25
  p: { ...vectorSchema, nullable: true },
25
26
  r: { ...quaternionSchema, nullable: true },
26
27
  s: { type: 'number', nullable: true },
27
28
  t: { ...rgbColorSchema, nullable: true },
28
- v: { type: 'boolean', nullable: true },
29
29
  },
30
30
  required: [ 'n' ],
31
31
  additionalProperties: false,
package/schemas/index.ts CHANGED
@@ -15,7 +15,7 @@ export * from './Input';
15
15
  export * from './Light';
16
16
  export * from './Lights';
17
17
  export * from './Model';
18
- export * from './ModelNode';
18
+ export * from './ModelNodeOverride';
19
19
  export * from './Models';
20
20
  export * from './PhysicsDebugRaycast';
21
21
  export * from './PhysicsDebugRaycasts';