@hytopia.com/server-protocol 1.4.51 → 1.4.53

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.51",
3
+ "version": "1.4.53",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/Camera.ts CHANGED
@@ -3,6 +3,7 @@ import { vectorSchema } from './Vector';
3
3
  import type { VectorSchema } from './Vector';
4
4
 
5
5
  export type CameraSchema = {
6
+ cb?: boolean // collides with blocks
6
7
  m?: number // camera mode - 0: first person, 1: third person
7
8
  e?: number // entity id to attach camera to
8
9
  et?: number // entity id to track
@@ -10,6 +11,7 @@ export type CameraSchema = {
10
11
  ffo?: number // first person forward offset, moves camera in (+) or out (-) relative to camera position
11
12
  fv?: number // field of view
12
13
  h?: string[] // player model nodes to hide by partial case insensitive match of gltf node names
14
+ mp?: boolean // model pitches with camera
13
15
  o?: VectorSchema // offset - positional relative to target
14
16
  p?: VectorSchema // position to attach camera to
15
17
  pt?: VectorSchema // position to track
@@ -22,6 +24,7 @@ export type CameraSchema = {
22
24
  export const cameraSchema: JSONSchemaType<CameraSchema> = {
23
25
  type: 'object',
24
26
  properties: {
27
+ cb: { type: 'boolean', nullable: true },
25
28
  m: { type: 'number', nullable: true },
26
29
  e: { type: 'number', nullable: true },
27
30
  et: { type: 'number', nullable: true },
@@ -29,6 +32,7 @@ export const cameraSchema: JSONSchemaType<CameraSchema> = {
29
32
  ffo: { type: 'number', nullable: true },
30
33
  fv: { type: 'number', nullable: true },
31
34
  h: { type: 'array', items: { type: 'string' }, nullable: true },
35
+ mp: { type: 'boolean', nullable: true },
32
36
  o: { ...vectorSchema, nullable: true },
33
37
  p: { ...vectorSchema, nullable: true },
34
38
  pt: { ...vectorSchema, nullable: true },
package/schemas/Entity.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { rgbColorSchema } from './RgbColor';
2
2
  import { modelNodeOverrideSchema } from './ModelNodeOverride';
3
+ import { outlineSchema } from './Outline';
3
4
  import { quaternionSchema } from './Quaternion';
4
5
  import { vectorSchema } from './Vector';
5
6
  import type { JSONSchemaType } from 'ajv';
6
7
  import type { ModelNodeOverrideSchema } from './ModelNodeOverride';
8
+ import type { OutlineSchema } from './Outline';
7
9
  import type { QuaternionSchema } from './Quaternion';
8
10
  import type { RgbColorSchema } from './RgbColor';
9
11
  import type { VectorSchema } from './Vector';
@@ -25,6 +27,7 @@ export type EntitySchema = {
25
27
  mt?: string; // model texture uri (custom override)
26
28
  n?: string; // name
27
29
  o?: number; // opacity
30
+ ol?: OutlineSchema; // outline options
28
31
  p?: VectorSchema; // position
29
32
  pe?: number; // parent entity id
30
33
  pn?: string; // parent node name
@@ -55,6 +58,7 @@ export const entitySchema: JSONSchemaType<EntitySchema> = {
55
58
  mt: { type: 'string', nullable: true },
56
59
  n: { type: 'string', nullable: true },
57
60
  o: { type: 'number', nullable: true },
61
+ ol: { ...outlineSchema, nullable: true },
58
62
  p: { ...vectorSchema, nullable: true },
59
63
  pe: { type: 'number', nullable: true },
60
64
  pn: { type: 'string', nullable: true },
@@ -0,0 +1,24 @@
1
+ import { rgbColorSchema } from './RgbColor';
2
+ import type { JSONSchemaType } from 'ajv';
3
+ import type { RgbColorSchema } from './RgbColor';
4
+
5
+ export type OutlineSchema = {
6
+ c?: RgbColorSchema; // color
7
+ ci?: number; // color intensity
8
+ th?: number; // thickness
9
+ o?: number; // opacity
10
+ oc?: boolean; // occluded
11
+ }
12
+
13
+ export const outlineSchema: JSONSchemaType<OutlineSchema> = {
14
+ type: 'object',
15
+ properties: {
16
+ c: { ...rgbColorSchema, nullable: true },
17
+ ci: { type: 'number', nullable: true },
18
+ th: { type: 'number', nullable: true },
19
+ o: { type: 'number', nullable: true },
20
+ oc: { type: 'boolean', nullable: true },
21
+ },
22
+ required: [],
23
+ additionalProperties: false,
24
+ }
package/schemas/index.ts CHANGED
@@ -20,6 +20,7 @@ export * from './Light';
20
20
  export * from './Lights';
21
21
  export * from './ModelNodeOverride';
22
22
  export * from './NotificationPermissionRequest';
23
+ export * from './Outline';
23
24
  export * from './ParticleEmitter';
24
25
  export * from './ParticleEmitters';
25
26
  export * from './PhysicsDebugRaycast';