mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-13 07:24:52 +01:00
28 lines
847 B
C#
28 lines
847 B
C#
using EpinelPS.Utils;
|
|
using Google.Protobuf.WellKnownTypes;
|
|
|
|
namespace EpinelPS.LobbyServer.Sidestory
|
|
{
|
|
[PacketPath("/sidestory/list")]
|
|
public class ListSideStory : LobbyMsgHandler
|
|
{
|
|
protected override async Task HandleAsync()
|
|
{
|
|
ReqListSideStory req = await ReadData<ReqListSideStory>();
|
|
User user = GetUser();
|
|
|
|
ResListSideStory response = new();
|
|
|
|
foreach (int item in user.CompletedSideStoryStages)
|
|
{
|
|
// TODO cleared at
|
|
response.SideStoryStageDataList.Add(new NetSideStoryStageData() { SideStoryStageId = item, ClearedAt = Timestamp.FromDateTime(DateTime.UtcNow) });
|
|
}
|
|
|
|
response.ViewedSideStoryIds.AddRange(user.ViewedSideStoryStages);
|
|
|
|
await WriteDataAsync(response);
|
|
}
|
|
}
|
|
}
|