G2M_SessionDisconnectHandler.cs 617 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Threading.Tasks;
  3. using ETModel;
  4. namespace ETHotfix
  5. {
  6. [ActorMessageHandler(AppType.Map)]
  7. public class G2M_SessionDisconnectHandler : AMActorRpcHandler<Unit, G2M_SessionDisconnect, ActorResponse>
  8. {
  9. protected override async Task Run(Unit unit, G2M_SessionDisconnect message, Action<ActorResponse> reply)
  10. {
  11. ActorResponse actorResponse = new ActorResponse();
  12. try
  13. {
  14. unit.GetComponent<UnitGateComponent>().IsDisconnect = true;
  15. reply(actorResponse);
  16. }
  17. catch (Exception e)
  18. {
  19. ReplyError(actorResponse, e, reply);
  20. }
  21. await Task.CompletedTask;
  22. }
  23. }
  24. }