@hytopia.com/server-protocol 1.0.51 → 1.0.54
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/Simulation.ts +3 -1
- package/schemas/SyncResponse.ts +4 -4
package/package.json
CHANGED
package/schemas/Simulation.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type { VectorSchema } from './Vector';
|
|
|
4
4
|
|
|
5
5
|
export type SimulationSchema = {
|
|
6
6
|
wi: number; // world id
|
|
7
|
-
t?: number; //
|
|
7
|
+
t?: number; // timestep (seconds)
|
|
8
|
+
r?: number; // tick rate (ticks per second)
|
|
8
9
|
g?: VectorSchema; // gravity
|
|
9
10
|
};
|
|
10
11
|
|
|
@@ -13,6 +14,7 @@ export const simulationSchema: JSONSchemaType<SimulationSchema> = {
|
|
|
13
14
|
properties: {
|
|
14
15
|
wi: { type: 'number' },
|
|
15
16
|
t: { type: 'number', nullable: true },
|
|
17
|
+
r: { type: 'number', nullable: true },
|
|
16
18
|
g: { ...vectorSchema, nullable: true },
|
|
17
19
|
},
|
|
18
20
|
required: [ 'wi' ],
|
package/schemas/SyncResponse.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { JSONSchemaType } from 'ajv';
|
|
2
2
|
|
|
3
3
|
export type SyncResponseSchema = {
|
|
4
|
-
p: number; // high resolution of total processing time from request receipt to response
|
|
5
|
-
|
|
4
|
+
p: number; // high resolution ms of total processing time from request receipt to response
|
|
5
|
+
n: number; // high resolution ms at server response time until next server tick
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const syncResponseSchema: JSONSchemaType<SyncResponseSchema> = {
|
|
9
9
|
type: 'object',
|
|
10
10
|
properties: {
|
|
11
11
|
p: { type: 'number' },
|
|
12
|
-
|
|
12
|
+
n: { type: 'number' },
|
|
13
13
|
},
|
|
14
|
-
required: [ 'p', '
|
|
14
|
+
required: [ 'p', 'n' ],
|
|
15
15
|
additionalProperties: false,
|
|
16
16
|
}
|