@hytopia.com/server-protocol 1.3.64 → 1.3.66

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.3.64",
3
+ "version": "1.3.66",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -43,6 +43,7 @@ export enum PacketId {
43
43
 
44
44
  // Standard Bi-Directional Packet Types: 116 - 127 range
45
45
  CONNECTION = 116,
46
+ HEARTBEAT = 117,
46
47
 
47
48
  // Debug Inbound Packet Types: 128 - 191 range
48
49
  DEBUG_CONFIG = 128,
@@ -0,0 +1,11 @@
1
+ import { definePacket, PacketId } from '../PacketCore';
2
+ import type { IPacket } from '../PacketCore';
3
+ import { heartbeatSchema } from '../../schemas/Heartbeat';
4
+ import type { HeartbeatSchema } from '../../schemas/Heartbeat';
5
+
6
+ export type HeartbeatPacket = IPacket<typeof PacketId.HEARTBEAT, HeartbeatSchema>;
7
+
8
+ export const heartbeatPacketDefinition = definePacket(
9
+ PacketId.HEARTBEAT,
10
+ heartbeatSchema
11
+ );
@@ -0,0 +1,8 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+
3
+ export type HeartbeatSchema = null;
4
+
5
+ export const heartbeatSchema: JSONSchemaType<HeartbeatSchema> = {
6
+ type: 'null',
7
+ nullable: true,
8
+ }
package/schemas/Input.ts CHANGED
@@ -30,7 +30,7 @@ export type InputSchema = {
30
30
  mr?: boolean; // mouse right pressed
31
31
  cp?: number; // camera pitch radians
32
32
  cy?: number; // camera yaw radians
33
- sn?: number; // sequence number for UDP inputs
33
+ sq?: number; // sequence number for UDP inputs
34
34
  }
35
35
 
36
36
  export const inputSchema: JSONSchemaType<InputSchema> = {
@@ -65,7 +65,7 @@ export const inputSchema: JSONSchemaType<InputSchema> = {
65
65
  mr: { type: 'boolean', nullable: true },
66
66
  cp: { type: 'number', nullable: true },
67
67
  cy: { type: 'number', nullable: true },
68
- sn: { type: 'number', nullable: true },
68
+ sq: { type: 'number', nullable: true },
69
69
  },
70
70
  additionalProperties: false,
71
71
  }
package/schemas/index.ts CHANGED
@@ -13,6 +13,7 @@ export * from './Connection';
13
13
  export * from './DebugConfig';
14
14
  export * from './Entity';
15
15
  export * from './Entities';
16
+ export * from './Heartbeat';
16
17
  export * from './HexColor';
17
18
  export * from './Input';
18
19
  export * from './Light';