Reorganize repository into pc web shared monorepo
Separate the local recognition, web publishing, and shared data paths while preserving direct script execution and existing site content. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -158,26 +158,27 @@ GSI 不含可靠 lobby 类型时,用右下金色勋章检测(`has_ranked_ove
|
||||
|
||||
```
|
||||
climperor/
|
||||
├── config.json
|
||||
├── data/ # heroes / relations / items / abilities / fears …
|
||||
├── common.py / recognize.py / draft_session.py
|
||||
├── gsi_watch.py / gsi_setup.py / overlay.py
|
||||
├── recommend.py / relations.py / roles.py / grid.py / modes.py
|
||||
├── http_utils.py / loc_format.py / hero_tags.py / item_fears.py
|
||||
├── fetch_cdn_templates.py / fetch_hero_portraits.py / fetch_hero_items.py
|
||||
├── fetch_item_shop.py / fetch_items_meta.py / fetch_hero_abilities.py
|
||||
├── fetch_ability_videos.py / fetch_stratz.py / audit_relations.py
|
||||
├── fetch_patches.py / refresh_web.py / import_relations_xlsx.py / serve_relations.py
|
||||
├── export_relations_site.py / deploy_relations.py
|
||||
├── pc/ # 局内选将识别(GSI + 截屏 + OpenCV)
|
||||
│ ├── common.py / recognize.py / draft_session.py / gsi_watch.py
|
||||
│ ├── recommend.py / draft_archetypes.py / roles.py / modes.py / overlay.py
|
||||
│ ├── config.json / templates/ / assets/role_icons/ / samples/
|
||||
│ └── requirements.txt
|
||||
├── web/ # 上分帝 Web(前端、数据流水线、部署)
|
||||
│ ├── frontend/ # 原 web/relations/
|
||||
│ ├── data/ / assets/ / dist/
|
||||
│ ├── fetch_*.py / item_fears.py / mechanic_tags.py / loc_format.py
|
||||
│ ├── serve_relations.py / export_relations_site.py / deploy_relations.py
|
||||
│ ├── refresh_web.py / notify_site_traffic.py / _cf_* / _oss_* / _gitea_*
|
||||
│ └── requirements.txt
|
||||
├── shared/ # 只被 pc/web 依赖,绝不反向依赖
|
||||
│ ├── paths.py / grid.py / relations.py / hero_tags.py / http_utils.py
|
||||
│ ├── import_relations_xlsx.py / audit_relations.py / fetch_matchups.py / fetch_stratz.py
|
||||
│ └── data/heroes.json / data/relations.json
|
||||
├── .gitea/workflows/ # site-traffic-notify + web-daily/weekly/patch
|
||||
├── autocalibrate.py / calibrate.py / capture.py / evaluate.py
|
||||
├── web/relations/ # 上分帝 Web(英雄/排行/物品/版本)
|
||||
├── templates/cdn|roles|modes/
|
||||
├── assets/ # portraits / icons / videos(部分 gitignore)
|
||||
└── samples/labels.json # 评测真值;raw/<matchid>/ 见 .gitignore
|
||||
└── README.md / AGENTS.md / DESIGN.md / CHANGELOG.md
|
||||
```
|
||||
|
||||
运行时目录 `preview/`、`results/`、`failures/`、`samples/raw/`(含按对局子目录)不入库。上分帝 Web 易变数据(STRATZ meta、hero_stats 等)可由 Gitea Actions 定时拉取后直部 Pages,不必入库。
|
||||
运行时目录 `pc/preview/`、`pc/results/`、`pc/failures/`、`pc/samples/raw/`(含按对局子目录)不入库。上分帝 Web 易变数据(STRATZ meta、hero_stats 等)可由 Gitea Actions 定时拉取后直部 Pages,不必入库。
|
||||
|
||||
### 主要配置
|
||||
|
||||
@@ -197,7 +198,7 @@ climperor/
|
||||
| `recommend.min_enemies` | 开始推荐所需敌方锁人数 | 1 |
|
||||
| `recommend.min_heroes_for_gaps` | 缺口/补位注入所需锁人数 | 2 |
|
||||
| `recommend.archetypes` | 推进/全球流/缺口规则画像 | true |
|
||||
| `recommend.relations_path` | 定性关系文件 | `data/relations.json` |
|
||||
| `recommend.relations_path` | 定性关系文件 | `shared/data/relations.json` |
|
||||
| `recommend.role_tags` | 分路→角色标签过滤(1–5 号位;非定位局不过滤) | 见 config.json |
|
||||
| `overlay.enabled` | 选将顶栏角色标签悬浮层 | true |
|
||||
| `overlay.y_gap_rel` / `icon_h_rel` / `icon_gap_rel` | 标签相对屏幕高的间距与尺寸 | 0.008 / 0.016 / 0.002 |
|
||||
@@ -211,13 +212,13 @@ climperor/
|
||||
|
||||
```
|
||||
Dota 2 (-gamestateintegration)
|
||||
→ POST → gsi_watch.py :3223
|
||||
→ samples/raw/{matchid}/gsi.jsonl(可选)
|
||||
→ POST → pc/gsi_watch.py :3223
|
||||
→ pc/samples/raw/{matchid}/gsi.jsonl(可选)
|
||||
→ DraftSession 轮询 recognize + roles/grid/modes
|
||||
→ results/draft_*.json
|
||||
→ pc/results/draft_*.json
|
||||
```
|
||||
|
||||
要点:按 `matchid` 去重;截图进 `samples/raw/{matchid}/`;识别在工作线程;
|
||||
要点:按 `matchid` 去重;截图进 `pc/samples/raw/{matchid}/`;识别在工作线程;
|
||||
未标定时降级为只截图。
|
||||
|
||||
天梯 AP 选人按 2/2/1 成批揭晓,本轮结束前互不可见——因此必须在
|
||||
@@ -230,26 +231,26 @@ Dota 2 (-gamestateintegration)
|
||||
|
||||
- **触发**:敌方至少锁定 1 人(`min_enemies`)后开始;本人锁人后清空标记。
|
||||
- **分路**:定位匹配画面字(`roles.py`)+ GSI `team_slot` 定位本人;不做截屏认自己。有分路则按 `role_tags` 过滤候选;非定位局(读不到分路字)则全英雄表。
|
||||
- **关系模型**:机制克制/搭档(`data/relations.json`),不用胜率/场次——版本会变,机制边相对稳。Web 英雄详情「走势」Tab 优先 STRATZ(`data/stratz_hero_meta.json`):勋章条切换 8 档 → **最近 1 周**三卡(胜率/上场率/场次)→ 1~5 号位分路胜率 → **近 8 周**逐周列表(日期、胜率、周环比、区间缩放横条、场次;新→旧);OpenDota(`data/hero_stats.json`,近约 7 天)作兜底。「对位」Tab 展示 STRATZ 数值 Top(`data/stratz_matchup_tops.json`),与网格定性「克/怕/搭」分开展示;均不进局内推荐。
|
||||
- **阵容画像(规则,不接 AI)**:[`draft_archetypes.py`](draft_archetypes.py) 识别敌方推进/全球流、敌我 tag 缺口(缺控制/爆发/输出/先手);输出一句 `analysis`(如 `敌:缺控制·偏推进 | 我:缺爆发`)与每英雄短 `reasons`。
|
||||
- **关系模型**:机制克制/搭档(`shared/data/relations.json`),不用胜率/场次——版本会变,机制边相对稳。Web 英雄详情「走势」Tab 优先 STRATZ(`web/data/stratz_hero_meta.json`):勋章条切换 8 档 → **最近 1 周**三卡(胜率/上场率/场次)→ 1~5 号位分路胜率 → **近 8 周**逐周列表(日期、胜率、周环比、区间缩放横条、场次;新→旧);OpenDota(`web/data/hero_stats.json`,近约 7 天)作兜底。「对位」Tab 展示 STRATZ 数值 Top(`web/data/stratz_matchup_tops.json`),与网格定性「克/怕/搭」分开展示;均不进局内推荐。
|
||||
- **阵容画像(规则,不接 AI)**:[`pc/draft_archetypes.py`](pc/draft_archetypes.py) 识别敌方推进/全球流、敌我 tag 缺口(缺控制/爆发/输出/先手);输出一句 `analysis`(如 `敌:缺控制·偏推进 | 我:缺爆发`)与每英雄短 `reasons`。
|
||||
- **纳入**:
|
||||
- **克**:关系克制边;推进/全球流应对表(如美杜莎对推进);惩戒敌方缺口
|
||||
- **搭**:与已锁己有搭档边
|
||||
- **补**:填我方缺口(`min_heroes_for_gaps` 默认 2 才注入缺口类标记)
|
||||
- **打分**:关系边为主;阵容应对 / 缺口小幅加分;敌方 tags 软加分仅排序。
|
||||
- **展示**:网格左上角全量相关格标「克」(青)/「搭」(琥珀)/「补」(紫灰);叠加层横条显示阵容分析;原因进日志与 `results` JSON,不写在每个格子旁。
|
||||
- **上分帝 Web**:`serve_relations.py` 本地开发服务;仿选将网格查看克制/被克制/搭档;数据手改 `data/relations.json` 或从 xlsx 导入。
|
||||
另有顶级 **排行**、**走势**(`#/trends[/bracket]`,近 8 周高胜率/上场率榜)、**物品**、**版本** 页;目录见 `data/item_shop.json` / `data/patches.json` / `data/leaderboards.json`。
|
||||
- **上分帝 Web**:`web/serve_relations.py` 本地开发服务;仿选将网格查看克制/被克制/搭档;数据手改 `shared/data/relations.json` 或从 xlsx 导入。
|
||||
另有顶级 **排行**、**走势**(`#/trends[/bracket]`,近 8 周高胜率/上场率榜)、**物品**、**版本** 页;目录见 `web/data/item_shop.json` / `web/data/patches.json` / `web/data/leaderboards.json`。
|
||||
英雄详情子标签含 **走势**(见上;`#/heroes/<key>/trends`)、**对位**(克制/被克/搭档三列 STRATZ Top;`#/heroes/<key>/matchups`)、**近期比赛**(`#/heroes/<key>/matches`)。排行页为 Immortal 四区选手榜。
|
||||
- **Web Hash 路由**:状态(顶层标签 / 选中英雄 + 详情子标签 / 选中物品 / 选中版本 /
|
||||
标签筛选 / 搜索)双向同步进 URL(`#/heroes/axe/core?tags=核心&q=axe`、`#/heroes/axe/trends` 等)。选 Hash
|
||||
而非 Path 路由:静态导出(GitHub Pages)无需 rewrite、`serve_relations.py` 零改动、
|
||||
而非 Path 路由:静态导出(GitHub Pages)无需 rewrite、`web/serve_relations.py` 零改动、
|
||||
相对路径子站亦可用。写 URL 用 `history.pushState`/`replaceState`(静默,不触发
|
||||
`hashchange`,无回环);前进/后退靠 `hashchange` 监听重 parse + 校验 + render。
|
||||
搜索 debounce 300ms + `replaceState` 防刷历史栈;坏链接丢弃该项不崩。路由逻辑集中在
|
||||
`web/relations/router.js`,`app.js` 只在 `main()` 装 `installRouter` + 各 state 变更点
|
||||
`web/frontend/router.js`,`app.js` 只在 `main()` 装 `installRouter` + 各 state 变更点
|
||||
调 `syncStateToUrl`。
|
||||
- **不做**:避用标、Steam 登录页、爬 Dotabuff;关系**不**写入 `data/heroes.json`;不接实时 AI。
|
||||
- **不做**:避用标、Steam 登录页、爬 Dotabuff;关系**不**写入 `shared/data/heroes.json`;不接实时 AI。
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user