1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using GFGGame;
- namespace ET
- {
- public class A2C_DisconnectHandler : AMHandler<A2C_Disconnect>
- {
- protected override async ETTask Run(Session session, A2C_Disconnect message)
- {
- session?.GetComponent<DisConnectedCompnent>()?.CancelAlert();
- session.Dispose();
- switch(message.Error)
- {
- case ErrorCode.ERR_loginTimeOut:
- Alert.Show("登录超时,请重新登录!")
- .SetLeftButton(true, "返回登录", (obj) =>
- {
- GameController.QuitToLoginView(false);
- });
- break;
- case ErrorCode.ERR_loginByOther:
- Alert.Show("账号已在其他地方登录!")
- .SetLeftButton(true, "返回登录", (obj) =>
- {
- GameController.QuitToLoginView(true);
- });
- break;
- default:
- Alert.Show("您已被迫下线!");
- break;
- }
- await ETTask.CompletedTask;
- }
- }
- }
|