@hytopia.com/server-protocol 1.3.34 → 1.3.35

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/schemas/World.ts +19 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hytopia.com/server-protocol",
3
- "version": "1.3.34",
3
+ "version": "1.3.35",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/World.ts CHANGED
@@ -1,17 +1,31 @@
1
+ import { rgbColorSchema } from './RgbColor';
2
+ import { vectorSchema } from './Vector';
1
3
  import type { JSONSchemaType } from 'ajv';
4
+ import type { RgbColorSchema } from './RgbColor';
5
+ import type { VectorSchema } from './Vector';
2
6
 
3
7
  export type WorldSchema = {
4
- i: number; // id
5
- f?: boolean; // focused
6
- n?: string; // name
7
- s?: string; // skyboxUri
8
- t?: number; // timestep (seconds)
8
+ i: number; // id
9
+ ac?: RgbColorSchema; // ambient light color
10
+ ai?: number; // ambient light intensity
11
+ dc?: RgbColorSchema; // directional light color
12
+ di?: number; // directional light intensity
13
+ dp?: VectorSchema; // directional light position
14
+ f?: boolean; // focused
15
+ n?: string; // name
16
+ s?: string; // skyboxUri
17
+ t?: number; // timestep (seconds)
9
18
  };
10
19
 
11
20
  export const worldSchema: JSONSchemaType<WorldSchema> = {
12
21
  type: 'object',
13
22
  properties: {
14
23
  i: { type: 'number' },
24
+ ac: { ...rgbColorSchema, nullable: true },
25
+ ai: { type: 'number', nullable: true },
26
+ dc: { ...rgbColorSchema, nullable: true },
27
+ di: { type: 'number', nullable: true },
28
+ dp: { ...vectorSchema, nullable: true },
15
29
  f: { type: 'boolean', nullable: true },
16
30
  n: { type: 'string', nullable: true },
17
31
  s: { type: 'string', nullable: true },