添加Xbox封禁相关提示#3860
Conversation
burningtnt
left a comment
There was a problem hiding this comment.
你只是添加了 BANNED 字段和对应的链接,但并没有在 org.jackhuang.hmcl.setting.Accounts#localizeErrorMessage 中加入对 BANNED 字段的读取和本地化逻辑。
请修改该 PR:
- 移除常态化的“封禁查询”,这会给用户带来压迫感;
- 添加对
BANNED字段的读取和本地化错误信息逻辑。
|
草,点到了格式化导致一堆地方被改了 |
There was a problem hiding this comment.
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
BANNEDerror code inMicrosoftService - Adds
account.methods.microsoft.error.bannedandaccount.methods.ban_queryI18N keys - Inserts a “Ban Query” link in the account creation pane
- Updates
localizeErrorMessageto 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_BANNEDorERROR_CODE_BANNEDfor 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
localizeErrorMessagethat 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; |
There was a problem hiding this comment.
Add a Javadoc comment above this constant to explain what this error code means and when it is returned.
No description provided.