Skip to content

fix(task): 游戏已在运行时提示启动参数本轮不会生效 - #867

Open
beichen24a1 wants to merge 2 commits into
AUTO-MAS-Project:devfrom
beichen24a1:fix/note-skipped-launch-args
Open

beichen24a1 wants to merge 2 commits into
AUTO-MAS-Project:devfrom
beichen24a1:fix/note-skipped-launch-args

Conversation

@beichen24a1

@beichen24a1 beichen24a1 commented Sep 18, 2026

Copy link
Copy Markdown

群友反馈「更新后启动参数失效」:游戏已经在运行时 MAS 不会重复启动它,于是配置里的启动参数被静默忽略——界面里参数还在、保存也成功,用户完全看不出这轮没生效。

  • 在每个「检测到游戏已在运行、本轮不启动游戏」的分支上加一条提示:检测到游戏已在运行,本轮不会应用启动参数(<参数原文>)
  • 只在用户真的配了 Game.Arguments 时才提示,没配参数的用户不受打扰
  • 覆盖 5 个专项:通用脚本(URL / exe 两条分支)、绝区零一条龙、ok-nte(两条分支)、ok-ww、MFW(进程已在运行 / 窗口已匹配两条分支)
  • 写法照 feat(maafw): 编辑页整改——PC 启停两态、Unity 分辨率、运行环境 / 更新过程面板 #843 给 Unity 分辨率加的 _note_resolution_override_skipped():提示点紧贴「决定不启动」的那个 return 之前;各专项用自己既有的日志通道(logger.info / _push_dispatch_log / _append_log

没改的两处及理由

  • HSRHSRConfig 的游戏分组里没有 Game.Arguments(MaaEnd / MaaFW / general / ok-ww / ok-nte / zzz 都有),用户根本填不到启动参数,HSR 启动游戏也不带参数。硬加这行会在「游戏已在运行」这条最常见路径上抛 AttributeError。要覆盖得先在 HSRConfig 里补字段并真的把参数传下去,属另一个改动——本次不做。
  • MaaEnd:它把 game_arguments 交给 MaaEnd 自己启动游戏,没有「MAS 跳过启动」这条分支可挂。

验证

  • ruff check / ruff format --check:通过(改动的 6 个文件)
  • python -m pytest tests/task -q:17 passed
  • python -m pytest tests --collect-only -q:308 collected,exit 0
  • 按仓库最新口径未提交测试文件,以上即本次验证记录

Sourcery 总结

当已在运行的游戏导致此任务无法应用其配置的启动参数时,通知用户。

Bug 修复:

  • 当游戏已在运行、导致配置的启动参数未被应用时,通知用户。

功能增强:

  • 在通用启动器、ZZZ、OK-NTE、OK-WW 和 MFW 的游戏启动路径中应用条件通知;未配置启动参数的用户不受影响。

日常维护:

  • 为跳过启动参数通知添加更新日志条目。
Original summary in English

Summary by Sourcery

Inform users when an already-running game prevents this task from applying its configured launch arguments.

Bug Fixes:

  • Notify users when configured launch arguments are not applied because the game is already running.

Enhancements:

  • Apply the conditional notification across the general launcher, ZZZ, OK-NTE, OK-WW, and MFW game-start paths while leaving users without configured arguments unaffected.

Chores:

  • Add a changelog entry for the skipped launch-arguments notification.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @beichen24a1, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 5 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

审查者指南

本 PR 在各支持 Game.Arguments 的任务启动流程中,为“游戏已运行、MAS 跳过重复启动”的路径增加条件式提示,并通过既有日志渠道展示未生效的参数原文;同时补充 changelog,HSR 与 MaaEnd 因实现边界明确不纳入本次改动。

跳过启动参数提示流程图

flowchart TD
    A[任务准备启动游戏] --> B{检测到游戏已在运行}
    B -->|否| C[按配置启动游戏]
    B -->|是| D{Game.Arguments 有内容}
    D -->|否| E[记录已运行并跳过启动]
    D -->|是| F[记录启动参数本轮不会应用]
    F --> E
    E --> G[继续任务流程]
Loading

文件级变更

变更 详情 文件
在游戏已运行而跳过重复启动的路径中,按需提示本轮启动参数不会生效。
  • 新增统一的参数读取与空值过滤逻辑,仅对已配置参数的用户输出提示。
  • 在通用脚本的 URL 和 exe 分支、绝区零、ok-nte 两个分支、ok-ww 及 MFW 两个分支的跳过启动返回前接入提示。
  • 沿用各专项现有日志通道,并保留参数原文;未覆盖 HSR 和 MaaEnd。
app/task/general/AutoProxy.py
app/task/ZzzOd/AutoProxy.py
app/task/OkNte/AutoProxy.py
app/task/Okww/AutoProxy.py
app/task/MaaFW/tools/embedded/runner_task.py
补充本次用户可见行为变更的 changelog 条目。
  • 记录游戏已运行时启动参数跳过提示的修复。
changelog.d/fix-note-skipped-launch-args.fix.md

提示与命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论创建 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以使用 @sourcery-ai issue 回复审查评论,以根据该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,以随时重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,以随时重新生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,此功能会非常有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从新的审查开始,这一功能尤其有用——别忘了评论 @sourcery-ai review 来触发新的审查!

自定义使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

本 PR 在各支持 Game.Arguments 的任务启动流程中,为“游戏已运行、MAS 跳过重复启动”的路径增加条件式提示,并通过既有日志渠道展示未生效的参数原文;同时补充 changelog,HSR 与 MaaEnd 因实现边界明确不纳入本次改动。

Flow diagram for skipped launch argument notification

flowchart TD
    A[任务准备启动游戏] --> B{检测到游戏已在运行}
    B -->|否| C[按配置启动游戏]
    B -->|是| D{Game.Arguments 有内容}
    D -->|否| E[记录已运行并跳过启动]
    D -->|是| F[记录启动参数本轮不会应用]
    F --> E
    E --> G[继续任务流程]
Loading

File-Level Changes

Change Details Files
在游戏已运行而跳过重复启动的路径中,按需提示本轮启动参数不会生效。
  • 新增统一的参数读取与空值过滤逻辑,仅对已配置参数的用户输出提示。
  • 在通用脚本的 URL 和 exe 分支、绝区零、ok-nte 两个分支、ok-ww 及 MFW 两个分支的跳过启动返回前接入提示。
  • 沿用各专项现有日志通道,并保留参数原文;未覆盖 HSR 和 MaaEnd。
app/task/general/AutoProxy.py
app/task/ZzzOd/AutoProxy.py
app/task/OkNte/AutoProxy.py
app/task/Okww/AutoProxy.py
app/task/MaaFW/tools/embedded/runner_task.py
补充本次用户可见行为变更的 changelog 条目。
  • 记录游戏已运行时启动参数跳过提示的修复。
changelog.d/fix-note-skipped-launch-args.fix.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant