-
Notifications
You must be signed in to change notification settings - Fork 230
chore: MCP 自启 + 预备编队画面建档 + harness 两仓协同 #2618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
94b68ac
feat(mcp): 主 server 开机自启快捷方式
DoctorReid 5bd759e
docs: 预备编队通用画面建档 + PredefinedTeamChecker app doc
DoctorReid b5f4cc9
docs(screens): 预备编队补编辑态快照(实拍)
DoctorReid 391c55d
docs(harness): 两仓协同补关联 PR 的 git 验证 + 泛化非游戏流程
DoctorReid 7c7db96
docs(harness): 两仓协同补跨仓链接格式(禁裸 #N)
DoctorReid ec6d7a4
fix: 处理 CodeRabbit review(start_mcp_server .env 判断 + doc 补全)
DoctorReid d0146bd
fix(tools): start_mcp_server 健壮性(.env -PathType Leaf + LASTEXITCODE 检查)
DoctorReid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # 预备编队角色识别(PredefinedTeamChecker) | ||
|
|
||
| ## 概述 | ||
|
|
||
| `PredefinedTeamChecker` 是一个**校准工具**(**开发工具应用 / devtools app** —— 不参与玩法流程,只用于校准并回写配置,非自动化玩法),识别游戏内预备编队的**实际角色**并写回 `team_config`。用途:玩家在游戏里改了预备编队后,跑此 app 核对 / 同步配置(切队前校准),避免 `team_config` 与游戏实际不一致导致后续选队错位。 | ||
|
|
||
| ⚠️ 它进入的是预备编队的**编辑 / 管理画面**(菜单-更多功能 → 预备编队),只能查看 / 编辑,**不能选队出战** —— 与战斗前的「选择(准备出战)」子态不同(后者有 `SELECT` / `预备出战`)。详见 [预备编队](../../../game/screens/预备编队.md)。 | ||
|
|
||
| ## 流程 | ||
|
|
||
| 1. **前往菜单**(GotoMenu)→ **菜单-更多功能** → 点「按钮-预备编队」→ 进入预备编队管理画面(编辑子态)。 | ||
| 2. **识别编队角色**(`update_team_members`): | ||
| - OCR 全图队名 → 用 `difflib` 模糊匹配 `team_config` 的队伍名(找对应配置队)。 | ||
| - 在匹配队名左侧 -10 起、宽 800 高 250 的区域(`avatar_rect = Rect(x-10, y, x+800, y+250)`),`match_team_agent_template` 模板匹配代理人头像 → 按横坐标排序 + 重叠过滤(issue #1487,同位置多识别取高置信)。 | ||
| - `team_config.update_team_members(队名, [代理人])` 写回配置(按队名匹配,非 idx)。 | ||
| 3. **翻页**:中屏 drag 上滑(`-500px`),最多翻 4 次,每页重复识别。 | ||
| 4. **返回**:`BackToNormalWorld` 回大世界。 | ||
|
|
||
| ## 关键点 | ||
|
|
||
| - **画面**:编辑 / 管理子态(无 `SELECT` / `预备出战`);主体布局同选择子态(2×3 卡片 + 1P/2P/3P + 核心技 X/3)。详见 [预备编队画面](../../../game/screens/预备编队.md)。 | ||
| - **识别依据**:OCR 队名(模糊匹配 config)+ **代理人头像模板**(不是 1P/2P/3P 文字标记)。 | ||
| - **写回**:`update_team_members`(按队名匹配),保留该队已有的自动战斗配置。 | ||
|
|
||
| ## 相关 | ||
|
|
||
| - 画面:[预备编队](../../../game/screens/预备编队.md)(通用画面,选择 / 编辑两子态)。 | ||
| - 代码:`src/zzz_od/application/game_config_checker/predefined_team_checker/`。 | ||
| - 同类:`game_config_checker` 下其他 checker(均为校准工具,非玩法)。 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| screen_name: 预备编队 | ||
| appears_in: [实战模拟室, 式舆防卫战, 恶名狩猎] | ||
| last_updated: 2026-08-01 | ||
| source_image: screens/预备编队/默认.webp | ||
| --- | ||
|
|
||
| # 预备编队 | ||
|
|
||
| 预备编队列表(队伍卡片网格),**通用画面**,多个玩法共用:战斗前选队出战(实战模拟室 / 式舆防卫战 / 恶名狩猎等)、或从菜单进入管理编辑(`PredefinedTeamChecker` 识别角色)。 | ||
|
|
||
| ## 两个子态(关键区别) | ||
|
|
||
| | 子态 | 入口 | 能否选队出战 | 底部按钮 | | ||
| |---|---|---|---| | ||
| | **选择(准备出战)** | 各玩法出战态点「预备编队」按钮 | ✅ 能 | `+SELECT` / `TEAM 01-02`(选中态)+ **预备出战** | | ||
| | **编辑 / 管理** | 菜单-更多功能 → 预备编队(`PredefinedTeamChecker` 走这条) | ❌ 只能编辑 / 查看(不能选出战) | 无 `SELECT` / `预备出战` | | ||
|
|
||
| 两子态**主体 UI 相同**(2×3 卡片网格 + 1P/2P/3P + 核心技 X/Y + 等级),区别在底部:选择子态有 `SELECT`/`预备出战`,编辑子态没有。 | ||
|
|
||
| ## 布局(主体,两子态共用) | ||
|
|
||
| 2 列 × 3 行 = 6 张队伍卡片(每页),可上下拖动翻页(每页翻 4 队、与上页重叠 2)。 | ||
|
|
||
| 每张卡片: | ||
| - **队名**(卡片顶部) | ||
| - **3 个代理人头像** + **1P / 2P / 3P 位置标记**(代理人位;空位也保留标记) | ||
| - **核心技激活 `X/Y`**(右上):分母 = 队伍人数 —— `3/3`=3 人满员、`2/3`=3 人 2 激活、`0/1`=1 人、`0/0`=空队 | ||
| - **等级**(头像旁,如 `60`) | ||
| - 选择子态还有:`+SELECT`(未选中)/ `TEAM 01-02`(已选中) | ||
|
|
||
| 底部:**预备出战**(右下,仅选择子态)。 | ||
|
|
||
| ## 识别特征 | ||
|
|
||
| - 当前命中 `实战模拟室` screen(因「预备出战」area 在 `combat_simulation.yml`)—— 预备编队列表本身**无独立 screen**(待独立化)。 | ||
| - 卡片元素识别靠 `ChoosePredefinedTeam` 硬编码坐标(`CARD_TITLE_X_LIST=[150,970]` × `CARD_TITLE_Y_LIST=[115,398,680]` 网格 + 1P/2P/3P OCR + 核心技 X/Y + SELECT/TEAM),不走 screen_info area。 | ||
|
|
||
| ## 选队(选择子态) | ||
|
|
||
| 点**队名右侧空白**(`TEAM_NAME_CLICK_OFFSET = +300px`)切换选中 —— 点队名本身是改名弹窗,只有 +300px 才是选中。选中后显示 `TEAM 01/02`;全部目标选中后点「预备出战」回配队选择页。 | ||
|
|
||
| ## 识别快照 | ||
|
|
||
| ### 1. 选择(准备出战)(source_image: screens/预备编队/默认.webp) | ||
|
|
||
| 6 张满员队(日常刷本 / 简薇耀 / 冰莱凯苍 / 冰雅狼苍 / 火莱凯露 / 仪玄),均 `+SELECT`(未预选)。核心技 `3/3`(满员)。代理人位 1P/2P/3P 齐全 + 等级 60。右下「预备出战」。 | ||
|
|
||
| - **匹配画面**:`实战模拟室` `is_precise=false`(靠「预备出战」area 命中) | ||
| - **全量 OCR**:队名(日常刷本 等)+ `1P/2P/3P/BANGBOO` + `3/3`(核心技)+ `60`(等级)+ `+ SELECT` + `预备出战` | ||
|
|
||
| ### 2. 编辑 / 管理(source_image: screens/预备编队/编辑.webp) | ||
|
|
||
| `PredefinedTeamChecker` 从菜单-更多功能进入。队伍列表主体同选择子态(2×3 卡片 + 1P/2P/3P + 核心技 X/Y + 等级),但**无 `+SELECT` / `预备出战` / `TEAM` 选中态**(只能编辑查看,不能选出战)。`PredefinedTeamChecker` 在此 OCR 队名 + 模板匹配代理人头像 → 更新 `team_config`。 | ||
|
|
||
| - **全量 OCR**:队名(日常刷本 等)+ `1P/2P/3P/BANGBOO` + `3/3` / `2/3`(核心技)+ `60`(等级)+ `AGENT` —— **无 `+SELECT` / `预备出战`**(与选择子态的关键区别)。 | ||
|
|
||
| ## 备注 | ||
|
|
||
| - **screen_info 现状**:预备编队列表**无独立 screen**(命中实战模拟室);卡片元素识别:选队子态靠 `ChoosePredefinedTeam` 硬编码网格坐标(`CARD_TITLE_*`),管理子态靠 `PredefinedTeamChecker` 按队名算 `avatar_rect`(x-10 到 x+800);均未建 screen_info area。后续可考虑独立化 screen「预备编队」。 | ||
| - **多玩法进入**:实战模拟室(出战态→预备编队)/ 式舆防卫战(选队)/ 恶名狩猎?/ 菜单-更多功能(管理编辑,`PredefinedTeamChecker`)。 | ||
| - **核心技 `X/Y` 的 OCR 坑**:游戏里斜线 `/` 易被 OCR 识成 `1`(连写,如 `313`=3/3、`315`=3/5),代码侧已兼容(`_get_team_count_text` 按 `\d1\d` 还原)。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Create ZZZ OD MCP Server Startup Shortcut | ||
| # | ||
| # Creates a shortcut in the Windows Startup folder so the main MCP server (port 23001) | ||
| # starts automatically after login, without being spawned by daemon. | ||
| # Independent of the daemon startup shortcut (tools/mcp/daemon/create_startup_shortcut.ps1); | ||
| # both can coexist: daemon manages server lifecycle, this shortcut keeps the server ready | ||
| # right after login. | ||
|
|
||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| # This script lives in tools/mcp/, go up 2 levels to project root | ||
| $ProjectRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent | ||
| $StartScript = Join-Path $ProjectRoot "tools\mcp\start_mcp_server.ps1" | ||
|
|
||
| # Startup folder | ||
| $StartupFolder = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup" | ||
| $ShortcutPath = Join-Path $StartupFolder "ZZZ OD MCP Server.lnk" | ||
|
|
||
| Write-Host "============================================================" -ForegroundColor Cyan | ||
| Write-Host "ZZZ OD MCP Server - Startup Shortcut Creator" -ForegroundColor Cyan | ||
| Write-Host "============================================================" -ForegroundColor Cyan | ||
| Write-Host "" | ||
| Write-Host "Project Root: $ProjectRoot" | ||
| Write-Host "Start Script: $StartScript" | ||
| Write-Host "Shortcut Path: $ShortcutPath" | ||
| Write-Host "============================================================" -ForegroundColor Cyan | ||
| Write-Host "" | ||
|
|
||
| # Check if start_mcp_server.ps1 exists | ||
| if (-not (Test-Path $StartScript)) { | ||
| Write-Host "[ERROR] start_mcp_server.ps1 not found: $StartScript" -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| # Create WScript.Shell object | ||
| $WshShell = New-Object -ComObject WScript.Shell | ||
|
|
||
| # Create shortcut | ||
| $Shortcut = $WshShell.CreateShortcut($ShortcutPath) | ||
| $Shortcut.TargetPath = "powershell.exe" | ||
| $Shortcut.Arguments = "-ExecutionPolicy Bypass -WindowStyle Hidden -File `"$StartScript`"" | ||
| $Shortcut.WorkingDirectory = $ProjectRoot | ||
| $Shortcut.Description = "ZZZ OD MCP Server - backend main server (game operation)" | ||
| $Shortcut.Save() | ||
|
|
||
| # Release COM object | ||
| [System.Runtime.Interopservices.Marshal]::ReleaseComObject($WshShell) | Out-Null | ||
|
|
||
| Write-Host "[SUCCESS] Shortcut created!" -ForegroundColor Green | ||
| Write-Host "" | ||
| Write-Host "Shortcut location: $ShortcutPath" -ForegroundColor Cyan | ||
| Write-Host "" | ||
| Write-Host "ZZZ OD MCP Server will now automatically start when you log in." -ForegroundColor Green | ||
| Write-Host "" | ||
| Write-Host "To remove:" -ForegroundColor Yellow | ||
| Write-Host " Delete the shortcut file: $ShortcutPath" | ||
| Write-Host "" | ||
| Write-Host "============================================================" -ForegroundColor Cyan |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.