A zone's position is sent to people who cannot see it #25
commented
Done in #27 (merged 2026-09); closing — that merge predates closing-on-merge.
commented
The fix and the generic test are both already on main, so I made no changes and pushed nothing.
- Filter:
src/arena.ts:163sends a zone only if the viewer is inside it (<= z.r + PLAYER_R) or no wall sits between them (wallBetween). It does not usesightBlocked. - Generic test:
src/server.test.ts:162stringifies the whole snapshot and checks that no id or coordinate of a body the viewer can't see appears in it. - Suite: all 298 tests pass on this branch.
I did not check the issue's other three asks: the in-smoke and behind-a-wall tests, the snapshot byte counts, and whether any other snapshot field carries an unfiltered position.
defe010, the commit that made the change, is already contained in main. This branch has no commits ahead of main. The branch is also behind main: its diff against main shows otel and README changes that main has and the branch lacks, not work of mine.
Sign in to join this conversation.
This is a third leak of the same kind we have now fixed twice, and it is still live. I proved it before filing; you do not need to reproduce it, but your fix has to make this test fail first and pass after.
The hole.
snapshotShapeinsrc/arena.tsfilters BODIES throughvisible(), and sendszonesfiltered only by whether a trip is yours:So every smoke, wall, molly and flash position reaches every player regardless of line of sight. Measured, with a smoke placed on an enemy standing behind a wall from me:
Abilities land at or near where the thrower stands — a molly at their feet, a wall under them — so a client reading
zoneshas a partial position oracle on people it cannot see. Same shape as the shot leak we just fixed in the forge's game template: a non-body field carrying a position, unfiltered, because the arena filters bodies and hands the game hook the whole state.The rule to apply. A zone goes out when the viewer could actually know it is there:
distance <= z.r + BODY_R) — otherwise standing in your own smoke makes it vanish, and notesightBlockedcounts zones, so do NOT filter withsightBlocked; andwallBetween), which is the same test the shot filter uses.Get this wrong in the other direction and a smoke you are standing in disappears, which is worse than the leak. Both cases need a test.
What I want back.
orbsare fixed map furniture and fine;spike.x/yis already gated on planted-or-attacker;board,feedandeventscarry names, not places. I believe that list is complete — check me.Do not touch
src/engine/. If the honest fix needs something from the engine, say so in the pull and pass it in instead.