R2G_GetLoginKeyHandler.cs 543 B

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