Bläddra i källkod

注销流程修改

guodong 1 år sedan
förälder
incheckning
cb1e2c54ba

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

@@ -13,7 +13,7 @@ namespace GFGGame
                     return true;
                 case ET.ErrorCode.ERR_NetWorkError:
                     {
-                        AlertSystem.Show("网络异常,也有可能是服务器异常,请稍后再试!")
+                        AlertSystem.Show("网络异常,请稍后再试!")
                         .SetRightButton(true, "好的", (object data) =>
                         {
                             GameController.QuitToLoginView(false);

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

@@ -331,14 +331,7 @@ namespace GFGGame
             GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();
             if (logout)
             {
-                if (PlayerPrefs.HasKey(GameConst.PASSWORD_LAST_LOGIN_KEY))
-                {
-                    PlayerPrefs.DeleteKey(GameConst.PASSWORD_LAST_LOGIN_KEY);
-                }
-                if (!fromSdkLogoutCallback)
-                {
-                    QDManager.Logout();
-                }
+                    QDManager.Logout(fromSdkLogoutCallback);
             }
             ViewManager.Hide<GuideView>();
             ViewManager.Show<LoginView>(null, true);

+ 13 - 3
GameClient/Assets/Game/HotUpdate/Platform/QDManager.cs

@@ -1,4 +1,7 @@
-namespace GFGGame
+using ET;
+using UnityEngine;
+
+namespace GFGGame
 {
 
     public class QDManager
@@ -70,12 +73,19 @@
             }
         }
 
-        public static void Logout()
+        public static void Logout(bool fromSdkLogoutCallback)
         {
+            GameGlobal.zoneScene.GetComponent<SessionComponent>()?.Disconnect();
+            GameGlobal.zoneScene.GetComponent<ServerInfosComponent>()?.ServerInfoList?.Clear();
+            GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();
+            if (PlayerPrefs.HasKey(GameConst.PASSWORD_LAST_LOGIN_KEY))
+            {
+                PlayerPrefs.DeleteKey(GameConst.PASSWORD_LAST_LOGIN_KEY);
+            }
             switch (LauncherConfig.ChannelId)
             {
                 default:
-
+                    ViewManager.Show<LoginInputView>();
                     break;
             }
         }

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

@@ -185,7 +185,8 @@ namespace GFGGame
 
         private void OnClickBtnLogout()
         {
-            GameController.QuitToLoginView(true);
+            _ui.m_btnLogout.visible = false;
+            QDManager.Logout(false);
         }
         private void OnClickBtnAge()
         {