R2G_GetLoginKeyHandler.cs 589 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Threading.Tasks;
  3. using Base;
  4. using Model;
  5. namespace Controller
  6. {
  7. [MessageHandler(AppType.Gate)]
  8. public class R2G_GetLoginKeyHandler : AMRpcHandler<R2G_GetLoginKey, G2R_GetLoginKey>
  9. {
  10. protected override void Run(Session session, R2G_GetLoginKey message, Action<G2R_GetLoginKey> reply)
  11. {
  12. G2R_GetLoginKey response = new G2R_GetLoginKey();
  13. try
  14. {
  15. long key = Game.Scene.GetComponent<GateSessionKeyComponent>().Get();
  16. response.Key = key;
  17. reply(response);
  18. }
  19. catch (Exception e)
  20. {
  21. ReplyError(response, e, reply);
  22. }
  23. }
  24. }
  25. }