25 lines
830 B
C#
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}");
|
|
}
|
|
} |