feat(web): add web control client

This commit is contained in:
2026-05-17 18:04:33 +08:00
parent 01c7176b1c
commit 2062f917b0
8 changed files with 1800 additions and 2 deletions
+19
View File
@@ -126,3 +126,22 @@ AI Agent 会在终端输出:
```bash
python -m unittest discover -v
```
## Web 回放与控制台
启动核心游戏服务后,可以单独启动 Web 回放服务:
```bash
python -m texas_holdem_replay.server --host 127.0.0.1 --port 8088
```
打开 `http://127.0.0.1:8088`。页面通过自身的代理接口访问核心服务,
避免浏览器跨域限制;它不会导入或耦合 `texas_holdem.engine` 内部代码。
页面支持:
- 拉取 `GET /games/{game_id}` 快照并按 `hands[].actions` 生成逐帧回放。
- 通过代理调用核心服务运行指定数量手牌。
- 可选覆盖下一批手牌的大小盲。
- 上传或粘贴静态 JSON 快照进行离线回放。
- 自动轮询正在运行的游戏,保留当前历史查看位置。