basic event support

This commit is contained in:
Mikhail
2024-07-06 08:53:48 -04:00
parent 6fb82d5fa7
commit 0e193323ad
10 changed files with 316 additions and 21 deletions

View File

@@ -8,15 +8,66 @@ using System.Threading.Tasks;
namespace nksrv.LobbyServer.Msgs.Event
{
[PacketPath("/event/getjoinedevent")]
public class EnterLobbyPing : LobbyMsgHandler
public class GetJoinedEvent : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqGetJoinedEvent>();
var response = new ResGetJoinedEvent();
response.EventWithJoinData.Add(new NetEventWithJoinData()
{
EventData = new NetEventData()
{
Id = 81301,
EventStartDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventVisibleDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventDisableDate = DateTime.Now.AddDays(20).Ticks,
EventEndDate = DateTime.Now.AddDays(20).Ticks,
EventSystemType = 34
}
});
// TODO
response.EventWithJoinData.Add(new NetEventWithJoinData()
{
EventData = new NetEventData()
{
Id = 81400,
EventStartDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventVisibleDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventDisableDate = DateTime.Now.AddDays(20).Ticks,
EventEndDate = DateTime.Now.AddDays(20).Ticks,
EventSystemType = 10
}
});
response.EventWithJoinData.Add(new NetEventWithJoinData()
{
EventData = new NetEventData()
{
Id = 81401,
EventStartDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventVisibleDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventDisableDate = DateTime.Now.AddDays(20).Ticks,
EventEndDate = DateTime.Now.AddDays(20).Ticks,
EventSystemType = 35
},
JoinAt = 0
});
response.EventWithJoinData.Add(new NetEventWithJoinData()
{
EventData = new NetEventData()
{
Id = 20001,
EventStartDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventVisibleDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventDisableDate = DateTime.Now.AddDays(20).Ticks,
EventEndDate = DateTime.Now.AddDays(20).Ticks,
EventSystemType = 1
},
JoinAt = 0
});
WriteData(response);
}