@hytopia.com/server-protocol 1.3.17 → 1.3.19

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.17",
3
+ "version": "1.3.19",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/Entity.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { hexColorSchema } from './HexColor';
2
1
  import { quaternionSchema } from './Quaternion';
2
+ import { rgbColorSchema } from './RgbColor';
3
3
  import { vectorSchema } from './Vector';
4
- import type { HexColorSchema } from './HexColor';
5
4
  import type { JSONSchemaType } from 'ajv';
6
5
  import type { QuaternionSchema } from './Quaternion';
6
+ import type { RgbColorSchema } from './RgbColor';
7
7
  import type { VectorSchema } from './Vector';
8
8
 
9
9
  export type EntitySchema = {
@@ -13,13 +13,14 @@ export type EntitySchema = {
13
13
  as?: string[]; // model animations stop
14
14
  bh?: VectorSchema; // block half extents
15
15
  bt?: string; // block texture uri
16
+ h?: string[]; // model parts to hide
16
17
  m?: string; // model uri
17
18
  n?: string; // name
18
19
  p?: VectorSchema; // position
19
20
  r?: QuaternionSchema; // rotation
20
21
  rm?: boolean; // removed/remove
21
22
  s?: number; // model scale
22
- t?: HexColorSchema; // tint color
23
+ t?: RgbColorSchema; // tint color
23
24
  }
24
25
 
25
26
  export const entitySchema: JSONSchemaType<EntitySchema> = {
@@ -31,13 +32,14 @@ export const entitySchema: JSONSchemaType<EntitySchema> = {
31
32
  as: { type: 'array', items: { type: 'string' }, nullable: true },
32
33
  bh: { ...vectorSchema, nullable: true },
33
34
  bt: { type: 'string', nullable: true },
35
+ h: { type: 'array', items: { type: 'string' }, nullable: true },
34
36
  m: { type: 'string', nullable: true },
35
37
  n: { type: 'string', nullable: true },
36
38
  p: { ...vectorSchema, nullable: true },
37
39
  r: { ...quaternionSchema, nullable: true },
38
40
  rm: { type: 'boolean', nullable: true },
39
41
  s: { type: 'number', nullable: true },
40
- t: { ...hexColorSchema, nullable: true },
42
+ t: { ...rgbColorSchema, nullable: true },
41
43
  },
42
44
  required: [ 'i' ],
43
45
  additionalProperties: false,
@@ -0,0 +1,18 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+
3
+ export type RgbColorSchema = [
4
+ number, // r
5
+ number, // g
6
+ number, // b
7
+ ];
8
+
9
+ export const rgbColorSchema: JSONSchemaType<RgbColorSchema> = {
10
+ type: 'array',
11
+ items: [
12
+ { type: 'number', minimum: 0, maximum: 255 },
13
+ { type: 'number', minimum: 0, maximum: 255 },
14
+ { type: 'number', minimum: 0, maximum: 255 }
15
+ ],
16
+ minItems: 3,
17
+ maxItems: 3,
18
+ }
package/schemas/index.ts CHANGED
@@ -18,6 +18,7 @@ export * from './PhysicsDebugRaycast';
18
18
  export * from './PhysicsDebugRaycasts';
19
19
  export * from './PhysicsDebugRender';
20
20
  export * from './Quaternion';
21
+ export * from './RgbColor';
21
22
  export * from './StateRequest';
22
23
  export * from './SyncRequest';
23
24
  export * from './SyncResponse';