lvjincheng 3 лет назад
Родитель
Сommit
bbbb52e83f

+ 7 - 0
Assets/BowArrow/Prefabs/Parts/Home/AuthLoginMask/AuthLoginMask.cs

@@ -31,6 +31,13 @@ public class AuthLoginMask : MonoBehaviour
         }
         }
     }
     }
 
 
+    public void SetRetryCount(int count) {
+        if (gameObject.activeSelf) {
+            GetComponentInChildren<Text>().text = 
+                string.Format(TextAutoLanguage2.GetTextByKey("home_loginAuthRetry"), count);
+        }
+    }
+
     public void SetText(string text) {
     public void SetText(string text) {
         GetComponentInChildren<Text>().text = text;
         GetComponentInChildren<Text>().text = text;
     }
     }

+ 1 - 1
Assets/BowArrow/Prefabs/Parts/Home/AuthLoginMask/AuthLoginMask.prefab

@@ -151,7 +151,7 @@ MonoBehaviour:
     m_AlignByGeometry: 0
     m_AlignByGeometry: 0
     m_RichText: 1
     m_RichText: 1
     m_HorizontalOverflow: 1
     m_HorizontalOverflow: 1
-    m_VerticalOverflow: 0
+    m_VerticalOverflow: 1
     m_LineSpacing: 1
     m_LineSpacing: 1
   m_Text: "\u6B63\u5728\u8BA4\u8BC1\u767B\u5F55\u3002\u3002\u3002"
   m_Text: "\u6B63\u5728\u8BA4\u8BC1\u767B\u5F55\u3002\u3002\u3002"
 --- !u!1 &1943920011359616540
 --- !u!1 &1943920011359616540

+ 1 - 0
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/cn.json

@@ -21,6 +21,7 @@
     "register_phone_placeholder": "点击绑定您的手机号",
     "register_phone_placeholder": "点击绑定您的手机号",
 
 
     "home_loginAuth": "正在认证登录。。。",
     "home_loginAuth": "正在认证登录。。。",
+    "home_loginAuthRetry": "正在认证登录\n(网络出错,重试{0}次)",
 
 
     "me_email": "邮 箱 号 :",
     "me_email": "邮 箱 号 :",
     "me_email_placeholder": "点击绑定您的邮箱号",
     "me_email_placeholder": "点击绑定您的邮箱号",

+ 1 - 0
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/en.json

@@ -21,6 +21,7 @@
     "register_phone_placeholder": "Click to bind your mobile number",
     "register_phone_placeholder": "Click to bind your mobile number",
 
 
     "home_loginAuth": "Authenticating Login ...",
     "home_loginAuth": "Authenticating Login ...",
+    "home_loginAuthRetry": "Authenticating Login\n(Network error, retry {0} time)",
 
 
     "me_email": "Email :",
     "me_email": "Email :",
     "me_email_placeholder": "Click to bind your email number",
     "me_email_placeholder": "Click to bind your email number",

+ 3 - 0
Assets/BowArrow/Scripts/Network/UserPlayer.cs

@@ -90,12 +90,15 @@ public class UserPlayer : JCEntity
     }
     }
     //获取用户信息,超时了就重试
     //获取用户信息,超时了就重试
     private bool _hasExecuteRequestUserInfoAvoidFail = false;
     private bool _hasExecuteRequestUserInfoAvoidFail = false;
+    private int _getUserInfoRetryCount = -1;
     IEnumerator RequestUserInfoAvoidFail()
     IEnumerator RequestUserInfoAvoidFail()
     {
     {
         if (_hasExecuteRequestUserInfoAvoidFail) yield break;
         if (_hasExecuteRequestUserInfoAvoidFail) yield break;
         _hasExecuteRequestUserInfoAvoidFail = true;
         _hasExecuteRequestUserInfoAvoidFail = true;
         while (!_hasGetUserInfo && ins == this) {
         while (!_hasGetUserInfo && ins == this) {
             UserComp.Instance.getUserInfo(DoAfterGetUserInfo);
             UserComp.Instance.getUserInfo(DoAfterGetUserInfo);
+            if (++_getUserInfoRetryCount > 0)
+                AuthLoginMask.ins?.SetRetryCount(_getUserInfoRetryCount); 
             yield return new WaitForSeconds(3.3f);
             yield return new WaitForSeconds(3.3f);
         }
         }
     }
     }