From f4e2d82978e2c4c670c151c1cb99addc9488daba Mon Sep 17 00:00:00 2001 From: Mikhail Tyukin Date: Thu, 4 Dec 2025 17:20:31 -0500 Subject: [PATCH] fix side story unread --- .github/workflows/dotnet-desktop.yml | 8 +++---- EpinelPS/EpinelPS.csproj | 2 +- EpinelPS/LobbyServer/LobbyMsgHandler.cs | 14 +++++++++---- .../LobbyServer/Sidestory/ListSideStory.cs | 2 ++ EpinelPS/LobbyServer/Sidestory/SetViewed.cs | 10 ++++++++- .../LobbyServer/Storyline/GetBookmarks.cs | 21 +++++++++++++++++++ .../LobbyServer/Storyline/GetStoryline.cs | 21 +++++++++++++++++++ .../LobbyServer/Storyline/SaveStoryline.cs | 21 +++++++++++++++++++ EpinelPS/Models/UserModel.cs | 1 + 9 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 EpinelPS/LobbyServer/Storyline/GetBookmarks.cs create mode 100644 EpinelPS/LobbyServer/Storyline/GetStoryline.cs create mode 100644 EpinelPS/LobbyServer/Storyline/SaveStoryline.cs diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index b3c19e5..2daddd5 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -18,15 +18,15 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 # Install the .NET Core workload - name: Install .NET 9 - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - name: Setup MSBuild @@ -42,7 +42,7 @@ jobs: run: dotnet publish EpinelPS - name: Copy to output - run: echo ${{ github.workspace }} && md ${{ github.workspace }}/out/ && xcopy /s /e "${{ github.workspace }}\ServerSelector.Desktop\bin\Release\net9.0\win-x64\publish\" "${{ github.workspace }}\out\" && xcopy /s /e "${{ github.workspace }}\EpinelPS\bin\Release\net9.0\win-x64\publish\" "${{ github.workspace }}\out\" && copy "${{ github.workspace }}\ServerSelector.Desktop\sodium.dll" "${{ github.workspace }}\out\sodium.dll" + run: echo ${{ github.workspace }} && md ${{ github.workspace }}/out/ && xcopy /s /e "${{ github.workspace }}\ServerSelector.Desktop\bin\Release\net10.0\win-x64\publish\" "${{ github.workspace }}\out\" && xcopy /s /e "${{ github.workspace }}\EpinelPS\bin\Release\net10.0\win-x64\publish\" "${{ github.workspace }}\out\" && copy "${{ github.workspace }}\ServerSelector.Desktop\sodium.dll" "${{ github.workspace }}\out\sodium.dll" - name: Upload build artifacts uses: actions/upload-artifact@v4 diff --git a/EpinelPS/EpinelPS.csproj b/EpinelPS/EpinelPS.csproj index c7629ec..6eb1a63 100644 --- a/EpinelPS/EpinelPS.csproj +++ b/EpinelPS/EpinelPS.csproj @@ -10,7 +10,7 @@ true True $(NoWarn);SYSLIB0057 - 0.135.4.3 + 0.140.8.0 false true enable diff --git a/EpinelPS/LobbyServer/LobbyMsgHandler.cs b/EpinelPS/LobbyServer/LobbyMsgHandler.cs index 5400e44..bae4d40 100644 --- a/EpinelPS/LobbyServer/LobbyMsgHandler.cs +++ b/EpinelPS/LobbyServer/LobbyMsgHandler.cs @@ -116,8 +116,11 @@ namespace EpinelPS.LobbyServer msg2.MergeFrom(Contents); Logging.WriteLine("Reading " + msg2.GetType().Name, LogType.Debug); - PrintMessage(msg2); - Logging.WriteLine("", LogType.Debug); + if (msg2.GetType().Name != "ReqSyncBadge") + { + PrintMessage(msg2); + Logging.WriteLine("", LogType.Debug); + } return msg2; } @@ -130,8 +133,11 @@ namespace EpinelPS.LobbyServer PacketDecryptResponse bin = await PacketDecryption.DecryptOrReturnContentAsync(ctx); msg.MergeFrom(bin.Contents); - PrintMessage(msg); - Logging.WriteLine("", LogType.Debug); + if (msg.GetType().Name != "ReqSyncBadge") + { + PrintMessage(msg); + Logging.WriteLine("", LogType.Debug); + } UserId = bin.UserId; UsedAuthToken = bin.UsedAuthToken; diff --git a/EpinelPS/LobbyServer/Sidestory/ListSideStory.cs b/EpinelPS/LobbyServer/Sidestory/ListSideStory.cs index e33a984..7ce0bd3 100644 --- a/EpinelPS/LobbyServer/Sidestory/ListSideStory.cs +++ b/EpinelPS/LobbyServer/Sidestory/ListSideStory.cs @@ -19,6 +19,8 @@ namespace EpinelPS.LobbyServer.Sidestory response.SideStoryStageDataList.Add(new NetSideStoryStageData() { SideStoryStageId = item, ClearedAt = Timestamp.FromDateTime(DateTime.UtcNow) }); } + response.ViewedSideStoryIds.AddRange(user.ViewedSideStoryStages); + await WriteDataAsync(response); } } diff --git a/EpinelPS/LobbyServer/Sidestory/SetViewed.cs b/EpinelPS/LobbyServer/Sidestory/SetViewed.cs index c5c52a2..ec29998 100644 --- a/EpinelPS/LobbyServer/Sidestory/SetViewed.cs +++ b/EpinelPS/LobbyServer/Sidestory/SetViewed.cs @@ -1,3 +1,4 @@ +using EpinelPS.Database; using EpinelPS.Utils; namespace EpinelPS.LobbyServer.Sidestory @@ -12,8 +13,15 @@ namespace EpinelPS.LobbyServer.Sidestory ResSetViewSideStory response = new(); - // TODO + foreach (var id in req.ViewedSideStoryIds) + { + if (!user.ViewedSideStoryStages.Contains(id)) + { + user.ViewedSideStoryStages.Add(id); + } + } + JsonDb.Save(); await WriteDataAsync(response); } } diff --git a/EpinelPS/LobbyServer/Storyline/GetBookmarks.cs b/EpinelPS/LobbyServer/Storyline/GetBookmarks.cs new file mode 100644 index 0000000..7e2abdc --- /dev/null +++ b/EpinelPS/LobbyServer/Storyline/GetBookmarks.cs @@ -0,0 +1,21 @@ +using EpinelPS.Utils; + +namespace EpinelPS.LobbyServer.Storyline +{ + [PacketPath("/storyline/bookmark/get")] + public class GetBookmarks : LobbyMsgHandler + { + protected override async Task HandleAsync() + { + ReqGetStorylineBookmarks req = await ReadData(); + + ResGetStorylineBookmarks response = new(); + User user = GetUser(); + + // TODO + + await WriteDataAsync(response); + } + } + +} diff --git a/EpinelPS/LobbyServer/Storyline/GetStoryline.cs b/EpinelPS/LobbyServer/Storyline/GetStoryline.cs new file mode 100644 index 0000000..2f3492a --- /dev/null +++ b/EpinelPS/LobbyServer/Storyline/GetStoryline.cs @@ -0,0 +1,21 @@ +using EpinelPS.Utils; + +namespace EpinelPS.LobbyServer.Storyline +{ + [PacketPath("/storyline/get")] + public class GetStoryline : LobbyMsgHandler + { + protected override async Task HandleAsync() + { + ReqGetStorylineData req = await ReadData(); + + ResGetStorylineData response = new(); + User user = GetUser(); + + // TODO + + await WriteDataAsync(response); + } + } + +} diff --git a/EpinelPS/LobbyServer/Storyline/SaveStoryline.cs b/EpinelPS/LobbyServer/Storyline/SaveStoryline.cs new file mode 100644 index 0000000..9dcbcbf --- /dev/null +++ b/EpinelPS/LobbyServer/Storyline/SaveStoryline.cs @@ -0,0 +1,21 @@ +using EpinelPS.Utils; + +namespace EpinelPS.LobbyServer.Storyline +{ + [PacketPath("/storyline/save")] + public class SaveStoryline : LobbyMsgHandler + { + protected override async Task HandleAsync() + { + ReqSaveRecentStoryline req = await ReadData(); + + ResGetStorylineData response = new(); + User user = GetUser(); + + // TODO + + await WriteDataAsync(response); + } + } + +} diff --git a/EpinelPS/Models/UserModel.cs b/EpinelPS/Models/UserModel.cs index b2284e8..b6335db 100644 --- a/EpinelPS/Models/UserModel.cs +++ b/EpinelPS/Models/UserModel.cs @@ -84,6 +84,7 @@ public class User public int GachaTutorialPlayCount = 0; public List CompletedTacticAcademyLessons = []; public List CompletedSideStoryStages = []; + public List ViewedSideStoryStages = []; public List Memorial = []; public List JukeboxBgm = [];