https://gitlab.synchro.net/main/sbbs/-/commit/24c362fe8a6ab92ec5c7fefe
Modified Files:
xtrn/wordem/wordem.js
Log Message:
wordem: don't spin in the key loops after the user disconnects
The main menu loop and the two console.getkey() prompts had no
disconnect check, so a user whose connection dropped could leave the
door running long after they were gone. console.getkey() returns 0
immediately once the node is offline rather than blocking, so those
loops spun; the check has to live in the loop condition.
Add an offline() helper testing both bbs.online, which is cleared on
carrier loss, and js.terminated, which covers sysop shutdown/recycle but
is not set on an ordinary client disconnect. Consult it in all three
loops. The blank-letter prompt returns false before mutating any state, matching putLetter()'s existing early-exit paths; the trade prompt
breaks with an empty selection so the trade is skipped and the prompt
frame is still restored.
This is mitigation, not a cure. The underlying defect is that a script
blocked inside a native call never reaches the JS operation callback, so terminate_on_disconnect cannot abort it no matter what the script does.
See main/sbbs#1190.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net