mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-14 16:04:36 +01:00
Initial commit
This commit is contained in:
22
nksrv/LobbyServer/Msgs/GetCurrentTime.cs
Normal file
22
nksrv/LobbyServer/Msgs/GetCurrentTime.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs
|
||||
{
|
||||
[PacketPath("/now")]
|
||||
public class GetCurrentTime : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = ReadData<ReqGetNow>();
|
||||
|
||||
var response = new ResGetNow();
|
||||
response.Tick = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||
response.ResetHour = 1;
|
||||
response.CheatShiftDuration = Duration.FromTimeSpan(TimeSpan.FromSeconds(0));
|
||||
// todo: validate response with actual server
|
||||
|
||||
WriteData(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user