https://gitlab.synchro.net/main/sbbs/-/commit/e79b7e95b76d02e5eb516ef0
Modified Files:
docs/v322_new.md exec/load/dorkit.js src/sbbs3/exec.cpp xtrn/gttrivia/gttrivia.js
Log Message:
Scope a script's js.auto_terminate/terminate_on_disconnect change to itself
sbbs_t::js_callback is one struct per node, shared by every script that js_execfile() runs during the session. dorkit.js (since 5a4e103ff3d, and terminate_on_disconnect since fc82a6d9116) clears both flags at load and
only sets them again in its own disconnect-timeout path, so after a normal
exit from a dorkit door (e.g. LORD) every later script on the node ran with
the disconnect abort and the recycle abort disabled.
Seen on vert: a caller played LORD, then Good Time Trivia, then dropped the connection. The node stayed "in use" for 20+ hours, its thread rereading
the trivia question files in a loop, ignoring the disconnect; only the JavaScriptTimeLimit counter would eventually have ended it.
- js_execfile() saves the two flags before executing a script and restores
them afterward, so a script's change can't leak into the next one.
- dorkit.js restores the caller's values via js.on_exit() as well.
- gttrivia.js: console.getkeys() returns a number (not a string) on abort
or when the caller is offline; doMainMenu() converted that to "0" and
fell through to its ACTION_PLAY default forever. Treat a non-string or
empty result, or an offline caller, as Quit.
Co-Authored-By: Claude Fable 5.1 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net