@series-inc/rundot-syncplay 5.23.0-beta.7

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.
Files changed (264) hide show
  1. package/README.md +610 -0
  2. package/dist/animation.d.ts +119 -0
  3. package/dist/animation.js +488 -0
  4. package/dist/asset-cooking.d.ts +82 -0
  5. package/dist/asset-cooking.js +364 -0
  6. package/dist/authority-room.d.ts +217 -0
  7. package/dist/authority-room.js +701 -0
  8. package/dist/bot-documents.d.ts +115 -0
  9. package/dist/bot-documents.js +549 -0
  10. package/dist/bot-primitives.d.ts +152 -0
  11. package/dist/bot-primitives.js +472 -0
  12. package/dist/browser.d.ts +57 -0
  13. package/dist/browser.js +53 -0
  14. package/dist/canonical.d.ts +12 -0
  15. package/dist/canonical.js +288 -0
  16. package/dist/certification.d.ts +455 -0
  17. package/dist/certification.js +1855 -0
  18. package/dist/chaos-certification.d.ts +56 -0
  19. package/dist/chaos-certification.js +1397 -0
  20. package/dist/cjs/animation.js +495 -0
  21. package/dist/cjs/asset-cooking.js +372 -0
  22. package/dist/cjs/authority-room.js +704 -0
  23. package/dist/cjs/bot-documents.js +556 -0
  24. package/dist/cjs/bot-primitives.js +482 -0
  25. package/dist/cjs/browser.js +96 -0
  26. package/dist/cjs/canonical.js +299 -0
  27. package/dist/cjs/certification.js +1860 -0
  28. package/dist/cjs/chaos-certification.js +1402 -0
  29. package/dist/cjs/collections.js +36 -0
  30. package/dist/cjs/collision.js +96 -0
  31. package/dist/cjs/commands.js +987 -0
  32. package/dist/cjs/config-bundle.js +491 -0
  33. package/dist/cjs/creator.js +30 -0
  34. package/dist/cjs/deterministic-primitives.js +134 -0
  35. package/dist/cjs/deterministic-session.js +1410 -0
  36. package/dist/cjs/ecs-lite.js +155 -0
  37. package/dist/cjs/effects-adapter.js +97 -0
  38. package/dist/cjs/engine-complete.js +2297 -0
  39. package/dist/cjs/engine-core-proof.js +70 -0
  40. package/dist/cjs/engine-parity-matrix.js +874 -0
  41. package/dist/cjs/engine-parity.js +3183 -0
  42. package/dist/cjs/engine-runtime.js +3141 -0
  43. package/dist/cjs/errors.js +22 -0
  44. package/dist/cjs/events.js +247 -0
  45. package/dist/cjs/examples/counter-duel.js +157 -0
  46. package/dist/cjs/examples/fixed-arena.js +368 -0
  47. package/dist/cjs/index.js +229 -0
  48. package/dist/cjs/input-authority.js +150 -0
  49. package/dist/cjs/input-button.js +256 -0
  50. package/dist/cjs/input-timeline.js +418 -0
  51. package/dist/cjs/instant-replay.js +66 -0
  52. package/dist/cjs/lag-compensation3d.js +837 -0
  53. package/dist/cjs/local-authority-server-runner.js +1121 -0
  54. package/dist/cjs/local-authority-wire.js +1497 -0
  55. package/dist/cjs/local-authority.js +817 -0
  56. package/dist/cjs/local-ws-adapter.js +150 -0
  57. package/dist/cjs/match-log.js +61 -0
  58. package/dist/cjs/math.js +157 -0
  59. package/dist/cjs/mock-network-adapter.js +26 -0
  60. package/dist/cjs/movement.js +703 -0
  61. package/dist/cjs/movement3d.js +1246 -0
  62. package/dist/cjs/multiclient-authority.js +308 -0
  63. package/dist/cjs/multiplayer-service.js +434 -0
  64. package/dist/cjs/navigation.js +347 -0
  65. package/dist/cjs/navmesh.js +1437 -0
  66. package/dist/cjs/networked-client.js +691 -0
  67. package/dist/cjs/networked-input-authority.js +443 -0
  68. package/dist/cjs/node.js +47 -0
  69. package/dist/cjs/number-lab.js +78 -0
  70. package/dist/cjs/offline-session.js +370 -0
  71. package/dist/cjs/package.json +1 -0
  72. package/dist/cjs/pause-resume.js +43 -0
  73. package/dist/cjs/physics-cert.js +426 -0
  74. package/dist/cjs/physics2d.js +751 -0
  75. package/dist/cjs/physics3d.js +1996 -0
  76. package/dist/cjs/prediction-culling.js +203 -0
  77. package/dist/cjs/protocol-lab.js +1299 -0
  78. package/dist/cjs/r3f-render-adapter.js +209 -0
  79. package/dist/cjs/random.js +59 -0
  80. package/dist/cjs/replay-bundle.js +1598 -0
  81. package/dist/cjs/replay-inspect.js +236 -0
  82. package/dist/cjs/replay-scoring.js +68 -0
  83. package/dist/cjs/replay.js +356 -0
  84. package/dist/cjs/reports.js +181 -0
  85. package/dist/cjs/rollback-history.js +251 -0
  86. package/dist/cjs/runtime-guards.js +111 -0
  87. package/dist/cjs/sample-lab.js +145 -0
  88. package/dist/cjs/sample-scenes.js +752 -0
  89. package/dist/cjs/schema-artifacts.js +359 -0
  90. package/dist/cjs/schema-codegen.js +544 -0
  91. package/dist/cjs/schema-dsl-binary.js +655 -0
  92. package/dist/cjs/schema.js +319 -0
  93. package/dist/cjs/sdk-offline.js +99 -0
  94. package/dist/cjs/session-promotion.js +74 -0
  95. package/dist/cjs/session-snapshot.js +265 -0
  96. package/dist/cjs/session-wire.js +216 -0
  97. package/dist/cjs/signals.js +103 -0
  98. package/dist/cjs/sparse-set.js +169 -0
  99. package/dist/cjs/synctest.js +136 -0
  100. package/dist/cjs/system-lifecycle.js +286 -0
  101. package/dist/cjs/timers.js +61 -0
  102. package/dist/cjs/tools/static-checker.js +1468 -0
  103. package/dist/cjs/types.js +2 -0
  104. package/dist/cjs/venus-mp-budget.js +125 -0
  105. package/dist/cjs/ws-frame.js +255 -0
  106. package/dist/cli.d.ts +2 -0
  107. package/dist/cli.js +11379 -0
  108. package/dist/collections.d.ts +9 -0
  109. package/dist/collections.js +30 -0
  110. package/dist/collision.d.ts +25 -0
  111. package/dist/collision.js +85 -0
  112. package/dist/commands.d.ts +137 -0
  113. package/dist/commands.js +977 -0
  114. package/dist/config-bundle.d.ts +89 -0
  115. package/dist/config-bundle.js +483 -0
  116. package/dist/creator.d.ts +20 -0
  117. package/dist/creator.js +11 -0
  118. package/dist/deterministic-primitives.d.ts +59 -0
  119. package/dist/deterministic-primitives.js +126 -0
  120. package/dist/deterministic-session.d.ts +197 -0
  121. package/dist/deterministic-session.js +1401 -0
  122. package/dist/ecs-lite.d.ts +26 -0
  123. package/dist/ecs-lite.js +152 -0
  124. package/dist/effects-adapter.d.ts +21 -0
  125. package/dist/effects-adapter.js +94 -0
  126. package/dist/engine-complete.d.ts +45 -0
  127. package/dist/engine-complete.js +2292 -0
  128. package/dist/engine-core-proof.d.ts +26 -0
  129. package/dist/engine-core-proof.js +66 -0
  130. package/dist/engine-parity-matrix.d.ts +300 -0
  131. package/dist/engine-parity-matrix.js +869 -0
  132. package/dist/engine-parity.d.ts +74 -0
  133. package/dist/engine-parity.js +3178 -0
  134. package/dist/engine-runtime.d.ts +351 -0
  135. package/dist/engine-runtime.js +3123 -0
  136. package/dist/errors.d.ts +11 -0
  137. package/dist/errors.js +17 -0
  138. package/dist/events.d.ts +45 -0
  139. package/dist/events.js +242 -0
  140. package/dist/examples/counter-duel.d.ts +43 -0
  141. package/dist/examples/counter-duel.js +150 -0
  142. package/dist/examples/fixed-arena.d.ts +110 -0
  143. package/dist/examples/fixed-arena.js +356 -0
  144. package/dist/index.d.ts +101 -0
  145. package/dist/index.js +66 -0
  146. package/dist/input-authority.d.ts +82 -0
  147. package/dist/input-authority.js +147 -0
  148. package/dist/input-button.d.ts +36 -0
  149. package/dist/input-button.js +249 -0
  150. package/dist/input-timeline.d.ts +65 -0
  151. package/dist/input-timeline.js +412 -0
  152. package/dist/instant-replay.d.ts +59 -0
  153. package/dist/instant-replay.js +62 -0
  154. package/dist/lag-compensation3d.d.ts +146 -0
  155. package/dist/lag-compensation3d.js +827 -0
  156. package/dist/local-authority-server-runner.d.ts +79 -0
  157. package/dist/local-authority-server-runner.js +1118 -0
  158. package/dist/local-authority-wire.d.ts +142 -0
  159. package/dist/local-authority-wire.js +1477 -0
  160. package/dist/local-authority.d.ts +160 -0
  161. package/dist/local-authority.js +810 -0
  162. package/dist/local-ws-adapter.d.ts +14 -0
  163. package/dist/local-ws-adapter.js +146 -0
  164. package/dist/match-log.d.ts +74 -0
  165. package/dist/match-log.js +57 -0
  166. package/dist/math.d.ts +41 -0
  167. package/dist/math.js +154 -0
  168. package/dist/mock-network-adapter.d.ts +13 -0
  169. package/dist/mock-network-adapter.js +23 -0
  170. package/dist/movement.d.ts +155 -0
  171. package/dist/movement.js +694 -0
  172. package/dist/movement3d.d.ts +195 -0
  173. package/dist/movement3d.js +1238 -0
  174. package/dist/multiclient-authority.d.ts +30 -0
  175. package/dist/multiclient-authority.js +305 -0
  176. package/dist/multiplayer-service.d.ts +153 -0
  177. package/dist/multiplayer-service.js +429 -0
  178. package/dist/navigation.d.ts +91 -0
  179. package/dist/navigation.js +338 -0
  180. package/dist/navmesh.d.ts +236 -0
  181. package/dist/navmesh.js +1423 -0
  182. package/dist/networked-client.d.ts +124 -0
  183. package/dist/networked-client.js +688 -0
  184. package/dist/networked-input-authority.d.ts +51 -0
  185. package/dist/networked-input-authority.js +439 -0
  186. package/dist/node.d.ts +22 -0
  187. package/dist/node.js +19 -0
  188. package/dist/number-lab.d.ts +15 -0
  189. package/dist/number-lab.js +75 -0
  190. package/dist/offline-session.d.ts +2 -0
  191. package/dist/offline-session.js +367 -0
  192. package/dist/pause-resume.d.ts +48 -0
  193. package/dist/pause-resume.js +40 -0
  194. package/dist/physics-cert.d.ts +40 -0
  195. package/dist/physics-cert.js +389 -0
  196. package/dist/physics2d.d.ts +142 -0
  197. package/dist/physics2d.js +741 -0
  198. package/dist/physics3d.d.ts +285 -0
  199. package/dist/physics3d.js +1979 -0
  200. package/dist/prediction-culling.d.ts +34 -0
  201. package/dist/prediction-culling.js +200 -0
  202. package/dist/protocol-lab.d.ts +115 -0
  203. package/dist/protocol-lab.js +1295 -0
  204. package/dist/r3f-render-adapter.d.ts +61 -0
  205. package/dist/r3f-render-adapter.js +203 -0
  206. package/dist/random.d.ts +13 -0
  207. package/dist/random.js +55 -0
  208. package/dist/replay-bundle.d.ts +150 -0
  209. package/dist/replay-bundle.js +1586 -0
  210. package/dist/replay-inspect.d.ts +60 -0
  211. package/dist/replay-inspect.js +228 -0
  212. package/dist/replay-scoring.d.ts +28 -0
  213. package/dist/replay-scoring.js +65 -0
  214. package/dist/replay.d.ts +17 -0
  215. package/dist/replay.js +351 -0
  216. package/dist/reports.d.ts +176 -0
  217. package/dist/reports.js +174 -0
  218. package/dist/rollback-history.d.ts +46 -0
  219. package/dist/rollback-history.js +247 -0
  220. package/dist/runtime-guards.d.ts +1 -0
  221. package/dist/runtime-guards.js +108 -0
  222. package/dist/sample-lab.d.ts +32 -0
  223. package/dist/sample-lab.js +134 -0
  224. package/dist/sample-scenes.d.ts +86 -0
  225. package/dist/sample-scenes.js +745 -0
  226. package/dist/schema-artifacts.d.ts +49 -0
  227. package/dist/schema-artifacts.js +356 -0
  228. package/dist/schema-codegen.d.ts +21 -0
  229. package/dist/schema-codegen.js +538 -0
  230. package/dist/schema-dsl-binary.d.ts +75 -0
  231. package/dist/schema-dsl-binary.js +648 -0
  232. package/dist/schema.d.ts +87 -0
  233. package/dist/schema.js +315 -0
  234. package/dist/sdk-offline.d.ts +34 -0
  235. package/dist/sdk-offline.js +96 -0
  236. package/dist/session-promotion.d.ts +26 -0
  237. package/dist/session-promotion.js +70 -0
  238. package/dist/session-snapshot.d.ts +95 -0
  239. package/dist/session-snapshot.js +255 -0
  240. package/dist/session-wire.d.ts +89 -0
  241. package/dist/session-wire.js +211 -0
  242. package/dist/signals.d.ts +31 -0
  243. package/dist/signals.js +99 -0
  244. package/dist/sparse-set.d.ts +34 -0
  245. package/dist/sparse-set.js +165 -0
  246. package/dist/synctest.d.ts +31 -0
  247. package/dist/synctest.js +133 -0
  248. package/dist/system-lifecycle.d.ts +72 -0
  249. package/dist/system-lifecycle.js +281 -0
  250. package/dist/timers.d.ts +17 -0
  251. package/dist/timers.js +53 -0
  252. package/dist/tools/index.d.ts +4 -0
  253. package/dist/tools/index.js +4 -0
  254. package/dist/tools/static-checker.d.ts +31 -0
  255. package/dist/tools/static-checker.js +1462 -0
  256. package/dist/tools/vite-plugin.d.ts +69 -0
  257. package/dist/tools/vite-plugin.js +203 -0
  258. package/dist/types.d.ts +148 -0
  259. package/dist/types.js +1 -0
  260. package/dist/venus-mp-budget.d.ts +29 -0
  261. package/dist/venus-mp-budget.js +122 -0
  262. package/dist/ws-frame.d.ts +49 -0
  263. package/dist/ws-frame.js +247 -0
  264. package/package.json +169 -0
@@ -0,0 +1,126 @@
1
+ import { canonicalStringify, defaultChecksum } from './canonical.js';
2
+ const defaultMaterial = {
3
+ friction: 0,
4
+ restitution: 0,
5
+ };
6
+ export function detectVerticalCcdHit(startX, endX, wallX) {
7
+ assertInteger(startX, 'startX');
8
+ assertInteger(endX, 'endX');
9
+ assertInteger(wallX, 'wallX');
10
+ return Math.min(startX, endX) <= wallX && Math.max(startX, endX) >= wallX;
11
+ }
12
+ export function combineDeterministicPhysicsMaterial(left, right) {
13
+ assertInteger(left.friction, 'left.friction');
14
+ assertInteger(right.friction, 'right.friction');
15
+ assertInteger(left.restitution, 'left.restitution');
16
+ assertInteger(right.restitution, 'right.restitution');
17
+ return {
18
+ friction: Math.floor((left.friction + right.friction) / 2),
19
+ restitution: Math.max(left.restitution, right.restitution),
20
+ };
21
+ }
22
+ export function cookStaticColliders(colliders) {
23
+ const ids = new Set();
24
+ const cooked = colliders.map((collider) => {
25
+ if (ids.has(collider.id)) {
26
+ throw new Error(`Duplicate static collider id ${collider.id}`);
27
+ }
28
+ ids.add(collider.id);
29
+ assertInteger(collider.x, `${collider.id}.x`);
30
+ assertInteger(collider.y, `${collider.id}.y`);
31
+ assertInteger(collider.halfWidth, `${collider.id}.halfWidth`);
32
+ assertInteger(collider.halfHeight, `${collider.id}.halfHeight`);
33
+ return {
34
+ id: collider.id,
35
+ x: collider.x,
36
+ y: collider.y,
37
+ halfWidth: collider.halfWidth,
38
+ halfHeight: collider.halfHeight,
39
+ material: collider.material ?? defaultMaterial,
40
+ };
41
+ }).sort((left, right) => compareUniqueStrings(left.id, right.id));
42
+ const bytes = canonicalStringify(cooked);
43
+ return {
44
+ schemaVersion: 1,
45
+ hash: defaultChecksum(cooked),
46
+ bytes,
47
+ colliders: cooked,
48
+ };
49
+ }
50
+ function compareUniqueStrings(left, right) {
51
+ return left < right ? -1 : 1;
52
+ }
53
+ export function stepTopDownBody(body, input, bounds) {
54
+ assertInteger(input.dx, 'input.dx');
55
+ const dy = input.dy ?? 0;
56
+ assertInteger(dy, 'input.dy');
57
+ let x = body.x + input.dx;
58
+ let y = body.y + dy;
59
+ let vx = input.dx;
60
+ let vy = dy;
61
+ if (x < bounds.minX || x > bounds.maxX) {
62
+ x = clamp(x, bounds.minX, bounds.maxX);
63
+ vx = 0;
64
+ }
65
+ if (y < bounds.minY || y > bounds.maxY) {
66
+ y = clamp(y, bounds.minY, bounds.maxY);
67
+ vy = 0;
68
+ }
69
+ return {
70
+ x,
71
+ y,
72
+ vx,
73
+ vy,
74
+ grounded: body.grounded,
75
+ };
76
+ }
77
+ export function stepKccLiteBody(body, input) {
78
+ assertInteger(input.dx, 'input.dx');
79
+ let x = body.x + input.dx;
80
+ let y = body.y + body.vy;
81
+ let vy = body.vy - 1;
82
+ if (input.jump === true && body.grounded) {
83
+ vy = 7;
84
+ y += 1;
85
+ }
86
+ if (x > 24) {
87
+ x = 24;
88
+ }
89
+ if (x < -24) {
90
+ x = -24;
91
+ }
92
+ if (y <= 0) {
93
+ y = 0;
94
+ vy = 0;
95
+ }
96
+ return {
97
+ x,
98
+ y,
99
+ vx: input.dx,
100
+ vy,
101
+ grounded: y === 0,
102
+ };
103
+ }
104
+ export function quantizeFpsAim(previous, input) {
105
+ assertInteger(input.yawDelta, 'input.yawDelta');
106
+ assertInteger(input.pitchDelta, 'input.pitchDelta');
107
+ const yaw = positiveModulo(previous.yaw + input.yawDelta, 360);
108
+ const pitch = clamp(previous.pitch + input.pitchDelta, -89, 89);
109
+ return {
110
+ yaw,
111
+ pitch,
112
+ originX: previous.originX,
113
+ originY: previous.originY,
114
+ };
115
+ }
116
+ function clamp(value, min, max) {
117
+ return Math.max(min, Math.min(max, value));
118
+ }
119
+ function positiveModulo(value, modulus) {
120
+ return ((value % modulus) + modulus) % modulus;
121
+ }
122
+ function assertInteger(value, name) {
123
+ if (!Number.isInteger(value)) {
124
+ throw new Error(`${name} must be an integer`);
125
+ }
126
+ }
@@ -0,0 +1,197 @@
1
+ import { type CanonicalValue } from './canonical.js';
2
+ import { type DeterministicPayloadFieldDescriptor, type DeterministicCommandChannelDescriptor, type DeterministicPlayerCommand, type DeterministicRejectedCommand } from './commands.js';
3
+ import { type DeterministicComponentData, type DeterministicFrameRuntimeDescriptor, type DeterministicFrameSnapshot, type DeterministicSystem } from './engine-runtime.js';
4
+ export type DeterministicSessionInputFlag = 'repeatable' | 'player-not-present' | 'replaced-by-server' | 'command';
5
+ export interface DeterministicSessionInput {
6
+ readonly frame: number;
7
+ readonly slot: number;
8
+ readonly value: number;
9
+ readonly data?: CanonicalValue;
10
+ readonly flags?: readonly DeterministicSessionInputFlag[];
11
+ }
12
+ export interface DeterministicSessionPlayer {
13
+ readonly slot: number;
14
+ readonly actorId: string;
15
+ readonly active: boolean;
16
+ readonly spectator: boolean;
17
+ readonly joinedFrame: number;
18
+ readonly removedFrame?: number;
19
+ }
20
+ export interface DeterministicSessionLifecycleEvent {
21
+ readonly frame: number;
22
+ readonly type: 'join-spectator' | 'add-player' | 'remove-player';
23
+ readonly slot: number;
24
+ readonly actorId: string;
25
+ readonly accepted: boolean;
26
+ readonly reason?: string;
27
+ }
28
+ export interface DeterministicSessionOptions {
29
+ readonly players: number;
30
+ readonly descriptor: DeterministicFrameRuntimeDescriptor;
31
+ readonly systems: Readonly<Record<string, DeterministicSystem>>;
32
+ readonly seed?: number;
33
+ readonly inputSingletonId?: string;
34
+ readonly mapInputsToSingleton?: (frame: number, inputs: readonly DeterministicSessionInput[], players: readonly DeterministicSessionPlayer[], commands: readonly DeterministicPlayerCommand[]) => DeterministicComponentData;
35
+ readonly commandChannels?: readonly DeterministicCommandChannelDescriptor[];
36
+ readonly validCommandAssetRefs?: readonly string[];
37
+ readonly validateCommandPayload?: (command: DeterministicPlayerCommand) => boolean;
38
+ readonly inputDataFields?: readonly DeterministicPayloadFieldDescriptor[];
39
+ readonly reconnectGraceFrames?: number;
40
+ }
41
+ export interface DeterministicSessionSnapshot {
42
+ readonly verifiedFrame: DeterministicFrameSnapshot;
43
+ readonly predictedFrame: DeterministicFrameSnapshot;
44
+ readonly predictedPreviousFrame?: DeterministicFrameSnapshot;
45
+ readonly players: readonly DeterministicSessionPlayer[];
46
+ readonly confirmedInputs: readonly DeterministicSessionInput[];
47
+ readonly predictedInputs: readonly DeterministicSessionInput[];
48
+ readonly replacementInputs: readonly DeterministicSessionInput[];
49
+ readonly confirmedCommands: readonly DeterministicPlayerCommand[];
50
+ readonly predictedCommands: readonly DeterministicPlayerCommand[];
51
+ readonly rejectedCommands: readonly DeterministicRejectedCommand[];
52
+ readonly lifecycleEvents: readonly DeterministicSessionLifecycleEvent[];
53
+ readonly correctionCount: number;
54
+ readonly replacementInputCount: number;
55
+ readonly checksum: string;
56
+ }
57
+ export interface DeterministicSessionReplayBundle {
58
+ readonly schemaVersion: 1;
59
+ readonly descriptorHash: string;
60
+ readonly runtimeVersion: string;
61
+ readonly players: number;
62
+ readonly seed: number;
63
+ readonly inputSingletonId: string;
64
+ readonly confirmedInputs: readonly DeterministicSessionInput[];
65
+ readonly replacementInputs: readonly DeterministicSessionInput[];
66
+ readonly confirmedCommands: readonly DeterministicPlayerCommand[];
67
+ readonly lifecycleEvents: readonly DeterministicSessionLifecycleEvent[];
68
+ readonly verifiedChecksums: readonly {
69
+ readonly frame: number;
70
+ readonly checksum: string;
71
+ }[];
72
+ readonly finalVerifiedChecksum: string;
73
+ readonly checksum: string;
74
+ }
75
+ export interface DeterministicSessionReplayVerification {
76
+ readonly result: 'pass' | 'fail';
77
+ readonly replayChecksum: string;
78
+ readonly expectedChecksum: string;
79
+ readonly actualChecksum: string;
80
+ readonly verifiedFrames: number;
81
+ readonly firstMismatchFrame: number;
82
+ }
83
+ export interface DeterministicSessionCore {
84
+ readonly players: readonly DeterministicSessionPlayer[];
85
+ readonly frameVerified: DeterministicFrameSnapshot;
86
+ readonly framePredicted: DeterministicFrameSnapshot;
87
+ readonly framePredictedPrevious: DeterministicFrameSnapshot | undefined;
88
+ readonly correctionCount: number;
89
+ readonly replacementInputCount: number;
90
+ joinAsSpectator(slot: number, actorId: string, frame?: number): DeterministicSessionLifecycleEvent;
91
+ addPlayer(slot: number, actorId: string, frame?: number): DeterministicSessionLifecycleEvent;
92
+ removePlayer(slot: number, actorId: string, frame?: number): DeterministicSessionLifecycleEvent;
93
+ submitPredictedInput(input: DeterministicSessionInput): void;
94
+ confirmInput(input: DeterministicSessionInput): void;
95
+ replaceInput(input: DeterministicSessionInput): void;
96
+ submitPredictedCommand(command: DeterministicPlayerCommand): DeterministicRejectedCommand | undefined;
97
+ confirmCommand(command: DeterministicPlayerCommand): DeterministicRejectedCommand | undefined;
98
+ pollCommands(frame: number, slot?: number, channelId?: string): readonly DeterministicPlayerCommand[];
99
+ predictTo(frameExclusive: number): void;
100
+ advanceVerifiedTo(frameExclusive: number): void;
101
+ applyCorrection(snapshot: DeterministicFrameSnapshot): boolean;
102
+ isFrameVerified(frame: number): boolean;
103
+ getInputFlags(frame: number, slot: number): readonly DeterministicSessionInputFlag[];
104
+ snapshot(): DeterministicSessionSnapshot;
105
+ exportReplay(): DeterministicSessionReplayBundle;
106
+ }
107
+ export interface DeterministicSessionCoreFixtureResult {
108
+ readonly checksum: string;
109
+ readonly players: number;
110
+ readonly frames: number;
111
+ readonly verifiedFrame: number;
112
+ readonly predictedFrame: number;
113
+ readonly verifiedChecksum: string;
114
+ readonly predictedChecksum: string;
115
+ readonly replayChecksum: string;
116
+ readonly replayVerified: boolean;
117
+ readonly replayFirstMismatchFrame: number;
118
+ readonly correctionCount: number;
119
+ readonly staleCorrectionsRejected: number;
120
+ readonly replacementInputs: number;
121
+ readonly repeatableInputs: number;
122
+ readonly playerNotPresentInputs: number;
123
+ readonly serverReplacedInputs: number;
124
+ readonly commandFlagInputs: number;
125
+ readonly predictedCommands: number;
126
+ readonly confirmedCommands: number;
127
+ readonly rejectedCommands: number;
128
+ readonly commandReplayVerified: boolean;
129
+ readonly commandSystemPolls: number;
130
+ readonly lifecycleEvents: number;
131
+ readonly addPlayerAccepted: number;
132
+ readonly removePlayerAccepted: number;
133
+ readonly duplicateAddRejected: number;
134
+ readonly removedSlotInputRejected: number;
135
+ readonly partialConfirmationHeldVerifiedFrame: boolean;
136
+ readonly predictedPreviousAvailable: boolean;
137
+ readonly frameRingExposed: boolean;
138
+ readonly fullRuntimeReplayExecuted: boolean;
139
+ }
140
+ export interface DeterministicStructuredSessionInputFixtureResult {
141
+ readonly checksum: string;
142
+ readonly replayVerified: boolean;
143
+ readonly predictedFallbackPreservedData: boolean;
144
+ readonly structuredInputs: number;
145
+ readonly rejectedNondeterministicPayload: boolean;
146
+ readonly rejectedSchemaPayloads: number;
147
+ readonly axisTotal: number;
148
+ readonly fireTotal: number;
149
+ }
150
+ export interface DeterministicSessionAuthorityFixtureResult {
151
+ readonly checksum: string;
152
+ readonly players: number;
153
+ readonly frames: number;
154
+ readonly authorityFrame: number;
155
+ readonly predictedFrame: number;
156
+ readonly convergence: boolean;
157
+ readonly replayVerified: boolean;
158
+ readonly predictedInputs: number;
159
+ readonly confirmedInputs: number;
160
+ readonly replacementInputs: number;
161
+ readonly predictedCommands: number;
162
+ readonly confirmedCommands: number;
163
+ readonly reconnects: number;
164
+ readonly lateJoins: number;
165
+ readonly spectators: number;
166
+ readonly rejectedMessages: number;
167
+ readonly correctionApplied: boolean;
168
+ readonly lateJoinReconstructed: boolean;
169
+ readonly spectatorReconstructed: boolean;
170
+ readonly inputDelayP95: number;
171
+ readonly rollbackDepthP95: number;
172
+ }
173
+ export interface DeterministicSessionLifecycleProtocolFixtureResult {
174
+ readonly checksum: string;
175
+ readonly startRequests: number;
176
+ readonly simulationStarts: number;
177
+ readonly spectatorJoinsAccepted: number;
178
+ readonly addPlayerAccepted: number;
179
+ readonly addPlayerFailed: number;
180
+ readonly duplicateAddRejected: number;
181
+ readonly spectatorInputRejected: number;
182
+ readonly spectatorCommandRejected: number;
183
+ readonly sameActorReconnectAccepted: number;
184
+ readonly differentActorReconnectRejected: number;
185
+ readonly expiredReconnectRejected: number;
186
+ readonly removePlayerAccepted: number;
187
+ readonly replayVerified: boolean;
188
+ readonly verifiedFrame: number;
189
+ readonly finalChecksum: string;
190
+ }
191
+ export declare function createDeterministicSessionCore(options: DeterministicSessionOptions): DeterministicSessionCore;
192
+ export declare function createDeterministicSessionReplayBundle(bundle: Omit<DeterministicSessionReplayBundle, 'schemaVersion' | 'checksum'>): DeterministicSessionReplayBundle;
193
+ export declare function verifyDeterministicSessionRuntimeReplay(bundle: DeterministicSessionReplayBundle, options: DeterministicSessionOptions): DeterministicSessionReplayVerification;
194
+ export declare function runDeterministicSessionCoreFixture(players: number, frames: number, seed: number): DeterministicSessionCoreFixtureResult;
195
+ export declare function runDeterministicStructuredSessionInputFixture(): DeterministicStructuredSessionInputFixtureResult;
196
+ export declare function runDeterministicSessionAuthorityFixture(players: number, frames: number, seed: number): DeterministicSessionAuthorityFixtureResult;
197
+ export declare function runDeterministicSessionLifecycleProtocolFixture(): DeterministicSessionLifecycleProtocolFixtureResult;