diablo2-web/src
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
..
baker data(tbl): pack 1.13c index-only Battle.net connection-loss strings 2026-10-01 12:02:30 +00:00
client Merge branch 'fix/issue-539-spawn' (#539) 2026-10-01 11:25:14 +00:00
common data(tbl): pack 1.13c index-only Battle.net connection-loss strings 2026-10-01 12:02:30 +00:00
netproto fix(netproto): detect BNCS/MCP/D2GS session loss centrally in D2OnlineFlow 2026-10-01 12:02:30 +00:00
server refactor: split into isolated common/netproto/server/client/baker modules 2026-10-01 00:10:18 +00:00