Files
Fishing2Server/Hotfix/Outer/Authentication/Handler/C2A_RegisterRequestHandler.cs
2025-07-16 17:47:53 +08:00

25 lines
830 B
C#

using Fantasy;
using Fantasy.Async;
using Fantasy.Network;
using Fantasy.Network.Interface;
namespace Fantasy.Authentication.Handler;
public sealed class C2A_RegisterRequestHandler : MessageRPC<C2A_RegisterRequest, A2C_RegisterResponse>
{
protected override async FTask Run(Session session, C2A_RegisterRequest request, A2C_RegisterResponse response,
Action reply)
{
if (!session.CheckInterval(2000))
{
// 返回这个3代表操作过于频繁。
response.ErrorCode = 3;
return;
}
session.SetTimeout(3000);
response.ErrorCode =
await AuthenticationHelper.Register(session.Scene, request.Username, request.Password, "用户注册");
Log.Debug($"Register 当前的服务器是:{session.Scene.SceneConfigId}");
}
}