You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove leftover debug printf leaking internal object path in xianlvqiyuan
adm/daemons/logind.lpc's get_name() had a leftover printf("%O\n", ob)
that printed the login object's raw internal path (e.g. /obj/login#2)
to every new player, between the Chinese-name prompt and the password
prompt. Confirmed live pre/post fix. Two unreferenced duplicate daemon
files carry the identical leftover line but are never loaded (LOGIN_D
points only at logind) -- left untouched per the dead-code convention.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VyQCUoTo1Z93Py9aVFHQi1
etc.) — final debug.log byte count is **identical** to the pre-session
225
+
baseline (`work/log/debug.log`, 31531 bytes, last real content from a
226
+
prior pass) through the entire test: registration ×many, sect join,
227
+
organic skill learning, a real fight, a shop purchase attempt, three
228
+
`quit`s, two unclean (net-dead) disconnects with both prompt and
229
+
delayed reconnect, and one clean-quit-then-wait-then-relogin — **zero
230
+
new lines**, i.e. zero runtime errors surfaced anywhere in this pass.
231
+
232
+
### Bug found and fixed: leftover debug `printf("%O", ob)` leaks the login object's internal path to every registering player
233
+
234
+
`adm/daemons/logind.lpc`'s `get_name()` (the Chinese-name step of new
235
+
registration) had `printf("%O\n", ob);` immediately after the
236
+
name-validation block and before `ob->set("name", arg)` — no comment,
237
+
serves no functional purpose, clearly a leftover debug statement from
238
+
development. `%O` on FluffOS renders an object's identity as its file
239
+
path plus clone index (`/obj/login#2`), so **every single new
240
+
registration** showed a raw internal object reference between the
241
+
Chinese-name prompt and the password prompt:
242
+
243
+
```
244
+
您的中文名字:/obj/login#2
245
+
请设定您的密码:
246
+
```
247
+
248
+
Confirmed live pre-fix (multiple registrations, e.g. id `shendep`/`沈德鹏`,
249
+
id `wuyao`/`吴垚`) and confirmed gone post-fix (id `yaoxinw`/`姚心薇`: the
250
+
Chinese-name prompt now falls straight through to the password prompt
251
+
with no stray line). This is a real, if minor, programming defect —
252
+
unintentional internal-state disclosure to every new player, not a
253
+
design choice (there is no explanatory comment, and every sibling
254
+
`get_*` step in the same file is otherwise clean of debug output).
255
+
256
+
Fix (`adm/daemons/logind.lpc:614`, in `get_name()`): deleted the line.
257
+
258
+
```lpc
259
+
// BEFORE
260
+
printf("%O\n", ob);
261
+
ob->set("name", arg);
262
+
// AFTER
263
+
ob->set("name", arg);
264
+
```
265
+
266
+
Two structurally-identical dead copies of the same daemon —
267
+
`adm/daemons/login.lpc:606` and `adm/daemons/loggind.lpc:564` (note the
268
+
double-g typo'd filename) — carry the exact same leftover `printf`, but
269
+
neither file is ever loaded (`LOGIN_D` in `include/globals.h` points
270
+
only at `/adm/daemons/logind`, and `grep -rn` confirms no code anywhere
271
+
references `/adm/daemons/login` or `/adm/daemons/loggind`). Left
272
+
untouched per AGENTS.md's dead-code convention — not on any live path.
273
+
274
+
**This doesn't match any existing AGENTS.md §7 bug class** (closest is
275
+
§7.10/§7.26, but those are about `log_error()`'s own ACL/attribution,
276
+
not a stray developer `write`/`printf` shipped into a live prompt
277
+
sequence). Draft class for AGENTS.md, offered in the session report
278
+
rather than committed here per task instructions.
279
+
280
+
### Root-caused, not fixed: the "default error message" noise is a real (but practically harmless) race between a 0-delay `call_out` and fast/scripted client input
281
+
282
+
This lib's NOTES.md (and sibling `xianlvqingyuanzheda`'s) already
283
+
documented an unexplained, non-deterministic appearance of the driver's
284
+
own `default error message` (`adm/etc/config.xiyou:126`, "你发现事情不
285
+
大对了,但是又说不上来。") during registration, with no fix attempted
286
+
because no deterministic trigger had been found. This pass pins the
287
+
exact mechanism:
288
+
289
+
`enter_world()` (`adm/daemons/logind.lpc`) moves a brand-new character
290
+
into `/d/wiz/init` (the gift-allocation room) synchronously. That
291
+
room's `init()` (`d/wiz/init.lpc`) does **not** register its
292
+
`input_to("get_input", ...)` synchronously — it schedules
293
+
`call_out("get_start0", 0, me)`, and only `get_start0()` (running on
294
+
the *next* server tick, not the same call stack) actually calls
295
+
`me->command("start")`, which is what ultimately shows the gift menu
296
+
and registers the real `input_to`. Between the room-entry text
297
+
finishing ("...局面进入请先help whatsnew。") and that call_out actually
298
+
firing, the player is briefly a normal command-dispatch target with
299
+
**no** matching `add_action` and **no** pending `input_to` — any input
300
+
arriving in that window is treated as an unrecognized ordinary command,
301
+
producing the driver's generic `default error message` fallback
302
+
instead of anything the room intended, and — if a script (not a human)
303
+
keeps firing more scripted input immediately afterward — misaligns
304
+
every subsequent scripted answer by one, cascading into a real
305
+
false-negative test failure (confirmed: a batch of `9`/`y`/`look`/etc.
306
+
sent at `--idle 0.4`–`0.6` reliably desyncs the whole gift-selection
307
+
exchange, while the identical batch at `--idle 3.0` never reproduces
308
+
it, 1-for-1 across repeated trials).
309
+
310
+
**Not fixed, and not proposed as a new AGENTS.md class**: this requires
311
+
input arriving inside a sub-second window immediately after the room's
312
+
banner text — no real human types that fast, and a human who *did* see
313
+
the stray "default error message" would simply see the real gift menu
314
+
appear a moment later and answer it normally (the call_out reliably
315
+
fires within well under a second even under this host's heavy
316
+
concurrent-agent load in every trial observed). The mechanism is now
317
+
understood and written down here so the next tester of this lib or its
318
+
XLQY-family siblings doesn't have to re-derive it, but per §10.7's
319
+
scope note this reads as a test-harness-timing artifact with no
320
+
demonstrated real-player impact, not a programming defect to change
321
+
code for.
322
+
323
+
### Sect join and organic skill learning — both verified live, no bugs
324
+
325
+
Followed the newbie doc's own path: `kezhan` (南城客栈, start) → `west`
326
+
→ `north` reaches 十字街头 (`d/city/center.lpc`), where 张果老
327
+
(`d/qujing/wuzhuang/npc/zhangguolao.lpc`, a 五庄观 sect teacher) stands
328
+
reachable in exactly 2 moves from spawn. `apprentice zhang` correctly
329
+
completed the kowtow flow and joined 五庄观 as its 4th generation
0 commit comments