-
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Cursor Agent edited this page Sep 18, 2026
·
5 revisions
| 文件 | 位置 |
|---|---|
config.yml |
LabAPI/configs/<端口或 global>/SLDataAPI/config.yml |
apikey.config |
同上目录(2.6 预览;首次启用时自动生成) |
control_log.json / reports.json
|
同上目录 |
| 插件启停 |
LabAPI/plugins/global/SLDataAPI/properties.yml(可用 /control/plugins 代写) |
键名均为 snake_case(LabAPI UnderscoredNamingConvention)。
- 错误键名被静默忽略(鉴权“明明对了却不生效”多半是键名或整文件解析失败)。
- 任一值格式错误可能导致整文件回退默认(启动日志会打 YamlDotNet 行号)。
-
verify_token/ 旧control_token:建议 ASCII 双引号包裹。裸值以*/&/!开头或含未引号#会破坏 YAML。 - 弯引号
“”会进入 token 内容,导致鉴权失败且无报错。 - 启动若警告 “VerifyToken 仍为出厂默认值”,数据接口等效未鉴权。
| 键 | 类型 | 默认 | 说明 |
|---|---|---|---|
| debug | bool | false | 调试日志 |
| verify_token | string | your_secret_token | /get_sl_data |
| http_port | int | 8081 | HTTP 端口 |
| push_interval_seconds | int | 8 | 快照刷新间隔(秒) |
| control_enabled | bool | false | 关则 /control/* 全 404 |
| control_token | string | "" | 2.6 废弃,忽略并警告 |
| control_transport | string | http |
http | ws,硬互斥 |
| auto_update_check | bool | true | 检查 GitHub Release |
| auto_update_install | bool | true | 自动下 DLL(跳过 prerelease 标签) |
| file_root | string | "" | 空=禁用 /control/files/*
|
| log_directory | string | "" | 空=自动探测 LocalAdmin/游戏日志 |
| voice_enabled | bool | false | 语音 WS |
| voice_port | int | 8082 | 语音端口 |
| voice_record_enabled | bool | false | 需 voice_enabled
|
| voice_record_max_rounds | int | 10 | 0/负=不清理 |
| voice_record_dir | string | "" | 空=默认 SLDataAPI/VoiceRecords
|
| report_enabled | bool | false | SSS 举报面板 + /control/reports
|
| report_max_records | int | 50 | |
| report_rate_limit | int | 5 | 窗口内每人次数 |
| report_rate_window_minutes | int | 30 | |
| control_log_enabled | bool | true | 侵入性操作审计 |
| control_log_max_records | int | 500 | 0/负=不裁剪 |
| api_key_confirm_timeout_seconds | int | 20 | Key create/revoke 确认(5–120) |
记录写操作:控制台命令、玩家/回合/地图/CASSIE/波次、举报处理、插件、封禁、文件写等。
不记录:get_sl_data、地图只读、日志读、列表类查询等。
2.6 路径名见 Preview-HTTP-API;2.5 路径见 HTTP-API。
与 config.yml 同目录;勿手写明文 Key(用 sldataapi apikey create)。
endpoint_catalog:
"/control/console/": false
"/control/plugins": false
# … 完整列表由插件首次生成
templates:
duty:
description: "值班只读"
endpoints: { ... }
admin:
description: "管理"
endpoints: all_control_true # 仍受 catalog false 约束
keys:
- id: bot-read
template: duty
fingerprint: "sha256:..."
created_at: "2026-..."
note: ""
endpoints_override: {} # 可选,覆盖单 Key 权限修改 endpoint_catalog / templates 后需重启或触发插件重载配置(Key 列表由命令维护)。
| control_transport | HTTP /control/*
|
WS /control
|
|---|---|---|
| http(默认) | 可用 | 404 + transport_mismatch
|
| ws | 404 + transport_mismatch
|
可用 |
/get_sl_data 始终 HTTP,不受此项影响。