add generic stateful input streaming
All checks were successful
build / image (push) Successful in 50s

This commit is contained in:
Syncer Deploy
2026-08-28 11:27:53 -03:00
parent 0bf2b95755
commit 96b73922cc
15 changed files with 767 additions and 81 deletions

View File

@@ -877,6 +877,7 @@ function createSeededEngine<
client: game.client,
replication: game.replication,
validateInput: game.validateInput,
...(game.inputStream ? { inputStream: game.inputStream } : {}),
codecs: game.codecs,
};
return new NetworkedAuthoritativeEngine(definition, serverOptions);
@@ -969,6 +970,15 @@ function cloneSimulationCheckpoint<
playerId,
packet: cloneInputPacket(game, packet),
})),
inputStreamStates: checkpoint.inputStreamStates.map((stream) => ({
...stream,
clientInput: game.codecs.input.decode(
game.codecs.input.encode(stream.clientInput),
),
appliedInput: game.codecs.input.decode(
game.codecs.input.encode(stream.appliedInput),
),
})),
pendingEvents: [...checkpoint.pendingEvents],
};
}