Files
TEngine/Assets/GameScripts/DotNet/Hotfix/Server/Demo/Gate/R2G_GetLoginKeyHandler.cs
ALEXTANG 336d4b2eb9 [+] 接入ET8服务端
[+] 接入ET8服务端
2023-07-13 12:23:48 +08:00

18 lines
501 B
C#

using System;
namespace ET.Server
{
[ActorMessageHandler(SceneType.Gate)]
public class R2G_GetLoginKeyHandler : ActorMessageHandler<Scene, R2G_GetLoginKey, G2R_GetLoginKey>
{
protected override async ETTask Run(Scene scene, R2G_GetLoginKey request, G2R_GetLoginKey response)
{
long key = RandomGenerator.RandInt64();
scene.GetComponent<GateSessionKeyComponent>().Add(key, request.Account);
response.Key = key;
response.GateId = scene.Id;
await ETTask.CompletedTask;
}
}
}