diablo2-web/tests/netproto
troytt 5882efc109 fix(netproto): detect BNCS/MCP/D2GS session loss centrally in D2OnlineFlow
D2OnlineFlow never subscribed to the BNCS/MCP socket close events and kept
stale session references, so a dropped realm connection only surfaced later as
"MCP realm session is not connected" on whatever screen issued the next
command.

The flow now watches every connection it opens and turns any unrequested
close/error, request timeout, connect failure or command without its
connection into exactly one onSessionLost event. Before emitting it tears down
all remaining connections (references cleared first so the resulting close
callbacks are not reported again), bumps an epoch so late-opening streams are
disposed, and enters `closed`. A BNCS/MCP loss during a game is reported when
the game ends. A failed D2GS join releases its D2GS session again. WsStream
forwards the WebSocket close reason.

Tests: in-memory BNCS/MCP/D2GS fake servers cover BNCS close on char select,
MCP close on char create, realm logon / MCP_STARTUP timeouts, both sockets
closing (one event), D2GS drop in game, deferred in-game BNCS loss and
close() without an event.

TAG=agy
CONV=109a3012-103a-42f0-8ae1-bbc0857047ef
2026-10-01 12:02:30 +00:00
..
boundary.test.ts refactor: split into isolated common/netproto/server/client/baker modules 2026-10-01 00:10:18 +00:00
core-crypto-bncs-mcp.test.ts feat(netproto,client): implement pure-browser D2 1.13c online client (N0-N10) 2026-09-30 04:41:08 +00:00
d2gs-codecs-items.test.ts fix(netproto): vendor/stash packet encodings per 1.13c disassembly 2026-10-01 09:45:14 +00:00
drop-gold.test.ts fix(client): neutral not-ready HUD state and server-authoritative HUD commands (P1/P2) 2026-10-01 01:41:13 +00:00
fake-realm-servers.ts fix(netproto): detect BNCS/MCP/D2GS session loss centrally in D2OnlineFlow 2026-10-01 12:02:30 +00:00
online-flow-session-lost.test.ts fix(netproto): detect BNCS/MCP/D2GS session loss centrally in D2OnlineFlow 2026-10-01 12:02:30 +00:00
vendor-stash-golden.test.ts fix(netproto): vendor/stash packet encodings per 1.13c disassembly 2026-10-01 09:45:14 +00:00