https://gitlab.synchro.net/main/sbbs/-/commit/4e683c8c37ff7bc25e991273
Added Files:
src/doors/syncduke/tests/test_map_name.c
Modified Files:
src/doors/syncduke/syncduke.h syncduke_events.c syncduke_game.c
Log Message:
syncduke: name levels by the CON's level name, not "E#L#"
The activity feed and the who's-online status both identified a level by
its episode/level code ("Digital Man died on E3L1"), when the engine has
had the real name all along: gamedef.c fills level_names[] from the CON's definelevelname directives, so E3L1 is "RAW MEAT". Report that instead --
and because it comes from the CON rather than a table of our own, an
add-on GRP or a custom CON names its levels for free.
Consolidate the naming in syncduke_map_name() (syncduke_game.c) so the
feed and the node status can't drift. A -map user map keeps its old name
(the file's basename, ".map" stripped): its level slot is always 7, so
neither level_names[] nor "E1L8" would mean anything for it. A slot the
CON never defined still falls back to the E#L# code.
The stored name needs trimming: on the PLATFORM_UNIX path the CON parser
copies up to the newline, so a CRLF CON -- which every stock GRP is --
leaves a trailing carriage return on the name. Unstripped it would land
in node.exb and in the JSON of every event line.
The node status gains a colon ("playing SyncDuke (Nukem 3D): RAW MEAT");
the two words ran together without one.
tests/test_map_name.c links the real syncduke_game.c against stubs of the engine globals it reads and covers a CRLF name, a bare name, an undefined
slot, an out-of-range slot and a user map. Also verified end to end by
driving the door binary into gameplay headless, where the engine's own
table reads "HOLLYWOOD HOLOCAUST\r".
Note this diverges from SyncDOOM, which still reports E1M1/MAP07: DOOM
keeps its level names in a source string table, not in the WAD.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net