add generic stateful input streaming
All checks were successful
build / image (push) Successful in 50s
All checks were successful
build / image (push) Successful in 50s
This commit is contained in:
@@ -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],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user