diff --git a/src/Snap.Hutao/Snap.Hutao.Test/IncomingFeature/SpiralAbyssScheduleIdTest.cs b/src/Snap.Hutao/Snap.Hutao.Test/IncomingFeature/SpiralAbyssScheduleIdTest.cs index ac4b993d..3e00035c 100644 --- a/src/Snap.Hutao/Snap.Hutao.Test/IncomingFeature/SpiralAbyssScheduleIdTest.cs +++ b/src/Snap.Hutao/Snap.Hutao.Test/IncomingFeature/SpiralAbyssScheduleIdTest.cs @@ -6,14 +6,25 @@ namespace Snap.Hutao.Test.IncomingFeature; public class SpiralAbyssScheduleIdTest { private static readonly TimeSpan Utc8 = new(8, 0, 0); + private static readonly DateTimeOffset AcrobaticsBattleIntroducedTime = new(2024, 7, 1, 4, 0, 0, Utc8); [TestMethod] public void Test() { Console.WriteLine($"当前第 {GetForDateTimeOffset(DateTimeOffset.Now)} 期"); - DateTimeOffset dateTimeOffset = new(2020, 7, 1, 4, 0, 0, Utc8); - Console.WriteLine($"2020-07-01 04:00:00 为第 {GetForDateTimeOffset(dateTimeOffset)} 期"); + // 2020-07-01 04:00:00 为第 1 期 + // 2024-06-16 04:00:00 为第 96 期 + // 2024-07-01 04:00:00 为第 97 期 + // 2024-07-16 04:00:00 为第 98 期 + // 2024-08-01 04:00:00 为第 99 期 + Console.WriteLine($"2020-07-01 04:00:00 为第 {GetForDateTimeOffset(new(2020, 07, 01, 4, 0, 0, Utc8))} 期"); + Console.WriteLine($"2024-06-16 04:00:00 为第 {GetForDateTimeOffset(new(2024, 06, 16, 4, 0, 0, Utc8))} 期"); + Console.WriteLine($"2024-07-01 04:00:00 为第 {GetForDateTimeOffset(new(2024, 07, 01, 4, 0, 0, Utc8))} 期"); + Console.WriteLine($"2024-07-16 04:00:00 为第 {GetForDateTimeOffset(new(2024, 07, 16, 4, 0, 0, Utc8))} 期"); + Console.WriteLine($"2024-08-01 04:00:00 为第 {GetForDateTimeOffset(new(2024, 08, 01, 4, 0, 0, Utc8))} 期"); + Console.WriteLine($"2024-08-16 04:00:00 为第 {GetForDateTimeOffset(new(2024, 08, 16, 4, 0, 0, Utc8))} 期"); + Console.WriteLine($"2024-09-01 04:00:00 为第 {GetForDateTimeOffset(new(2024, 09, 01, 4, 0, 0, Utc8))} 期"); } public static int GetForDateTimeOffset(DateTimeOffset dateTimeOffset) @@ -38,6 +49,12 @@ public class SpiralAbyssScheduleIdTest periodNum--; } + if (dateTimeOffset >= AcrobaticsBattleIntroducedTime) + { + // 当超过 96 期时,每一个月一期 + periodNum = (4 * 12 * 2) + ((periodNum - (4 * 12 * 2)) / 2); + } + return periodNum; } } \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/InterProcess/PrivateNamedPipeClient.cs b/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/InterProcess/PrivateNamedPipeClient.cs index 5f3eef36..39332f5a 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/InterProcess/PrivateNamedPipeClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/InterProcess/PrivateNamedPipeClient.cs @@ -19,7 +19,7 @@ internal sealed partial class PrivateNamedPipeClient : IDisposable if (clientStream.TryConnectOnce()) { clientStream.WritePacket(PrivateNamedPipe.Version, PipePacketType.Request, PipePacketCommand.RequestElevationStatus); - clientStream.ReadPacket(stackalloc byte[sizeof(PipePacketHeader)], out ElevationStatusResponse? response); + clientStream.ReadPacket(out PipePacketHeader header, out ElevationStatusResponse? response); ArgumentNullException.ThrowIfNull(response); // Prefer elevated instance diff --git a/src/Snap.Hutao/Snap.Hutao/Model/Metadata/AvatarIds.cs b/src/Snap.Hutao/Snap.Hutao/Model/Metadata/AvatarIds.cs index 7ca4a096..729a8337 100644 --- a/src/Snap.Hutao/Snap.Hutao/Model/Metadata/AvatarIds.cs +++ b/src/Snap.Hutao/Snap.Hutao/Model/Metadata/AvatarIds.cs @@ -97,6 +97,11 @@ internal static class AvatarIds public static readonly AvatarId Navia = 10000091; public static readonly AvatarId Gaming = 10000092; public static readonly AvatarId Xianyun = 10000093; + public static readonly AvatarId Chiori = 10000094; + public static readonly AvatarId Sigewinne = 10000095; + public static readonly AvatarId Arlecchino = 10000096; + public static readonly AvatarId Sethos = 10000097; + public static readonly AvatarId Clorinde = 10000098; /// /// 检查该角色是否为主角