Skip to content

fix(maa): 补齐账号切换开关 - #529

Merged
qiyinxi merged 1 commit into
AUTO-MAS-Project:devfrom
qiyinxi:fix/maa-account-switch-enabled-20260902
Sep 2, 2026
Merged

fix(maa): 补齐账号切换开关#529
qiyinxi merged 1 commit into
AUTO-MAS-Project:devfrom
qiyinxi:fix/maa-account-switch-enabled-20260902

Conversation

@qiyinxi

@qiyinxi qiyinxi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

摘要

  • MAA 自动代理会按官服/B 服用户账号同步账号切换开关;账号留空时关闭。
  • 补充 MAA 配置字段说明和 v5.5.0-beta.3 的修复记录。
  • 已验证:隔离 set_maa() 冒烟覆盖 5 种场景;pytest tests --collect-only -q 收集 364 项。
  • 已知既有基线:tests/task/test_maa_config_overrides.py 有 1 项未改动断言失败;该文件另有既存 I001 import 排序告警。

Sourcery 摘要

确保 MAA 账号切换遵循已配置的游戏账号。

Bug 修复:

  • 将 MAA 的账号切换状态与已配置的官方账号或 Bilibili 账号同步;未配置账号时禁用切换。

改进:

  • 记录相关 MAA 配置字段,并在 v5.5.0-beta.3 发行说明中记录此修复。

文档:

  • 更新 MAA 配置文档和发行说明。
Original summary in English

Summary by Sourcery

Ensure MAA account switching follows the configured game account.

Bug Fixes:

  • Synchronize MAA's account-switching state with the configured official or Bilibili account, disabling switching when no account is configured.

Enhancements:

  • Document the relevant MAA configuration fields and record the fix in the v5.5.0-beta.3 release notes.

Documentation:

  • Update MAA configuration documentation and release notes.

@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 @qiyinxi, you've used your own review budget of 250,000 diff characters for the last 7 days.

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

@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown
审查者指南(小型 PR 中折叠显示)

审查者指南

本 PR 针对 MAA v6.14.0-b2 后账号切换由独立开关控制的问题,在自动代理生成启动配置时按官服/B 服账号是否为空同步 AccountSwitchEnabled,同时补充配置文档并更新 v5.5.0-beta.3 版本记录;验证覆盖 5 种 set_maa() 场景,测试收集到 364 项。

MAA 账号切换同步流程图

flowchart TD
    A[set_maa] --> B{服务器是官服还是 B 服?}
    B -- 否 --> C[保留现有账号切换设置]
    B -- 是 --> D[读取 StartUp.AccountName]
    D --> E{AccountName.strip 为空?}
    E -- 是 --> F[AccountSwitchEnabled = false]
    E -- 否 --> G[AccountSwitchEnabled = true]
Loading

文件级变更

变更 详情 文件
同步设置 MAA 的账号切换开关,确保官服和 B 服账号配置能够真正触发切号,并在账号为空时关闭开关。
  • 在生成 MAA 启动任务时识别官服/B 服配置,并根据账号名去除空白后的非空状态设置 AccountSwitchEnabled
  • 继续分别写入官服 UID 和 B 服账号名,保持既有账号字段映射。
app/task/MAA/AutoProxy.py
补充 MAA 配置字段文档,记录账号切换开关及相关配置语义。
  • 更新配置字段说明以反映新增的账号切换控制逻辑。
res/docs/MAA 配置文件信息.md
更新版本元数据和发布记录,纳入本次账号切换修复。
  • 将版本信息推进至 v5.5.0-beta.3。
  • 补充对应版本的修复记录。
res/version.json

可能关联的问题

  • #当maa的切换账号失败时,automaa会继续运行:PR 通过启用 AccountSwitchEnabled 修复账号配置未生效导致的 MAA 切换失败,与问题直接相关。

提示和命令

与 Sourcery 交互

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

自定义你的使用体验

访问你的控制面板以:

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

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

本 PR 针对 MAA v6.14.0-b2 后账号切换由独立开关控制的问题,在自动代理生成启动配置时按官服/B 服账号是否为空同步 AccountSwitchEnabled,同时补充配置文档并更新 v5.5.0-beta.3 版本记录;验证覆盖 5 种 set_maa() 场景,测试收集到 364 项。

Flow diagram for MAA account switch synchronization

flowchart TD
    A[set_maa] --> B{Server is Official or Bilibili?}
    B -- No --> C[Keep existing account switch setting]
    B -- Yes --> D[Read StartUp.AccountName]
    D --> E{AccountName.strip is empty?}
    E -- Yes --> F[AccountSwitchEnabled = false]
    E -- No --> G[AccountSwitchEnabled = true]
Loading

File-Level Changes

Change Details Files
同步设置 MAA 的账号切换开关,确保官服和 B 服账号配置能够真正触发切号,并在账号为空时关闭开关。
  • 在生成 MAA 启动任务时识别官服/B 服配置,并根据账号名去除空白后的非空状态设置 AccountSwitchEnabled
  • 继续分别写入官服 UID 和 B 服账号名,保持既有账号字段映射。
app/task/MAA/AutoProxy.py
补充 MAA 配置字段文档,记录账号切换开关及相关配置语义。
  • 更新配置字段说明以反映新增的账号切换控制逻辑。
res/docs/MAA 配置文件信息.md
更新版本元数据和发布记录,纳入本次账号切换修复。
  • 将版本信息推进至 v5.5.0-beta.3。
  • 补充对应版本的修复记录。
res/version.json

Possibly linked issues

  • #当maa的切换账号失败时,automaa会继续运行: PR通过启用AccountSwitchEnabled修复账号配置未生效导致的MAA切换失败,与问题直接相关。

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

@qiyinxi
qiyinxi merged commit dab6754 into AUTO-MAS-Project:dev Sep 2, 2026
2 checks passed
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