add account localization and switchable rooms

Centralize control and OBS copy in a shared TOML catalog, persist the selected locale per account, and broadcast language changes to component streams. Allow account owners to atomically switch their Bilibili room and restart the shared listener without changing component URLs.
This commit is contained in:
2026-07-18 23:28:05 -07:00
parent 53ae90ec13
commit f79852d8e6
35 changed files with 1946 additions and 472 deletions
+6 -1
View File
@@ -34,7 +34,8 @@ log。WebSocket 建立后,客户端必须在 8 秒内发送第一帧:
"version": 1,
"type": "authenticated",
"componentId": "08d31d19-3e4b-4c11-9cf7-9bd786a39465",
"componentKind": "song_request"
"componentKind": "song_request",
"language": "zh-CN"
}
```
@@ -42,6 +43,9 @@ log。WebSocket 建立后,客户端必须在 8 秒内发送第一帧:
`overlay.settings.snapshot` 兼容帧。token 无效、被轮换或属于其他组件时,服务端以 policy
close 结束连接。
`language` 是组件所属账户的 locale。用户在控制台修改语言后,所有已连接组件会立即收到
`component.language.updated`,payload 为 `{ "language": "en-US" }`;新连接以认证帧为准。
设置快照中的 `themeId` 是稳定的主题标识,目前支持
`jade-scroll`。消费者应把未知主题降级为自身默认主题,不能因主题发布顺序不同而中断实时消息。
@@ -75,6 +79,7 @@ close 结束连接。
| ----------------------------- | --------------------------------------------- | ---------------------- |
| `component.settings.snapshot` | `settings` | 所有组件的设置快照 |
| `component.settings.updated` | `settings` | 所有组件的设置更新 |
| `component.language.updated` | `language` | 账户语言实时更新 |
| `overlay.settings.snapshot` | `settings` | 认证后当前设置快照 |
| `overlay.settings.updated` | `settings` | 控制台保存后的实时设置 |
| `live.danmaku` | `viewer`, `text`, `segments` | 普通文字和表情分段 |