Skip to content

添加Xbox封禁相关提示#3860

Merged
Glavo merged 7 commits into
HMCL-dev:mainfrom
CiiLu:xboxban
May 31, 2025
Merged

添加Xbox封禁相关提示#3860
Glavo merged 7 commits into
HMCL-dev:mainfrom
CiiLu:xboxban

Conversation

@CiiLu

@CiiLu CiiLu commented Apr 26, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@burningtnt burningtnt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

你只是添加了 BANNED 字段和对应的链接,但并没有在 org.jackhuang.hmcl.setting.Accounts#localizeErrorMessage 中加入对 BANNED 字段的读取和本地化逻辑。

请修改该 PR:

  • 移除常态化的“封禁查询”,这会给用户带来压迫感;
  • 添加对 BANNED 字段的读取和本地化错误信息逻辑。

@Glavo Glavo requested a review from Copilot May 19, 2025 14:38

This comment was marked as outdated.

@CiiLu

CiiLu commented May 20, 2025

Copy link
Copy Markdown
Contributor Author

草,点到了格式化导致一堆地方被改了

@Glavo Glavo requested a review from Copilot May 29, 2025 10:42

This comment was marked as outdated.

@Glavo Glavo requested a review from Copilot May 31, 2025 14:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for notifying users when their Xbox Live account is banned by introducing a new error code, localization entries, and a UI link to check ban status.

  • Introduces a new BANNED error code in MicrosoftService
  • Adds account.methods.microsoft.error.banned and account.methods.ban_query I18N keys
  • Inserts a “Ban Query” link in the account creation pane
  • Updates localizeErrorMessage to handle the banned error code

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
HMCLCore/src/main/java/org/jackhuang/hmcl/auth/microsoft/MicrosoftService.java Adds BANNED constant for the new Xbox ban error code
HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties Adds Chinese translations for banned message and link
HMCL/src/main/resources/assets/lang/I18N_zh.properties Adds Traditional Chinese translations for ban query
HMCL/src/main/resources/assets/lang/I18N.properties Adds English “Ban Query” label
HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java Inserts a banned status link in the UI pane
HMCL/src/main/java/org/jackhuang/hmcl/setting/Accounts.java Maps the new banned error code to the localized message
Comments suppressed due to low confidence (3)

HMCLCore/src/main/java/org/jackhuang/hmcl/auth/microsoft/MicrosoftService.java:318

  • [nitpick] Consider renaming this constant to XBOX_ACCOUNT_BANNED or ERROR_CODE_BANNED for greater clarity in code readers.
public static final long BANNED = 2148916227L;

HMCL/src/main/java/org/jackhuang/hmcl/setting/Accounts.java:492

  • Add a unit test for localizeErrorMessage that passes this banned error code in to verify the correct localized string is returned.
} else if (errorCode == MicrosoftService.XboxAuthorizationException.BANNED) {

HMCL/src/main/resources/assets/lang/I18N.properties:141

  • [nitpick] The label "Ban Query" may be unclear to end users; consider a more descriptive phrase like "Check Ban Status".
account.methods.ban_query=Ban Query

return redirect;
}

public static final long BANNED = 2148916227L;

Copilot AI May 31, 2025

Copy link

Choose a reason for hiding this comment

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

Add a Javadoc comment above this constant to explain what this error code means and when it is returned.

Copilot uses AI. Check for mistakes.
@Glavo Glavo merged commit 17abfc1 into HMCL-dev:main May 31, 2025
3 checks passed
@CiiLu CiiLu deleted the xboxban branch October 7, 2025 11:52
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.

4 participants