From 247f02d4234635fe066aef69c5718909e424e797 Mon Sep 17 00:00:00 2001 From: huangyuhui Date: Sun, 22 Jul 2018 18:22:28 +0800 Subject: [PATCH] Friendly prompt to ServerResponseMalformedException --- HMCL/src/main/java/org/jackhuang/hmcl/ui/AddAccountPane.java | 2 ++ HMCL/src/main/resources/assets/lang/I18N.properties | 3 ++- HMCL/src/main/resources/assets/lang/I18N_zh.properties | 3 ++- HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AddAccountPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AddAccountPane.java index a8f1cdcfa..c6f4775bf 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AddAccountPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AddAccountPane.java @@ -263,6 +263,8 @@ public class AddAccountPane extends StackPane { return i18n("account.failed.no_character"); } else if (exception instanceof ServerDisconnectException) { return i18n("account.failed.connect_authentication_server"); + } else if (exception instanceof ServerResponseMalformedException) { + return i18n("account.failed.server_response_malformed"); } else if (exception instanceof RemoteAuthenticationException) { RemoteAuthenticationException remoteException = (RemoteAuthenticationException) exception; String remoteMessage = remoteException.getRemoteMessage(); diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index 51eeb19d6..f0a3bb6b7 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -35,11 +35,12 @@ account.choose=Choose a character account.create=Create a new account account.email=Email account.failed.connect_authentication_server=Cannot connect to the authentication server. Check your network. +account.failed.connect_injector_server=Cannot connect to the authentication server. Check your network and ensure the URL is correct. account.failed.invalid_credentials=Incorrect password, or you are forbidden to login temporarily. account.failed.invalid_password=Invalid password account.failed.invalid_token=Please log out and re-input your password to login. account.failed.no_character=No character in this account. -account.failed.connect_injector_server=Cannot connect to the authentication server. Check your network and ensure the URL is correct. +account.failed.server_response_malformed=Invalid server response. Is this a valid authentication server? account.injector.add=Add an authentication server account.injector.manage=Manage authentication servers account.injector.manage.title=Authentication servers diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index 982ea101e..c1f4d560b 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -35,11 +35,12 @@ account.choose=選擇一個角色 account.create=新建賬戶 account.email=郵箱 account.failed.connect_authentication_server=無法連接認證服務器,可能是網絡問題 +account.failed.connect_injector_server=無法連接認證服務器,可能是網絡故障或 URL 輸入錯誤 account.failed.invalid_credentials=您的用戶名或密碼錯誤,或者登錄次數過多被暫時禁止登錄,請稍後再試 account.failed.invalid_password=無效的密碼 account.failed.invalid_token=請嘗試登出並重新輸入密碼登錄 account.failed.no_character=該帳號沒有角色 -account.failed.connect_injector_server=無法連接認證服務器,可能是網絡故障或 URL 輸入錯誤 +account.failed.server_response_malformed=這個服務器不是合法的登錄驗證服務器 account.injector.add=添加認證服務器 account.injector.manage=管理認證服務器 account.injector.manage.title=認證服務器 diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties index b8fc790ba..e081bff14 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -35,11 +35,12 @@ account.choose=选择一个角色 account.create=新建账户 account.email=邮箱 account.failed.connect_authentication_server=无法连接认证服务器,可能是网络问题 +account.failed.connect_injector_server=无法连接认证服务器,可能是网络故障或 URL 输入错误 account.failed.invalid_credentials=您的用户名或密码错误,或者登录次数过多被暂时禁止登录,请稍后再试 account.failed.invalid_password=无效的密码 account.failed.invalid_token=请尝试登出并重新输入密码登录 account.failed.no_character=该帐号没有角色 -account.failed.connect_injector_server=无法连接认证服务器,可能是网络故障或 URL 输入错误 +account.failed.server_response_malformed=这个服务器不是合法的登录验证服务器 account.injector.add=添加认证服务器 account.injector.manage=管理认证服务器 account.injector.manage.title=认证服务器