A2C_DisconnectHandler.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using GFGGame;
  6. namespace ET
  7. {
  8. public class A2C_DisconnectHandler : AMHandler<A2C_Disconnect>
  9. {
  10. protected override async ETTask Run(Session session, A2C_Disconnect message)
  11. {
  12. switch(message.Error)
  13. {
  14. case ErrorCode.ERR_loginTimeOut:
  15. Alert.Show("登录超时,请重新登录!")
  16. .SetLeftButton(true, "返回登录", (obj) =>
  17. {
  18. GameController.QuitToLoginView(false);
  19. });
  20. break;
  21. case ErrorCode.ERR_loginByOther:
  22. case ErrorCode.ERR_OtherAccountLogin:
  23. Alert.Show("账号已在其他地方登录!");
  24. break;
  25. default:
  26. Alert.Show("您已被迫下线!");
  27. break;
  28. }
  29. await ETTask.CompletedTask;
  30. }
  31. }
  32. }