guodong 3 жил өмнө
parent
commit
a32e153d24

+ 7 - 2
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/A2C_DisconnectHandler.cs

@@ -10,6 +10,8 @@ namespace ET
     {
         protected override async ETTask Run(Session session, A2C_Disconnect message)
         {
+            session.RemoveComponent<DisConnectedCompnent>();
+            session.Dispose();
             switch(message.Error)
             {
                 case ErrorCode.ERR_loginTimeOut:
@@ -20,8 +22,11 @@ namespace ET
                         });
                     break;
                 case ErrorCode.ERR_loginByOther:
-                case ErrorCode.ERR_OtherAccountLogin:
-                    Alert.Show("账号已在其他地方登录!");
+                    Alert.Show("账号已在其他地方登录!")
+                        .SetLeftButton(true, "返回登录", (obj) =>
+                        {
+                            GameController.QuitToLoginView(true);
+                        });
                     break;
                 default:
                     Alert.Show("您已被迫下线!");

+ 2 - 1
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs

@@ -94,7 +94,8 @@ namespace ET
                 zoneScene.AddComponent<SessionComponent>();
             }
             zoneScene.GetComponent<SessionComponent>().Session = accountSession;
-            zoneScene.GetComponent<SessionComponent>().Session.AddComponent<PingComponent>();
+            accountSession.AddComponent<PingComponent>();
+            accountSession.AddComponent<DisConnectedCompnent>();
             AccountInfoComponent accountInfoComponent = zoneScene.GetComponent<AccountInfoComponent>();
             accountInfoComponent.Token = a2CLoginAccount.Token;
             accountInfoComponent.AccountId = a2CLoginAccount.AccountId;