KafkaSR/RPG.Services.Gameserver/Modules/LoginModule.cs

29 lines
889 B
C#
Raw Permalink Normal View History

2024-01-29 23:49:21 +00:00
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 = 180,
ServerTimestampMs = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds(),
BasicInfo = new()
{
Level = 5,
Stamina = 180,
Nickname = "KafkaSR"
}
});
return Task.CompletedTask;
}
}