@hytopia.com/server-protocol 1.4.42 → 1.4.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.4.42",
3
+ "version": "1.4.43",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,13 +1,11 @@
1
1
  import type { JSONSchemaType } from 'ajv';
2
2
 
3
3
  export type BlockTypeSchema = {
4
- i: number; // block type id
5
- l?: boolean; // liquid
6
- ll?: number; // light level
7
- n?: string; // name
8
- t?: string; // textureUri
9
- ti?: Uint32Array | number[]; // trimesh-based block indices
10
- tv?: Float32Array | number[]; // trimesh-based block vertices
4
+ i: number; // block type id
5
+ l?: boolean; // liquid
6
+ ll?: number; // light level
7
+ n?: string; // name
8
+ t?: string; // textureUri
11
9
  }
12
10
 
13
11
  export const blockTypeSchema: JSONSchemaType<BlockTypeSchema> = {
@@ -18,9 +16,7 @@ export const blockTypeSchema: JSONSchemaType<BlockTypeSchema> = {
18
16
  ll: { type: 'number', nullable: true },
19
17
  n: { type: 'string', nullable: true },
20
18
  t: { type: 'string', nullable: true },
21
- ti: { type: 'array', items: { type: 'number' }, nullable: true },
22
- tv: { type: 'array', items: { type: 'number' }, nullable: true },
23
19
  },
24
20
  required: [ 'i' ],
25
21
  additionalProperties: false,
26
- };
22
+ }
package/schemas/Entity.ts CHANGED
@@ -17,9 +17,11 @@ export type EntitySchema = {
17
17
  bh?: VectorSchema; // block half extents
18
18
  bt?: string; // block texture uri
19
19
  e?: boolean; // environmental
20
- h?: string[]; // model nodes to hide by partial case insensitive match of gltf node names
20
+ ec?: RgbColorSchema; // emissive color
21
+ ei?: number; // emissive intensity
22
+ h?: string[]; // model nodes to hide by partial case insensitive match of gltf node names - merge into node overrides?
21
23
  m?: string; // model uri
22
- mo?: ModelNodeOverrideSchema[]; // model node overrides, (not implemented yet)
24
+ mo?: ModelNodeOverrideSchema[]; // model node overrides
23
25
  mt?: string; // model texture uri (custom override)
24
26
  n?: string; // name
25
27
  o?: number; // opacity
@@ -29,7 +31,7 @@ export type EntitySchema = {
29
31
  r?: QuaternionSchema; // rotation
30
32
  rm?: boolean; // removed/remove
31
33
  s?: number; // model scale - Deprecated as of 0.11.10, use sv
32
- sn?: string[]; // model nodes to show by partial case insensitive match of gltf node names
34
+ sn?: string[]; // model nodes to show by partial case insensitive match of gltf node names - merge into node overrides?
33
35
  sv?: VectorSchema; // model scale vector for each axis
34
36
  t?: RgbColorSchema; // tint color
35
37
  }
@@ -45,6 +47,8 @@ export const entitySchema: JSONSchemaType<EntitySchema> = {
45
47
  bh: { ...vectorSchema, nullable: true },
46
48
  bt: { type: 'string', nullable: true },
47
49
  e: { type: 'boolean', nullable: true },
50
+ ec: { ...rgbColorSchema, nullable: true },
51
+ ei: { type: 'number', nullable: true },
48
52
  h: { type: 'array', items: { type: 'string' }, nullable: true },
49
53
  m: { type: 'string', nullable: true },
50
54
  mo: { type: 'array', items: { ...modelNodeOverrideSchema }, nullable: true },
@@ -3,23 +3,17 @@ import type { JSONSchemaType } from 'ajv';
3
3
  import type { RgbColorSchema } from './RgbColor';
4
4
 
5
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
6
+ n: string; // node name match
7
+ ec?: RgbColorSchema; // emissive color
8
+ ei?: number; // emissive intensity
12
9
  }
13
10
 
14
11
  export const modelNodeOverrideSchema: JSONSchemaType<ModelNodeOverrideSchema> = {
15
12
  type: 'object',
16
13
  properties: {
17
14
  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 },
15
+ ec: { ...rgbColorSchema, nullable: true },
16
+ ei: { type: 'number', nullable: true },
23
17
  },
24
18
  required: [ 'n' ],
25
19
  additionalProperties: false,