Skip to content

Commit 17abfc1

Browse files
CiiLuGlavo
andauthored
添加Xbox封禁相关提示 (#3860)
--------- Co-authored-by: Glavo <zjx001202@gmail.com>
1 parent caa98c8 commit 17abfc1

6 files changed

Lines changed: 12 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ public static String localizeErrorMessage(Exception exception) {
489489
return i18n("account.methods.microsoft.error.country_unavailable");
490490
} else if (errorCode == MicrosoftService.XboxAuthorizationException.MISSING_XBOX_ACCOUNT) {
491491
return i18n("account.methods.microsoft.error.missing_xbox_account");
492+
} else if (errorCode == MicrosoftService.XboxAuthorizationException.BANNED) {
493+
return i18n("account.methods.microsoft.error.banned");
492494
} else {
493495
return i18n("account.methods.microsoft.error.unknown", errorCode);
494496
}

HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,9 @@ private void initDetailsPane() {
348348
forgotpasswordLink.setExternalLink("https://account.live.com/ResetPassword.aspx");
349349
JFXHyperlink createProfileLink = new JFXHyperlink(i18n("account.methods.microsoft.makegameidsettings"));
350350
createProfileLink.setExternalLink("https://www.minecraft.net/msaprofile/mygames/editprofile");
351-
box.getChildren().setAll(profileLink, birthLink, purchaseLink, deauthorizeLink, forgotpasswordLink, createProfileLink);
351+
JFXHyperlink bannedQueryLink = new JFXHyperlink(i18n("account.methods.ban_query"));
352+
bannedQueryLink.setExternalLink("https://enforcement.xbox.com/enforcement/showenforcementhistory");
353+
box.getChildren().setAll(profileLink, birthLink, purchaseLink, deauthorizeLink, forgotpasswordLink, createProfileLink, bannedQueryLink);
352354
GridPane.setColumnSpan(box, 2);
353355

354356
if (!IntegrityChecker.isOfficial()) {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ account.methods.microsoft.error.add_family_probably=Please check if the age indi
106106
account.methods.microsoft.error.country_unavailable=Xbox Live is not available in your current country/region.
107107
account.methods.microsoft.error.missing_xbox_account=Your Microsoft account does not have a linked Xbox account yet. Please click "Create Profile / Edit Profile Name" to create one before continuing.
108108
account.methods.microsoft.error.no_character=Please ensure you have purchased Minecraft: Java Edition.\nIf you have already purchased the game, a profile may not have been created yet.\nClick "Create Profile / Edit Profile Name" to create it.
109+
account.methods.microsoft.error.banned=Your account may have been banned by Xbox Live.\nYou can click on "Ban Query" above for more details.
109110
account.methods.microsoft.error.unknown=Failed to log in, error code: %d.
110111
account.methods.microsoft.error.wrong_verify_method=Please log in using your password on the Microsoft account login page, and do not use a verification code to log in.
111112
account.methods.microsoft.logging_in=Logging in...
@@ -136,6 +137,7 @@ account.methods.offline.uuid.hint=UUID is a unique identifier for Minecraft play
136137
This option is for advanced users only. We do not recommend changing this option unless you know what you are doing.
137138
account.methods.offline.uuid.malformed=Invalid format.
138139
account.methods.forgot_password=Forgot Password
140+
account.methods.ban_query=Ban Query
139141
account.missing=No Accounts
140142
account.missing.add=Click here to add one.
141143
account.move_to_global=Convert to Global Account\nThe account information will be saved in a config file of the current user directory of the system.

HMCL/src/main/resources/assets/lang/I18N_zh.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ account.methods.microsoft.error.add_family_probably=請檢查你的帳戶設定
107107
account.methods.microsoft.error.country_unavailable=你所在的國家或地區不受 Xbox Live 的支援。
108108
account.methods.microsoft.error.missing_xbox_account=你的 Microsoft 帳戶尚未關聯 Xbox 帳戶,你必須先建立 Xbox 帳戶,才能登入遊戲。
109109
account.methods.microsoft.error.no_character=該帳戶未包含 Minecraft: Java 版購買記錄。\n若已購買,則可能未建立遊戲檔案,請點擊上方連結建立。
110+
account.methods.microsoft.error.banned=你的帳戶可能被 Xbox Live 封禁。\n你可以點擊上方「查詢帳戶是否被封禁」查看帳戶狀態。
110111
account.methods.microsoft.error.unknown=登入失敗,錯誤碼:%d
111112
account.methods.microsoft.error.wrong_verify_method=請在 Microsoft 帳戶登入頁面使用密碼登入,不要使用驗證碼登入。
112113
account.methods.microsoft.logging_in=登入中……
@@ -126,6 +127,7 @@ account.methods.microsoft.manual=你的代碼為 <b>%1$s</b>,請點擊此處
126127
account.methods.microsoft.profile=編輯帳戶配置檔
127128
account.methods.microsoft.purchase=購買 Minecraft
128129
account.methods.forgot_password=忘記密碼
130+
account.methods.ban_query=查詢帳戶是否被封禁
129131
account.methods.microsoft.snapshot=你正在使用第三方提供的 HMCL,請下載官方版本進行登入。
130132
account.methods.microsoft.snapshot.website=官方網站
131133
account.methods.offline=離線模式

HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ account.methods.microsoft.error.add_family_probably=请点击上方“编辑账
108108
account.methods.microsoft.error.country_unavailable=你所在的国家或地区不受 Xbox Live 的支持。
109109
account.methods.microsoft.error.missing_xbox_account=请点击上方“创建档案”关联 Xbox 账户。\n你可以点击右上角帮助按钮进行求助。
110110
account.methods.microsoft.error.no_character=请确认你已经购买了 Minecraft: Java 版。\n若已购买,则可能未创建游戏档案,请点击上方“创建档案”以创建游戏档案。\n你可以点击右上角帮助按钮进行求助。
111+
account.methods.microsoft.error.banned=你的账户可能被 Xbox Live 封禁。\n你可以点击上方“检测账户是否被封禁”查看账户状态。
111112
account.methods.microsoft.error.unknown=未知问题。错误码:%d。\n你可以点击右上角帮助按钮进行求助。
112113
account.methods.microsoft.error.wrong_verify_method=请在微软账户登录页面使用密码登录,不要使用验证码登录。\n你可以点击右上角帮助按钮进行求助。
113114
account.methods.microsoft.logging_in=登录中……
@@ -134,6 +135,7 @@ account.methods.microsoft.manual=你需要按照以下步骤添加:\n\
134135
account.methods.microsoft.profile=编辑账户个人信息
135136
account.methods.microsoft.purchase=购买 Minecraft
136137
account.methods.forgot_password=忘记密码
138+
account.methods.ban_query=检测账户是否被封禁
137139
account.methods.microsoft.snapshot=你正在使用第三方提供的 HMCL,请下载官方版本来登录微软账户。
138140
account.methods.microsoft.snapshot.website=官方网站
139141
account.methods.offline=离线模式

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ public String getRedirect() {
315315
return redirect;
316316
}
317317

318+
public static final long BANNED = 2148916227L;
318319
public static final long MISSING_XBOX_ACCOUNT = 2148916233L;
319320
public static final long COUNTRY_UNAVAILABLE = 2148916235L;
320321
public static final long ADD_FAMILY = 2148916238L;

0 commit comments

Comments
 (0)