Snowflake/RPG.Services.Gameserver/Modules/LoginModule.cs
2024-01-19 18:06:09 +03:00

27 lines
860 B
C#

using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class LoginModule : BaseModule
{
[OnCommand(CmdType.CmdPlayerLoginCsReq)]
public Task OnCmdPlayerLoginCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
PlayerLoginCsReq req = PlayerLoginCsReq.Parser.ParseFrom(body.Span);
Send(session, CmdType.CmdPlayerLoginScRsp, new PlayerLoginScRsp
{
Retcode = 0,
LoginRandom = req.LoginRandom,
Stamina = 160,
ServerTimestampMs = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds(),
BasicInfo = new()
{
Level = 5,
Nickname = "Snowflake"
}
});
return Task.CompletedTask;
}
}