@hytopia.com/server-protocol 1.3.44 → 1.3.45

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.45",
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,32 @@
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
+ m?: string; // model uri
20
+ mo?: ModelNodeOverrideSchema[]; // model node overrides
21
+ n?: string; // name
22
+ o?: number; // opacity
23
+ p?: VectorSchema; // position
24
+ pe?: number; // parent entity id
25
+ pn?: string; // parent node name
26
+ r?: QuaternionSchema; // rotation
27
+ rm?: boolean; // removed/remove
28
+ s?: number; // model scale
29
+ t?: RgbColorSchema; // tint color
26
30
  }
27
31
 
28
32
  export const entitySchema: JSONSchemaType<EntitySchema> = {
@@ -35,11 +39,13 @@ export const entitySchema: JSONSchemaType<EntitySchema> = {
35
39
  as: { type: 'array', items: { type: 'string' }, nullable: true },
36
40
  bh: { ...vectorSchema, nullable: true },
37
41
  bt: { type: 'string', nullable: true },
38
- h: { type: 'array', items: { type: 'string' }, nullable: true },
39
42
  m: { type: 'string', nullable: true },
43
+ mo: { type: 'array', items: { ...modelNodeOverrideSchema }, nullable: true },
40
44
  n: { type: 'string', nullable: true },
41
- o: { type: 'number', minimum: 0, maximum: 1, nullable: true },
45
+ o: { type: 'number', nullable: true },
42
46
  p: { ...vectorSchema, nullable: true },
47
+ pe: { type: 'number', nullable: true },
48
+ pn: { type: 'string', nullable: true },
43
49
  r: { ...quaternionSchema, nullable: true },
44
50
  rm: { type: 'boolean', nullable: true },
45
51
  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';