R2G_GetLoginKeyHandler.cs 559 B

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