GMCP to Web Client

One step in the world rebuilds a map snapshot, filters it against the rooms this character has actually walked, and pushes it to the browser as a single GMCP payload

GMCP to Web Client One step in the world rebuilds a map snapshot, filters it against the rooms this character has actually walked, and pushes it to the browser as a single GMCP payload 01 / The move 02 / What the server knows 03 / The filter 04 / Transport 05 / The browser Player step · usercommands/go.go · 01 / The move · one command Player step usercommands/go.go one command VisitedRooms · zone to room ids · 02 / What the server knows · persistent VisitedRooms zone to room ids persistent RoomChange event · queued by rooms.MoveToRoom · 02 / What the server knows · per move RoomChange event queued by rooms.MoveToRoom per move Crawled zone graph · every room and exit · 02 / What the server knows · unfiltered Crawled zone graph every room and exit unfiltered Zone module · gmcp.Zone buildAndSend · 03 / The filter · one user Zone module gmcp.Zone buildAndSend one user Fog filter · mapper.Snapshot(visited) · 03 / The filter · server side Fog filter mapper.Snapshot(visited) server side Party positions · parties.Get, room ids only · 03 / The filter · no names Party positions parties.Get, room ids only no names Zone.Map push · GMCPOut, one JSON payload · 04 / Transport · GMCP Zone.Map push GMCPOut, one JSON payload GMCP RoomGridSVG · gmcp.js setZoneSnapshot · 05 / The browser · browser RoomGridSVG gmcp.js setZoneSnapshot browser Tooled leather map · nested pannable SVG surface · 05 / The browser · drawn Tooled leather map nested pannable SVG surface drawn mark visited template id only room change queued event a user moved not a mob move rooms walked all zones the visited set plus current room the whole graph rooms and exits visited rooms only the rest are cut party rooms only if grouped Zone.Map payload GMCP clients only place, then draw current floor Legend primary data policy / PII async batch data store data flow

One step, one snapshot

  • • A successful move records the room on the character and queues a RoomChange event
  • • The Zone module answers that event, so the map is rebuilt from scratch on every step
  • • A mob move raises the same event with no user id and is dropped before any work
  • • The current room is force added to the visited set, because the mark and the event race

What the fog filter actually does

  • • Snapshot iterates the crawled graph and skips any room id absent from the visited set
  • • Nothing about an unwalked room is built: no coordinates, no title, no biome, no tags
  • • Ephemeral instance rooms are skipped as well, so a dungeon copy id cannot leak out
  • • The filter runs before the payload exists, so the browser has nothing to filter
  • • The dimming you see in the client is distance shading only, not a second fog check

The honest edge of the fog

  • • An exit from a room you HAVE walked is still sent when its far side is unwalked
  • • That stub carries a direction, the destination room id, and the door flags on it
  • • It also carries the destination zone name when the exit crosses a zone boundary
  • • A secret exit you have not been through is not sent at all, exit or flag
  • • That gate matches GetLimitedMap, so the browser map discloses no more than ASCII

What the browser is given

  • • Zone name, the current floor, party room ids, and the surviving rooms with exits
  • • Party data is room ids only, self excluded, de duplicated, instance ids translated
  • • Rooms on other floors you have walked are sent, and the client draws one floor at a time
  • • Exit flags drive the stroke: locked, secret, one way, gate, vertical tick, biome road

Traced from source

  • • github.com/pruuk/DOGMud at beab5a6cd00cba83aaff1f6666211f700297d60a
  • • internal/mapper/mapper.snapshot.go lines 44 to 127, the fog filter and exit stubs
  • • modules/gmcp/gmcp.Zone.go lines 43 to 133, the event handler and the payload
  • • internal/usercommands/go.go line 320, internal/characters/character.go lines 609 and 644
  • • _datafiles/html/public/webclient-pure.html line 702, static/js/gmcp.js lines 434 and 914