-
-
Notifications
You must be signed in to change notification settings - Fork 0
HTTP API
DNTOF edited this page Aug 24, 2026
·
2 revisions
所有接口基于裸 HTTP(默认端口 8081),无 TLS。 鉴权见 Security-Model。
返回服务器实时状态快照(JSON),包含人数、回合、核弹、玩家列表(含坐标)、DNT_OF 插件状态。
核弹字段仅在回合进行中时实时读取(主线程派发),其余字段来自定时快照(每 push_interval_seconds 刷一次)。
{"command": "help"}返回 {output, console}:output 为命令直接返回值(点命令含完整回显),console 为 Harmony 捕获的控制台管线输出。
点命令(.m 等)以主机玩家身份在 DotCommandHandler 上直连执行。
| 子命令 | 字段 |
|---|---|
| kick | target, reason? |
| ban | target, reason?, duration?(分钟,0=永久) |
| role | target, role(RoleTypeId 名) |
| teleport | target, x, y, z |
| mute | target, mute(bool), mute_scope?(voice|intercom), persistent?(bool,默认false) |
| msg | target, message, duration_seconds? |
| effect | target, effect(名称), effect_duration? |
| state | target, godmode?, bypass?, health?, intercom? |
target 支持 PlayerId / UserId / IP / 昵称模糊匹配。
重生波次控制。
{"faction": "mtf", "action": "instant"}
{"faction": "mtf", "action": "set", "seconds": 120, "tokens": 5}
{"faction": "chaos", "action": "status"}faction: mtf 或 chaos。action: instant(立即生成)/ set(设置剩余秒数,可选 tokens 代币数)/ status(查询状态)。
地图布局读取 + 门/电梯/灯光控制。
{"action": "doors", "door_type": "...", "scope": "type|all|all_not_list", "lock_door": true, "open_door": true}
{"action": "lights", "room_type": "...", "lights_off": true, "duration": 30}
{"action": "elevators", "elevator_type": "Nuke01", "command": "up|down|send", "level": 0}elevator_type 支持当前 ElevatorGroup 枚举名(Nuke01/LczA01/GateA01…单轿厢粒度)或旧名别名(Nuke=整组)。
| 端点 | 说明 |
|---|---|
/control/round |
回合控制 restart/end/start |
/control/cassie |
CASSIE 播报(translation 可选字幕翻译) |
/control/warhead |
核弹 start/stop/detonate |
/control/slplayer |
SLPlayer 音乐控制(需装 SLPlayer) |
/control/plugins |
插件列表/启停暂存/apply/reload |
/control/ban_list |
封禁列表 |
/control/ban/add / ban/revoke
|
新增/解除封禁 |
/control/logs |
服务器日志尾部读取 |
/control/files/list/read/write |
文件管理(受 FileRoot 白名单限制) |
/control/map/export |
导出地图原始数据 |