@hytopia.com/server-protocol 1.3.44 → 1.3.45
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 +1 -1
- package/schemas/Entity.ts +25 -19
- package/schemas/ModelNodeOverride.ts +26 -0
- package/schemas/index.ts +1 -0
package/package.json
CHANGED
package/schemas/Entity.ts
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { quaternionSchema } from './Quaternion';
|
|
2
1
|
import { rgbColorSchema } from './RgbColor';
|
|
2
|
+
import { modelNodeOverrideSchema } from './ModelNodeOverride';
|
|
3
|
+
import { quaternionSchema } from './Quaternion';
|
|
3
4
|
import { vectorSchema } from './Vector';
|
|
4
5
|
import type { JSONSchemaType } from 'ajv';
|
|
6
|
+
import type { ModelNodeOverrideSchema } from './ModelNodeOverride';
|
|
5
7
|
import type { QuaternionSchema } from './Quaternion';
|
|
6
8
|
import type { RgbColorSchema } from './RgbColor';
|
|
7
9
|
import type { VectorSchema } from './Vector';
|
|
8
10
|
|
|
9
11
|
export type EntitySchema = {
|
|
10
|
-
i: number;
|
|
11
|
-
al?: string[];
|
|
12
|
-
ao?: string[];
|
|
13
|
-
ap?: number;
|
|
14
|
-
as?: string[];
|
|
15
|
-
bh?: VectorSchema;
|
|
16
|
-
bt?: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
n?: string;
|
|
20
|
-
o?: number;
|
|
21
|
-
p?: VectorSchema;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
i: number; // entity id
|
|
13
|
+
al?: string[]; // model animations looped
|
|
14
|
+
ao?: string[]; // model animations one shot
|
|
15
|
+
ap?: number; // model animations playback rate
|
|
16
|
+
as?: string[]; // model animations stop
|
|
17
|
+
bh?: VectorSchema; // block half extents
|
|
18
|
+
bt?: string; // block texture uri
|
|
19
|
+
m?: string; // model uri
|
|
20
|
+
mo?: ModelNodeOverrideSchema[]; // model node overrides
|
|
21
|
+
n?: string; // name
|
|
22
|
+
o?: number; // opacity
|
|
23
|
+
p?: VectorSchema; // position
|
|
24
|
+
pe?: number; // parent entity id
|
|
25
|
+
pn?: string; // parent node name
|
|
26
|
+
r?: QuaternionSchema; // rotation
|
|
27
|
+
rm?: boolean; // removed/remove
|
|
28
|
+
s?: number; // model scale
|
|
29
|
+
t?: RgbColorSchema; // tint color
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
export const entitySchema: JSONSchemaType<EntitySchema> = {
|
|
@@ -35,11 +39,13 @@ export const entitySchema: JSONSchemaType<EntitySchema> = {
|
|
|
35
39
|
as: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
36
40
|
bh: { ...vectorSchema, nullable: true },
|
|
37
41
|
bt: { type: 'string', nullable: true },
|
|
38
|
-
h: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
39
42
|
m: { type: 'string', nullable: true },
|
|
43
|
+
mo: { type: 'array', items: { ...modelNodeOverrideSchema }, nullable: true },
|
|
40
44
|
n: { type: 'string', nullable: true },
|
|
41
|
-
o: { type: 'number',
|
|
45
|
+
o: { type: 'number', nullable: true },
|
|
42
46
|
p: { ...vectorSchema, nullable: true },
|
|
47
|
+
pe: { type: 'number', nullable: true },
|
|
48
|
+
pn: { type: 'string', nullable: true },
|
|
43
49
|
r: { ...quaternionSchema, nullable: true },
|
|
44
50
|
rm: { type: 'boolean', nullable: true },
|
|
45
51
|
s: { type: 'number', nullable: true },
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { rgbColorSchema } from './RgbColor';
|
|
2
|
+
import type { JSONSchemaType } from 'ajv';
|
|
3
|
+
import type { RgbColorSchema } from './RgbColor';
|
|
4
|
+
|
|
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
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const modelNodeOverrideSchema: JSONSchemaType<ModelNodeOverrideSchema> = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
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 },
|
|
23
|
+
},
|
|
24
|
+
required: [ 'n' ],
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
}
|
package/schemas/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from './HexColor';
|
|
|
16
16
|
export * from './Input';
|
|
17
17
|
export * from './Light';
|
|
18
18
|
export * from './Lights';
|
|
19
|
+
export * from './ModelNodeOverride';
|
|
19
20
|
export * from './PhysicsDebugRaycast';
|
|
20
21
|
export * from './PhysicsDebugRaycasts';
|
|
21
22
|
export * from './PhysicsDebugRender';
|