problem: rskafka only fetches one record per topic

This commit is contained in:
Thilo Behnke
2022-07-10 14:59:56 +02:00
parent 8d3f9b540d
commit cf3d5db28e
3 changed files with 12 additions and 3 deletions
@@ -10,10 +10,19 @@
let state: GameState;
$: state = $gameStateEvents;
let lastTick;
$: if (networkTickEvents && $networkTickEvents.hasNext) {
const tick = networkTickEvents.next();
if (tick != null) {
gameField.update(tick.objects, state);
console.warn(`Received tick: ${tick.tick}`)
if (lastTick && lastTick.tick >= tick.tick) {
console.error(`???? DUPLICATED TICK: ${JSON.stringify(tick)} (vs ${lastTick.tick}) ????`)
} else {
console.warn(`!!!! Valid tick: ${JSON.stringify(tick)} !!!!`)
gameField.update(tick.objects, state);
lastTick = tick;
}
}
}
@@ -25,7 +25,7 @@ export type InputEventPayload = {
export type TickEventPayload = {
session_id: string,
objects: GameObject[],
ts: number
tick: number
}
export type StatusEventPayload = {