mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-16 17:04:44 +01:00
26 lines
724 B
C#
26 lines
724 B
C#
using Google.Protobuf.WellKnownTypes;
|
|
using EpinelPS.Utils;
|
|
using EpinelPS.Database;
|
|
|
|
namespace EpinelPS.LobbyServer
|
|
{
|
|
[PacketPath("/now")]
|
|
public class GetCurrentTime : LobbyMsgHandler
|
|
{
|
|
protected override async Task HandleAsync()
|
|
{
|
|
ReqGetNow req = await ReadData<ReqGetNow>();
|
|
|
|
ResGetNow response = new()
|
|
{
|
|
Tick = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
|
|
ResetHour = JsonDb.Instance.ResetHourUtcTime,
|
|
CheatShiftDuration = Duration.FromTimeSpan(TimeSpan.FromSeconds(0))
|
|
};
|
|
// todo: valIdate response with actual server
|
|
|
|
await WriteDataAsync(response);
|
|
}
|
|
}
|
|
}
|