@hytopia.com/server-protocol 1.3.13 → 1.3.15

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.13",
3
+ "version": "1.3.15",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/Entity.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { quaternionSchema } from './Quaternion';
2
+ import { rgbColorSchema } from './RgbColor';
2
3
  import { vectorSchema } from './Vector';
4
+ import type { RgbColorSchema } from './RgbColor';
3
5
  import type { JSONSchemaType } from 'ajv';
4
6
  import type { QuaternionSchema } from './Quaternion';
5
7
  import type { VectorSchema } from './Vector';
@@ -9,14 +11,15 @@ export type EntitySchema = {
9
11
  al?: string[]; // model animations looped
10
12
  ao?: string[]; // model animations one shot
11
13
  as?: string[]; // model animations stop
12
- bt?: string; // block texture uri
13
14
  bh?: VectorSchema; // block half extents
15
+ bt?: string; // block texture uri
14
16
  m?: string; // model uri
15
17
  n?: string; // name
16
18
  p?: VectorSchema; // position
17
19
  r?: QuaternionSchema; // rotation
18
20
  rm?: boolean; // removed/remove
19
21
  s?: number; // model scale
22
+ t?: RgbColorSchema; // tint color
20
23
  }
21
24
 
22
25
  export const entitySchema: JSONSchemaType<EntitySchema> = {
@@ -26,15 +29,16 @@ export const entitySchema: JSONSchemaType<EntitySchema> = {
26
29
  al: { type: 'array', items: { type: 'string' }, nullable: true },
27
30
  ao: { type: 'array', items: { type: 'string' }, nullable: true },
28
31
  as: { type: 'array', items: { type: 'string' }, nullable: true },
29
- bt: { type: 'string', nullable: true },
30
32
  bh: { ...vectorSchema, nullable: true },
33
+ bt: { type: 'string', nullable: true },
31
34
  m: { type: 'string', nullable: true },
32
35
  n: { type: 'string', nullable: true },
33
36
  p: { ...vectorSchema, nullable: true },
34
37
  r: { ...quaternionSchema, nullable: true },
35
38
  rm: { type: 'boolean', nullable: true },
36
39
  s: { type: 'number', nullable: true },
40
+ t: { ...rgbColorSchema, nullable: true },
37
41
  },
38
42
  required: [ 'i' ],
39
43
  additionalProperties: false,
40
- }
44
+ }
@@ -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';