guodong 3 жил өмнө
parent
commit
28e1fa1236

+ 17 - 1
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/A2C_DisconnectHandler.cs

@@ -10,7 +10,23 @@ namespace ET
     {
         protected override async ETTask Run(Session session, A2C_Disconnect message)
         {
-            Alert.Show("你已被迫下线!");
+            switch(message.Error)
+            {
+                case ErrorCode.ERR_loginTimeOut:
+                    Alert.Show("登录超时,请重新登录!")
+                        .SetLeftButton(true, "返回登录", (obj) =>
+                        {
+                            GameController.QuitToLoginView(false);
+                        });
+                    break;
+                case ErrorCode.ERR_loginByOther:
+                case ErrorCode.ERR_OtherAccountLogin:
+                    Alert.Show("账号已在其他地方登录!");
+                    break;
+                default:
+                    Alert.Show("您已被迫下线!");
+                    break;
+            }
             await ETTask.CompletedTask;
         }
     }

+ 5 - 1
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/DisConnected/DisConnectedCompnentSystem.cs

@@ -10,7 +10,11 @@ namespace ET
     {
         public override void Destroy(DisConnectedCompnent self)
         {
-            Alert.Show("服务器连接已断开!");
+            Alert.Show("服务器连接已断开!")
+                .SetLeftButton(true, "返回登录",(obj) =>
+                {
+                    GameController.QuitToLoginView(false);
+                });
         }
     }