- server.py / main.py no longer reference fake_room at all (no import,
no --fake-room flag, no _apply_fake_room)
- Routing decision happens at connect time in DanmakuClient.start():
room_id == 1 dynamically imports fake_room.py and patches blivedm;
any other room id returns immediately without touching fake_room
- Switching back from room 1 to another room unpatches to real Bilibili
- Production (packaged, no fake_room.py) is completely unaffected for
normal room ids; room 1 without fake_room.py raises a clear error
- Rebuild portable zip (83.9 MB)
- When room_id == 1, server/main automatically patch blivedm to connect
to fake_room.py on 127.0.0.1:8081 (bot web UI port + 1)
- Any other room id restores real Bilibili (unpatch)
- fake_room.py (gitignored, not packaged): headless fake live room with
bilibili-compatible init APIs (/x/web-interface/nav, /room/v1/Room/get_info,
/xlive/web-room/v1/index/getDanmuInfo) and WS /sub protocol (AUTH/HEARTBEAT/
SEND_MSG_REPLY), plus stdin/HTTP /emit control for danmaku/gift/blind box/
guard/super chat/enter/follow
- Verified end-to-end: all events flow through blivedm and render rules
(gift -> 感谢由Baka投喂的小电视, blind box, guard, super chat, custom
danmaku template, enter room)
- _on_danmaku renders via event_text(rules, 'danmaku', ...) like all other
events; hardcoded {uname}说、 {msg} format removed
- Drop message_format param from DanmakuHandler/DanmakuClient/server/main
- api_rules_post mutates the shared rules dict in place (clear+update)
instead of rebinding, so running handlers pick up new templates
immediately without restarting TTS
- UI save toast: '规则已保存并即时生效'
- Verified: custom template 卧槽!、是{uname}!、他说、 {msg} works;
save-then-next-danmaku uses new template without restart