@hytopia.com/server-protocol 1.3.27 → 1.3.28
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/packets/PacketCore.ts +1 -0
- package/packets/outbound/SceneUIs.ts +12 -0
- package/packets/outbound/index.ts +1 -0
- package/schemas/SceneUI.ts +24 -0
- package/schemas/SceneUIs.ts +10 -0
- package/schemas/index.ts +2 -0
package/package.json
CHANGED
package/packets/PacketCore.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { definePacket, PacketId } from '../PacketCore';
|
|
2
|
+
import type { IPacket } from '../PacketCore';
|
|
3
|
+
import { sceneUIsSchema } from '../../schemas/SceneUIs';
|
|
4
|
+
import type { SceneUIsSchema } from '../../schemas/SceneUIs';
|
|
5
|
+
import type { WorldTick } from '../PacketCore';
|
|
6
|
+
|
|
7
|
+
export type SceneUIsPacket = IPacket<typeof PacketId.SCENE_UIS, SceneUIsSchema> & [WorldTick];
|
|
8
|
+
|
|
9
|
+
export const sceneUIsPacketDefinition = definePacket(
|
|
10
|
+
PacketId.SCENE_UIS,
|
|
11
|
+
sceneUIsSchema,
|
|
12
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { vectorSchema } from './Vector';
|
|
2
|
+
import type { JSONSchemaType } from 'ajv';
|
|
3
|
+
import type { VectorSchema } from './Vector';
|
|
4
|
+
|
|
5
|
+
export type SceneUISchema = {
|
|
6
|
+
i: number; // scene ui id
|
|
7
|
+
e?: number; // entity attachment, follows entity id
|
|
8
|
+
o?: VectorSchema; // offset
|
|
9
|
+
p?: VectorSchema; // spatial position of ui
|
|
10
|
+
t?: string; // template id
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const sceneUISchema: JSONSchemaType<SceneUISchema> = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
i: { type: 'number' },
|
|
17
|
+
e: { type: 'number', nullable: true },
|
|
18
|
+
o: { ...vectorSchema, nullable: true },
|
|
19
|
+
p: { ...vectorSchema, nullable: true },
|
|
20
|
+
t: { type: 'string', nullable: true },
|
|
21
|
+
},
|
|
22
|
+
required: ['i'],
|
|
23
|
+
additionalProperties: false,
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { sceneUISchema } from './SceneUI';
|
|
2
|
+
import type { JSONSchemaType } from 'ajv';
|
|
3
|
+
import type { SceneUISchema } from './SceneUI';
|
|
4
|
+
|
|
5
|
+
export type SceneUIsSchema = SceneUISchema[];
|
|
6
|
+
|
|
7
|
+
export const sceneUIsSchema: JSONSchemaType<SceneUIsSchema> = {
|
|
8
|
+
type: 'array',
|
|
9
|
+
items: { ...sceneUISchema },
|
|
10
|
+
}
|
package/schemas/index.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from './PhysicsDebugRaycasts';
|
|
|
19
19
|
export * from './PhysicsDebugRender';
|
|
20
20
|
export * from './Quaternion';
|
|
21
21
|
export * from './RgbColor';
|
|
22
|
+
export * from './SceneUI';
|
|
23
|
+
export * from './SceneUIs';
|
|
22
24
|
export * from './StateRequest';
|
|
23
25
|
export * from './SyncRequest';
|
|
24
26
|
export * from './SyncResponse';
|