R2G_GetLoginKeyHandler.cs 494 B

123456789101112131415161718
  1. using System;
  2. using ETModel;
  3. namespace ETHotfix
  4. {
  5. [MessageHandler(AppType.Gate)]
  6. public class R2G_GetLoginKeyHandler : AMRpcHandler<R2G_GetLoginKey, G2R_GetLoginKey>
  7. {
  8. protected override async ETTask Run(Session session, R2G_GetLoginKey request, G2R_GetLoginKey response, Action reply)
  9. {
  10. long key = RandomHelper.RandInt64();
  11. Game.Scene.GetComponent<GateSessionKeyComponent>().Add(key, request.Account);
  12. response.Key = key;
  13. reply();
  14. await ETTask.CompletedTask;
  15. }
  16. }
  17. }