guodong 3 years ago
parent
commit
55fc7ea3c6

+ 1 - 4
GameClient/Assets/Game/HotUpdate/Controller/ErrorCodeController.cs

@@ -4,14 +4,11 @@ namespace GFGGame
 {
     public class ErrorCodeController
     {
+        //返回结果为true时,表示可以继续失败步骤
         public static bool Handler(int errorCode)
         {
             switch(errorCode)
             {
-                case ET.ErrorCode.ERR_Success:
-                    {
-                        return false;
-                    }
                 case ET.ErrorCode.ERR_NetWorkError:
                     {
                         Alert.Show("网络异常")

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -160,6 +160,7 @@ namespace GFGGame
             RechargeDataManager.Instance.Clear();
             GameGlobal.zoneScene.GetComponent<SessionComponent>()?.Disconnect();
             GameGlobal.zoneScene.GetComponent<ServerInfosComponent>()?.ServerInfoList?.Clear();
+            GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();
             if (logout)
             {
                 Logout().Coroutine();

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

@@ -124,6 +124,7 @@ namespace GFGGame
             ViewManager.Hide<ModalStatusView>();
             if (ErrorCodeController.Handler(errorCode))
             {
+                PlatformTapManager.OnQuitGame();
                 ViewManager.Show<LoginInputView>();
             }
         }

+ 0 - 15
GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs

@@ -68,21 +68,6 @@ namespace GFGGame
                 return GameGlobal.myNumericComponent.GetAsInt(NumericType.Liveness);
             }
         }
-        private static string _lastRandomName = null;
-
-        public static string RandomRoleName()
-        {
-            string randomName = null;
-            while (_lastRandomName == randomName || randomName == null)
-            {
-                int len = GameConst.ROLE_NAME_LIST.Length;
-                System.Random random = new System.Random();
-                int i = random.Next(len);
-                randomName = GameConst.ROLE_NAME_LIST[i];
-            }
-            _lastRandomName = randomName;
-            return randomName;
-        }
 
         public static bool CheckPowerFull()
         {

+ 12 - 4
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/AccountInfoComponentSystem.cs

@@ -4,6 +4,14 @@
     {
         public override void Destroy(AccountInfoComponent self)
         {
+            self.Clear();
+        }
+    }
+
+    public static class AccountInfoComponentSystem
+    {
+        public static void Clear(this AccountInfoComponent self)
+        {
             self.Token = string.Empty;
             self.AccountId = 0;
             self.RealmKey = string.Empty;
@@ -11,10 +19,10 @@
             self.Age = 0;
             self.Account = string.Empty;
         }
-    }
-
-    public class AccountInfoComponentSystem
-    {
 
+        public static bool IsLogin(this AccountInfoComponent self)
+        {
+            return self.AccountId > 0;
+        }
     }
 }

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs

@@ -119,7 +119,8 @@ namespace GFGGame
             try
             {
                 var tdsUser = await TDSUser.LoginWithTapTap();
-                Log.Debug($"login Success:{tdsUser}");
+                Log.Debug($"tap login Success:{tdsUser}");
+                _ui.m_btnTapLogin.visible = false;
                 LoginController.LoginTest(tdsUser.ObjectId).Coroutine();
             }
             catch (Exception e)
@@ -140,7 +141,7 @@ namespace GFGGame
         private void UpdateServer(ServerInfo info)
         {
             //登录成功后更新注销按钮显示
-            _ui.m_btnLogout.visible = GameController.CheckLoginCache(false);
+            _ui.m_btnLogout.visible = GameGlobal.zoneScene.GetComponent<AccountInfoComponent>().IsLogin();
             ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
             if (serverInfosComponent.ServerInfoList.Count == 0)
             {