Fix '/kafkatorio chunks' not sending most chunks
- EventDataQueue.enqueue: `key ! in storage.store` parses as a non-null
assertion followed by `in`, so the check was inverted: a key was only
queued if it was already in the store. A first enqueue stored the
event but never queued it, so it was never sent.
- The chunks command keyed the queue with `${surface}${x}${y}`, so
different chunks collided (e.g. surface 1, (1,12) and (11,2) both
became "1112"). Separate the parts with '_'.
Saves that ran the broken version keep orphaned queue entries; run
`/kafkatorio init_global` once to clear them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6cb070fa63
commit
da9751c089
2 changed files with 2 additions and 2 deletions
|
|
@ -60,7 +60,7 @@ commands.add_command(
|
|||
}
|
||||
|
||||
EventDataQueue.enqueue(
|
||||
`${surface.index}${chunk.x}${chunk.y}`,
|
||||
`${surface.index}_${chunk.x}_${chunk.y}`,
|
||||
data,
|
||||
50
|
||||
)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export class EventDataQueueManager {
|
|||
|
||||
|
||||
enqueue(key: string, event: EventData, weight: int = 1) {
|
||||
if (key ! in storage.store) {
|
||||
if (storage.store[key] == undefined) {
|
||||
let node = new Node(key, weight)
|
||||
if (storage.head == null) {
|
||||
storage.head = node
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue