@hytopia.com/server-protocol 1.3.20 → 1.3.21
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 +2 -2
- package/packets/inbound/UIDataSend.ts +11 -0
- package/packets/inbound/index.ts +1 -1
- package/packets/outbound/UIDatas.ts +12 -0
- package/packets/outbound/index.ts +1 -1
- package/schemas/{UIMessage.ts → UIData.ts} +2 -2
- package/schemas/UIDatas.ts +10 -0
- package/schemas/index.ts +2 -2
- package/packets/inbound/UIMessageSend.ts +0 -11
- package/packets/outbound/UIMessages.ts +0 -12
- package/schemas/UIMessages.ts +0 -10
package/package.json
CHANGED
package/packets/PacketCore.ts
CHANGED
|
@@ -23,7 +23,7 @@ export enum PacketId {
|
|
|
23
23
|
INPUT = 1,
|
|
24
24
|
STATE_REQUEST = 2,
|
|
25
25
|
CHAT_MESSAGE_SEND = 3,
|
|
26
|
-
|
|
26
|
+
UI_DATA_SEND = 4,
|
|
27
27
|
|
|
28
28
|
// Standard Outbound Packet Types: 32 - 127 range
|
|
29
29
|
SYNC_RESPONSE = 32,
|
|
@@ -36,7 +36,7 @@ export enum PacketId {
|
|
|
36
36
|
WORLD = 39,
|
|
37
37
|
CAMERA = 40,
|
|
38
38
|
UI = 41,
|
|
39
|
-
|
|
39
|
+
UI_DATAS = 42,
|
|
40
40
|
|
|
41
41
|
// Debug Inbound Packet Types: 128 - 191 range
|
|
42
42
|
DEBUG_CONFIG = 128,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { definePacket, PacketId } from '../PacketCore';
|
|
2
|
+
import type { IPacket } from '../PacketCore';
|
|
3
|
+
import { uiDataSchema } from '../../schemas/UIData';
|
|
4
|
+
import type { UIDataSchema } from '../../schemas/UIData';
|
|
5
|
+
|
|
6
|
+
export type UIDataSendPacket = IPacket<typeof PacketId.UI_DATA_SEND, UIDataSchema>;
|
|
7
|
+
|
|
8
|
+
export const uiDataSendPacketDefinition = definePacket(
|
|
9
|
+
PacketId.UI_DATA_SEND,
|
|
10
|
+
uiDataSchema
|
|
11
|
+
);
|
package/packets/inbound/index.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { definePacket, PacketId } from '../PacketCore';
|
|
2
|
+
import type { IPacket } from '../PacketCore';
|
|
3
|
+
import { uiDatasSchema } from '../../schemas/UIDatas';
|
|
4
|
+
import type { UIDatasSchema } from '../../schemas/UIDatas';
|
|
5
|
+
import type { WorldTick } from '../PacketCore';
|
|
6
|
+
|
|
7
|
+
export type UIDatasPacket = IPacket<typeof PacketId.UI_DATAS, UIDatasSchema> & [WorldTick];
|
|
8
|
+
|
|
9
|
+
export const uiDatasPacketDefinition = definePacket(
|
|
10
|
+
PacketId.UI_DATAS,
|
|
11
|
+
uiDatasSchema,
|
|
12
|
+
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { JSONSchemaType } from 'ajv';
|
|
2
2
|
|
|
3
|
-
export type
|
|
3
|
+
export type UIDataSchema = {
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const uiDataSchema: JSONSchemaType<UIDataSchema> = {
|
|
8
8
|
type: 'object',
|
|
9
9
|
properties: {},
|
|
10
10
|
additionalProperties: true,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { uiDataSchema } from './UIData';
|
|
2
|
+
import type { JSONSchemaType } from 'ajv';
|
|
3
|
+
import type { UIDataSchema } from './UIData';
|
|
4
|
+
|
|
5
|
+
export type UIDatasSchema = UIDataSchema[];
|
|
6
|
+
|
|
7
|
+
export const uiDatasSchema: JSONSchemaType<UIDatasSchema> = {
|
|
8
|
+
type: 'array',
|
|
9
|
+
items: { ...uiDataSchema },
|
|
10
|
+
}
|
package/schemas/index.ts
CHANGED
|
@@ -23,8 +23,8 @@ export * from './StateRequest';
|
|
|
23
23
|
export * from './SyncRequest';
|
|
24
24
|
export * from './SyncResponse';
|
|
25
25
|
export * from './UI';
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
26
|
+
export * from './UIData';
|
|
27
|
+
export * from './UIDatas';
|
|
28
28
|
export * from './Vector';
|
|
29
29
|
export * from './VectorBoolean';
|
|
30
30
|
export * from './World';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { definePacket, PacketId } from '../PacketCore';
|
|
2
|
-
import type { IPacket } from '../PacketCore';
|
|
3
|
-
import { uiMessageSchema } from '../../schemas/UIMessage';
|
|
4
|
-
import type { UIMessageSchema } from '../../schemas/UIMessage';
|
|
5
|
-
|
|
6
|
-
export type UIMessageSendPacket = IPacket<typeof PacketId.UI_MESSAGE_SEND, UIMessageSchema>;
|
|
7
|
-
|
|
8
|
-
export const uiMessageSendPacketDefinition = definePacket(
|
|
9
|
-
PacketId.UI_MESSAGE_SEND,
|
|
10
|
-
uiMessageSchema
|
|
11
|
-
);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { definePacket, PacketId } from '../PacketCore';
|
|
2
|
-
import type { IPacket } from '../PacketCore';
|
|
3
|
-
import { uiMessagesSchema } from '../../schemas/UIMessages';
|
|
4
|
-
import type { UIMessagesSchema } from '../../schemas/UIMessages';
|
|
5
|
-
import type { WorldTick } from '../PacketCore';
|
|
6
|
-
|
|
7
|
-
export type UIMessagesPacket = IPacket<typeof PacketId.UI_MESSAGES, UIMessagesSchema> & [WorldTick];
|
|
8
|
-
|
|
9
|
-
export const uiMessagesPacketDefinition = definePacket(
|
|
10
|
-
PacketId.UI_MESSAGES,
|
|
11
|
-
uiMessagesSchema,
|
|
12
|
-
);
|
package/schemas/UIMessages.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { uiMessageSchema } from './UIMessage';
|
|
2
|
-
import type { JSONSchemaType } from 'ajv';
|
|
3
|
-
import type { UIMessageSchema } from './UIMessage';
|
|
4
|
-
|
|
5
|
-
export type UIMessagesSchema = UIMessageSchema[];
|
|
6
|
-
|
|
7
|
-
export const uiMessagesSchema: JSONSchemaType<UIMessagesSchema> = {
|
|
8
|
-
type: 'array',
|
|
9
|
-
items: { ...uiMessageSchema },
|
|
10
|
-
}
|