Skip to content

feat: 支持国际服登录与切号#607

Open
earthjasonlin wants to merge 2 commits into
OneDragon-Anything:mainfrom
earthjasonlin:main
Open

feat: 支持国际服登录与切号#607
earthjasonlin wants to merge 2 commits into
OneDragon-Anything:mainfrom
earthjasonlin:main

Conversation

@earthjasonlin

@earthjasonlin earthjasonlin commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • 新功能
    • 新增国际服进入流程选服能力,支持亚服、欧服、美服及港澳台服务器。
    • 在登录或切号场景中,自动识别国际服选服页面,并按页面提示完成登出确认、选择服务器与开始游戏。
  • 改进
    • 强化相关页面与登录状态识别,减少进入游戏过程中的重复点击与通用兜底流程。

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c3a0636d-f67e-439c-9d95-586a0f25b358

📥 Commits

Reviewing files that changed from the base of the PR and between f606ef5 and f65b1ae.

📒 Files selected for processing (1)
  • src/sr_od/operations/enter_game/enter_game.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/sr_od/operations/enter_game/enter_game.py

Walkthrough

新增国际服选服页面识别配置,扩展 EnterGame 的国际服登录与切号状态判断,并新增按 game_region 选择服务器区域的操作节点。

Changes

国际服进入游戏流程

Layer / File(s) Summary
国际服界面识别契约
assets/game_data/screen_info/_od_merged.yml
新增国际服选服页面及开始游戏、登出、区域选项和确认按钮的识别配置。
切号登录状态流转
src/sr_od/operations/enter_game/enter_game.py
新增切号和选服页状态,在登录相关判定中处理国际服登出确认、选服页及账号输入区域。
国际服服务器选择
src/sr_od/operations/enter_game/enter_game.py
新增 choose_server 节点,按区域依次点击选服、区域、确认和开始游戏控件,并处理不支持的区域。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EnterGame
  participant ScreenInfo
  participant GameRegion
  EnterGame->>ScreenInfo: 识别国际服选服页面
  EnterGame->>GameRegion: 读取 game_region
  EnterGame->>ScreenInfo: 点击选服区域、确认和开始游戏
Loading

Poem

小兔蹦跳进国际服,
选好亚欧美与港澳台;
点击确认胡萝卜香,
切号登出不慌张,
开始游戏月光亮。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次变更的核心:支持国际服登录与切号。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/sr_od/operations/enter_game/enter_game.py (1)

130-139: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

合并重复的条件判断

相邻的两个 if self._is_oversea_server(): 判断逻辑可以合并,提高代码整洁度。

♻️ 建议的重构
         if self._is_oversea_server():
             result = self.round_by_find_area(screen, '进入游戏', '国服-账号输入区域')
             if result.is_success:
                 return self.round_success('国服-账号密码')
 
-        if self._is_oversea_server():
             result = self.round_by_find_area(screen, '进入游戏-国际服选服', '文本-开始游戏')
             if result.is_success:
                 return self.round_success('国际服-选服')
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/sr_od/operations/enter_game/enter_game.py` around lines 130 - 139, 合并
enter_game 流程中相邻的两个 self._is_oversea_server() 条件块,统一放入同一个条件分支,并保留其中
round_by_find_area、成功判断及对应 round_success 返回逻辑不变。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/sr_od/operations/enter_game/enter_game.py`:
- Around line 282-298: 在进入国际服选服流程中,为每次独立调用 round_by_click_area 及后续
round_by_find_and_click_area 点击之间显式加入 time.sleep(),确保 UI 有时间完成展开和动画响应;参考
input_account_password 的等待方式,并保留现有的失败结果立即返回逻辑。
- Around line 98-111: Update the international-server logout flow in the visible
switch handling to use round_by_click_area for both the logout and
logout-confirm actions, replacing round_by_find_and_click_area while preserving
the existing area names, success handling, state updates, and wait behavior.

---

Nitpick comments:
In `@src/sr_od/operations/enter_game/enter_game.py`:
- Around line 130-139: 合并 enter_game 流程中相邻的两个 self._is_oversea_server()
条件块,统一放入同一个条件分支,并保留其中 round_by_find_area、成功判断及对应 round_success 返回逻辑不变。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ec3836bc-b8e0-460a-b251-abc98cc95df2

📥 Commits

Reviewing files that changed from the base of the PR and between 111b625 and f606ef5.

📒 Files selected for processing (2)
  • assets/game_data/screen_info/_od_merged.yml
  • src/sr_od/operations/enter_game/enter_game.py

Comment thread src/sr_od/operations/enter_game/enter_game.py
Comment thread src/sr_od/operations/enter_game/enter_game.py Outdated
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