R2G_GetLoginKeyHandler.cs 499 B

123456789101112131415161718
  1. using System;
  2. namespace ET.Server
  3. {
  4. [ActorMessageHandler(SceneType.Game)]
  5. public class R2G_GetLoginKeyHandler : AMActorRpcHandler<Scene, R2G_GetLoginKey, G2R_GetLoginKey>
  6. {
  7. protected override async ETTask Run(Scene scene, R2G_GetLoginKey request, G2R_GetLoginKey response)
  8. {
  9. long key = RandomGenerator.RandInt64();
  10. scene.GetComponent<GameSessionKeyComponent>().Add(key, request.Account);
  11. response.Key = key;
  12. response.GateId = scene.Id;
  13. await ETTask.CompletedTask;
  14. }
  15. }
  16. }