https://gitlab.synchro.net/main/sbbs/-/commit/efe0ca1a8daa662805da6425
Added Files:
xtrn/tests/game_lobby_test.js
Modified Files:
exec/load/game_lobby.js
Log Message:
game_lobby.js: let parse_duration() take a default unit
This lobby's parse_duration() reads a bare number as DAYS. xpdev's C parse_duration() -- which the doors reach through iniGetDuration() and iniReadDuration() -- reads a bare number as SECONDS. That divergence was harmless while the two never read the same key.
The idle-timeout work makes them read the same key: the door and its lobby
both consult [idle] timeout, so "timeout = 900" would mean 15 minutes to the door and 900 days to the lobby -- a silent disable of exactly the feature the setting exists to enable, and one that would look like configuration working.
parse_duration() therefore takes an optional default unit, applied only when the string carries no suffix. An explicit suffix still wins, in both directions. Omitted, the argument leaves the historical days default in place, so activity_max_age -- the only caller today, and lobby-only -- is unchanged. Duration keys shared with a door pass "s".
Covered by a new xtrn/tests/game_lobby_test.js: the preserved days default,
the seconds default, suffix-beats-default both ways, and the blank/invalid/ non-positive cases that mean "no limit". It sits beside xtrn_mirror_test.js rather than under exec/tests/, matching the convention set there.
Co-Authored-By: Claude Opus 4.8 (1M context) <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)