35 lines
1 KiB
C#
35 lines
1 KiB
C#
using RPG.Network.Proto;
|
|
using RPG.Services.Gameserver.Modules.Attributes;
|
|
using RPG.Services.Gameserver.Session;
|
|
|
|
namespace RPG.Services.Gameserver.Modules;
|
|
internal class PlayerModule : BaseModule
|
|
{
|
|
[OnCommand(CmdType.CmdSyncTimeCsReq)]
|
|
public Task OnCmdSyncTimeCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
|
|
{
|
|
SyncTimeCsReq req = SyncTimeCsReq.Parser.ParseFrom(body.Span);
|
|
|
|
// TODO: TimeManager
|
|
|
|
Send(session, CmdType.CmdSyncTimeScRsp, new SyncTimeScRsp
|
|
{
|
|
ServerTimeMs = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds(),
|
|
ClientTimeMs = req.ClientTimeMs,
|
|
Retcode = 0
|
|
});
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
[OnCommand(CmdType.CmdGetStaminaExchangeCsReq)]
|
|
public Task OnCmdGetStaminaExchangeCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
|
|
{
|
|
Send(session, CmdType.CmdGetStaminaExchangeScRsp, new GetStaminaExchangeScRsp
|
|
{
|
|
Retcode = 0
|
|
});
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|