123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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:
- if(string.IsNullOrEmpty(message.Message))
- {
- Alert.Show(message.Message)
- .SetLeftButton(true, "返回登录", (obj) =>
- {
- GameController.QuitToLoginView(true);
- });
- }
- else
- {
- Alert.Show("您已被迫下线!");
- }
- break;
- }
- await ETTask.CompletedTask;
- }
- }
- }
|