@hytopia.com/server-protocol 1.3.44 → 1.3.46

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.44",
3
+ "version": "1.3.46",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/Entity.ts CHANGED
@@ -1,28 +1,33 @@
1
- import { quaternionSchema } from './Quaternion';
2
1
  import { rgbColorSchema } from './RgbColor';
2
+ import { modelNodeOverrideSchema } from './ModelNodeOverride';
3
+ import { quaternionSchema } from './Quaternion';
3
4
  import { vectorSchema } from './Vector';
4
5
  import type { JSONSchemaType } from 'ajv';
6
+ import type { ModelNodeOverrideSchema } from './ModelNodeOverride';
5
7
  import type { QuaternionSchema } from './Quaternion';
6
8
  import type { RgbColorSchema } from './RgbColor';
7
9
  import type { VectorSchema } from './Vector';
8
10
 
9
11
  export type EntitySchema = {
10
- i: number; // entity id
11
- al?: string[]; // model animations looped
12
- ao?: string[]; // model animations one shot
13
- ap?: number; // model animations playback rate
14
- as?: string[]; // model animations stop
15
- bh?: VectorSchema; // block half extents
16
- bt?: string; // block texture uri
17
- h?: string[]; // model parts to hide
18
- m?: string; // model uri
19
- n?: string; // name
20
- o?: number; // opacity
21
- p?: VectorSchema; // position
22
- r?: QuaternionSchema; // rotation
23
- rm?: boolean; // removed/remove
24
- s?: number; // model scale
25
- t?: RgbColorSchema; // tint color
12
+ i: number; // entity id
13
+ al?: string[]; // model animations looped
14
+ ao?: string[]; // model animations one shot
15
+ ap?: number; // model animations playback rate
16
+ as?: string[]; // model animations stop
17
+ bh?: VectorSchema; // block half extents
18
+ bt?: string; // block texture uri
19
+ h?: string[]; // model parts to hide
20
+ m?: string; // model uri
21
+ mo?: ModelNodeOverrideSchema[]; // model node overrides
22
+ n?: string; // name
23
+ o?: number; // opacity
24
+ p?: VectorSchema; // position
25
+ pe?: number; // parent entity id
26
+ pn?: string; // parent node name
27
+ r?: QuaternionSchema; // rotation
28
+ rm?: boolean; // removed/remove
29
+ s?: number; // model scale
30
+ t?: RgbColorSchema; // tint color
26
31
  }
27
32
 
28
33
  export const entitySchema: JSONSchemaType<EntitySchema> = {
@@ -37,9 +42,12 @@ export const entitySchema: JSONSchemaType<EntitySchema> = {
37
42
  bt: { type: 'string', nullable: true },
38
43
  h: { type: 'array', items: { type: 'string' }, nullable: true },
39
44
  m: { type: 'string', nullable: true },
45
+ mo: { type: 'array', items: { ...modelNodeOverrideSchema }, nullable: true },
40
46
  n: { type: 'string', nullable: true },
41
- o: { type: 'number', minimum: 0, maximum: 1, nullable: true },
47
+ o: { type: 'number', nullable: true },
42
48
  p: { ...vectorSchema, nullable: true },
49
+ pe: { type: 'number', nullable: true },
50
+ pn: { type: 'string', nullable: true },
43
51
  r: { ...quaternionSchema, nullable: true },
44
52
  rm: { type: 'boolean', nullable: true },
45
53
  s: { type: 'number', nullable: true },
@@ -0,0 +1,26 @@
1
+ import { rgbColorSchema } from './RgbColor';
2
+ import type { JSONSchemaType } from 'ajv';
3
+ import type { RgbColorSchema } from './RgbColor';
4
+
5
+ export type ModelNodeOverrideSchema = {
6
+ n: string; // node name match
7
+ h?: boolean; // hidden
8
+ o?: number; // opacity
9
+ r?: boolean; // reset override to defaults
10
+ s?: number; // scale
11
+ t?: RgbColorSchema; // tint color
12
+ }
13
+
14
+ export const modelNodeOverrideSchema: JSONSchemaType<ModelNodeOverrideSchema> = {
15
+ type: 'object',
16
+ properties: {
17
+ n: { type: 'string' },
18
+ h: { type: 'boolean', nullable: true },
19
+ o: { type: 'number', minimum: 0, maximum: 1, nullable: true },
20
+ r: { type: 'boolean', nullable: true },
21
+ s: { type: 'number', nullable: true },
22
+ t: { ...rgbColorSchema, nullable: true },
23
+ },
24
+ required: [ 'n' ],
25
+ additionalProperties: false,
26
+ }
package/schemas/index.ts CHANGED
@@ -16,6 +16,7 @@ export * from './HexColor';
16
16
  export * from './Input';
17
17
  export * from './Light';
18
18
  export * from './Lights';
19
+ export * from './ModelNodeOverride';
19
20
  export * from './PhysicsDebugRaycast';
20
21
  export * from './PhysicsDebugRaycasts';
21
22
  export * from './PhysicsDebugRender';