Skip to content

Commit

Permalink
Merge branch 'develop' into feature/clear-inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
JWJUN233233 authored Jan 10, 2025
2 parents ab6a566 + 9f629b4 commit 90495cd
Show file tree
Hide file tree
Showing 648 changed files with 33,853 additions and 9,337 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Select runner
id: select_runner
run: |
runner_id=36
runner_id=${{ vars.RUNNER_ID }}
runner_status=$(curl -s -X GET -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.RUNNER_CHECK_TOKEN }}" https://api.github.com/orgs/DGP-Studio/actions/runners/$runner_id | jq -r '.status')
if [ "$runner_status" == "online" ]; then
runner=self-hosted
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
git checkout origin/develop
$response = curl -s https://api.github.com/repos/DGP-Studio/Snap.Hutao/pulls?state=open
$refs = $response | ConvertFrom-Json | Where-Object { $_.draft -eq $false } | ForEach-Object { $_.head.ref }
if ($refs.Count -eq 1 -and $refs -eq "l10n_develop") {
if ($refs.Count -eq 0 -or ($refs.Count -eq 1 -and $refs -eq "l10n_develop")) {
echo "No PRs to merge"
$continue = $false
echo "continue=$continue" >> $Env:GITHUB_OUTPUT
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Binary file added res/HutaoLogo2/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/HutaoLogo2/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/HutaoLogo2/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/HutaoLogo2/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/HutaoLogo2/MSIX Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/HutaoLogo2/Main logo.psd
Binary file not shown.
Binary file added res/HutaoLogo2/No-padding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/HutaoLogo2/No-padding.psd
Binary file not shown.
1 change: 1 addition & 0 deletions res/HutaoLogo2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright © 2025 DGP Studio, All Rights Reserved.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

Expand Down Expand Up @@ -188,6 +189,7 @@ string ToJson()
}
}

[SuppressMessage("", "CS0649")]
private struct SampleStruct
{
[JsonInclude]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Buffers.Binary;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;

Expand Down Expand Up @@ -96,23 +97,23 @@ public unsafe void GeniusInvokationShareCodeDecoding()
// Grouping each 3 bytes and read out as 2 ushort with
// 12 bits each (Big Endian)
// ----------------------------------------------------------
// 00000011 1100·0000 00010011|
// 00000000 0001·0000 01001111|
// 00000111 1000·0000 01111000|
// 00001000 0001·0000 10010111|
// 00001001 0111·0000 10011001|
// 00001001 1001·0000 10110101|
// 00001011 1000·0000 10111000|
// 00001011 1001·0000 10111001|
// 00000011 1100·0000 00010011|
// 00000000 0001·0000 01001111|
// 00000111 1000·0000 01111000|
// 00001000 0001·0000 10010111|
// 00001001 0111·0000 10011001|
// 00001001 1001·0000 10110101|
// 00001011 1000·0000 10111000|
// 00001011 1001·0000 10111001|
// 00001100 0010·0000 11000010|
// 00001100 1000·0000 11001000|
// 00001100 1001·0000 11001001|
// 00001101 1001·0000 11011001|
// 00001101 1011·0000 11110001|
// 00001111 0001·0000 11110100|
// 00001111 0100·0000 11110101|
// 00001111 0101·0001 00001110|
// 00010000 1110·0000 -padding|[padding32]
// 00001100 1000·0000 11001000|
// 00001100 1001·0000 11001001|
// 00001101 1001·0000 11011001|
// 00001101 1011·0000 11110001|
// 00001111 0001·0000 11110100|
// 00001111 0100·0000 11110101|
// 00001111 0101·0001 00001110|
// 00010000 1110·0000 -padding|[padding32]
// ----------------------------------------------------------
// reinterpret as DecodeGroupingHelper for each 3 bytes
DecodeGroupingHelper* pGroup = (DecodeGroupingHelper*)&rearranged;
Expand Down Expand Up @@ -199,6 +200,7 @@ public unsafe void GeniusInvokationShareCodeDecoding()
}
}

[SuppressMessage("", "CS0649")]
private struct EncryptedDataAndKey
{
public unsafe fixed byte Data[50];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ public void GenerateJson()
{
Chinese = new()
{
MickeyWonderMethod = 0x08474680,
MickeyWonderMethodPartner = 0x00950C30,
MickeyWonderMethodPartner2 = 0x0588D680,
SetFieldOfView = 0x0188FD10,
SetTargetFrameRate = 0x015DB980,
SetEnableFogRendering = 0x013F6B00,
OpenTeam = 0x08699B90,
OpenTeamPageAccordingly = 0x08695AE0,
CheckCanEnter = 0x0724A030
MickeyWonderMethod = 0x0929D180,
MickeyWonderMethodPartner = 0x00460FE0,
MickeyWonderMethodPartner2 = 0x05BCEC60,
SetFieldOfView = 0x00F0A370,
SetTargetFrameRate = 0x00F0EC30,
SetEnableFogRendering = 0x00F0D5A0,
OpenTeam = 0x07C97130,
OpenTeamPageAccordingly = 0x07CB71C0,
CheckCanEnter = 0x069F0C00
},
Oversea = new()
{
MickeyWonderMethod = 0x0916F3B0,
MickeyWonderMethodPartner = 0x00955AB0,
MickeyWonderMethodPartner2 = 0x05892DE0,
SetFieldOfView = 0x01894C30,
SetTargetFrameRate = 0x015E08A0,
SetEnableFogRendering = 0x013FBA20,
OpenTeam = 0x086A32A0,
OpenTeamPageAccordingly = 0x086A4C60,
CheckCanEnter = 0x0711ED60
MickeyWonderMethod = 0x08FC3AA0,
MickeyWonderMethodPartner = 0x0045F640,
MickeyWonderMethodPartner2 = 0x05D1D050,
SetFieldOfView = 0x00F08370,
SetTargetFrameRate = 0x00F0CC30,
SetEnableFogRendering = 0x00F0B5A0,
OpenTeam = 0x07EB04C0,
OpenTeamPageAccordingly = 0x07EC3A40,
CheckCanEnter = 0x06147B80
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand Down Expand Up @@ -101,6 +102,7 @@ public SizeInt32(int width, int height)
}
}

[SuppressMessage("", "CS0649")]
private readonly struct TestStruct
{
public readonly int Value1;
Expand Down
6 changes: 3 additions & 3 deletions src/Snap.Hutao/Snap.Hutao.Test/Snap.Hutao.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="MSTest.TestAdapter" Version="3.7.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.0" />
<PackageReference Include="coverlet.collector" Version="6.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 2 additions & 0 deletions src/Snap.Hutao/Snap.Hutao/ApiEndpoints.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ Name,CN,OS
AccountCreateActionTicket(),https://passport-api.mihoyo.com/account/ma-cn-verifier/app/createActionTicketByToken,
AccountCreateAuthTicketByGameBiz(),https://passport-api.mihoyo.com/account/ma-cn-verifier/app/createAuthTicketByGameBiz,https://sg-public-api.hoyoverse.com/account/ma-verifier/api/createAuthTicketBySToken
AccountCreateLoginCaptcha(),https://passport-api.mihoyo.com/account/ma-cn-verifier/verifier/createLoginCaptcha,
AccountCreateQrLogin(),https://passport-api.mihoyo.com/account/ma-cn-passport/app/createQRLogin,
AccountGetCookieTokenBySToken(),https://passport-api.mihoyo.com/account/auth/api/getCookieAccountInfoBySToken,https://api-account-os.hoyoverse.com/account/auth/api/getCookieAccountInfoBySToken
AccountGetLTokenBySToken(),https://passport-api.mihoyo.com/account/auth/api/getLTokenBySToken,https://api-account-os.hoyoverse.com/account/auth/api/getLTokenBySToken
AccountGetSTokenByGameToken(),https://passport-api.mihoyo.com/account/ma-cn-session/app/getTokenByGameToken,
AccountGetSTokenByOldToken(),https://passport-api.mihoyo.com/account/ma-cn-session/app/getTokenBySToken,
AccountLoginByMobileCaptcha(),https://passport-api.mihoyo.com/account/ma-cn-passport/app/loginByMobileCaptcha,
AccountLoginByPassword(),https://passport-api.mihoyo.com/account/ma-cn-passport/app/loginByPassword,https://sg-public-api.hoyoverse.com/account/ma-passport/api/appLoginByPassword
AccountLoginByThirdParty(),,https://sg-public-api.hoyoverse.com/account/ma-passport/api/appLoginByThirdParty
AccountQueryQrLoginStatus(),https://passport-api.mihoyo.com/account/ma-cn-passport/app/queryQRLoginStatus,
AccountVerifyLtoken(),https://passport-api-v4.mihoyo.com/account/ma-cn-session/web/verifyLtoken,
ActHoyolabReferer(),,https://act.hoyolab.com/
"AnnContent(string languageCode, Region region)","https://hk4e-ann-api.mihoyo.com/common/hk4e_cn/announcement/api/getAnnContent?{AnnouncementQuery(languageCode, region)}","https://sg-hk4e-api.hoyoverse.com/common/hk4e_global/announcement/api/getAnnContent?{AnnouncementQuery(languageCode, region)}"
Expand Down
10 changes: 8 additions & 2 deletions src/Snap.Hutao/Snap.Hutao/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _____ _ _ _
|_|
Snap.Hutao is a open source software developed by DGP Studio.
Copyright (C) 2022 - 2024 DGP Studio, All Rights Reserved.
Copyright (C) 2022 - 2025 DGP Studio, All Rights Reserved.
----------------------------------------------------------------
""";

Expand All @@ -42,13 +42,19 @@ Snap.Hutao is a open source software developed by DGP Studio.

public App(IServiceProvider serviceProvider)
{
logger = serviceProvider.GetRequiredService<ILogger<App>>();
Gen2GcCallback.Register(() =>
{
logger.LogDebug("Gen2 GC is triggered.");
return true;
});

// Load app resource
InitializeComponent();

ExceptionHandlingSupport.Initialize(serviceProvider, this);

activation = serviceProvider.GetRequiredService<IAppActivation>();
logger = serviceProvider.GetRequiredService<ILogger<App>>();
this.serviceProvider = serviceProvider;
}

Expand Down
Binary file added src/Snap.Hutao/Snap.Hutao/Assets/InAppLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/LargeTile.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/LargeTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/LargeTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/LargeTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/LargeTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Logo.ico
Binary file not shown.
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SmallTile.scale-100.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SmallTile.scale-125.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SmallTile.scale-150.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SmallTile.scale-200.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SmallTile.scale-400.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SplashScreen.scale-100.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SplashScreen.scale-125.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SplashScreen.scale-150.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SplashScreen.scale-200.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/SplashScreen.scale-400.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Square44x44Logo.scale-100.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Square44x44Logo.scale-125.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Square44x44Logo.scale-150.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Square44x44Logo.scale-200.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Square44x44Logo.scale-400.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Square44x44Logo.targetsize-48.png
Binary file removed src/Snap.Hutao/Snap.Hutao/Assets/StoreLogo.png
Diff not rendered.
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/StoreLogo.scale-100.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/StoreLogo.scale-125.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/StoreLogo.scale-150.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/StoreLogo.scale-200.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/StoreLogo.scale-400.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Wide310x150Logo.scale-125.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Wide310x150Logo.scale-150.png
Binary file modified src/Snap.Hutao/Snap.Hutao/Assets/Wide310x150Logo.scale-200.png
9 changes: 9 additions & 0 deletions src/Snap.Hutao/Snap.Hutao/Core/Abstraction/ITypeName.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.

namespace Snap.Hutao.Core.Abstraction;

internal interface ITypeName
{
string TypeName { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
using Snap.Hutao.Core.Logging;
using Snap.Hutao.Service.Hutao;
using Snap.Hutao.ViewModel.Guide;
using Snap.Hutao.Web.Endpoint.Hutao;
using Snap.Hutao.Web.Hutao;
using Snap.Hutao.Web.Request.Builder;
using Snap.Hutao.Web.Request.Builder.Abstraction;
using System.Collections.Frozen;
Expand All @@ -31,6 +33,7 @@ internal sealed partial class ImageCacheDownloadOperation : IImageCacheDownloadO
private readonly IHttpRequestMessageBuilderFactory httpRequestMessageBuilderFactory;
private readonly ILogger<ImageCacheDownloadOperation> logger;
private readonly IHttpClientFactory httpClientFactory;
private readonly HutaoUserOptions hutaoUserOptions;

public async ValueTask DownloadFileAsync(Uri uri, string baseFile)
{
Expand All @@ -47,6 +50,8 @@ public async ValueTask DownloadFileAsync(Uri uri, string baseFile)
.SetStaticResourceControlHeadersIf(shouldAddControlHeader)
.Get();

await requestMessageBuilder.InfrastructureSetTraceInfoAsync(hutaoUserOptions).ConfigureAwait(false);

while (retryCount < 3)
{
requestMessageBuilder.Resurrect();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.

using System.Collections;
using System.Collections.Immutable;

namespace Snap.Hutao.Core.Collection;

internal sealed class ImmutableArrayEnumeratorNoThrow<T> : IEnumerator<T>
{
private readonly ImmutableArray<T> array;
private int index;

public ImmutableArrayEnumeratorNoThrow(ImmutableArray<T> array)
{
this.array = array;
index = -1;
}

public T Current { get => index < array.Length ? array[index] : default!; }

object? IEnumerator.Current { get => Current; }

public bool MoveNext()
{
return ++index < array.Length;
}

public void Reset()
{
index = -1;
}

public void Dispose()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.

using JetBrains.Annotations;
using System.Collections.Immutable;

namespace Snap.Hutao.Core.Collection;

internal sealed partial class TwoEnumerableEnumerator<TFirst, TSecond> : IDisposable
{
private readonly IEnumerator<TFirst> firstEnumerator;
private readonly IEnumerator<TSecond> secondEnumerator;

public TwoEnumerableEnumerator(IEnumerable<TFirst> firstEnumerable, IEnumerable<TSecond> secondEnumerable)
{
firstEnumerator = GetNoThrowEnumeratorIfPossible(firstEnumerable);
secondEnumerator = GetNoThrowEnumeratorIfPossible(secondEnumerable);
}

public (TFirst? First, TSecond? Second) Current { get => (firstEnumerator.Current, secondEnumerator.Current); }

public bool MoveNext(ref bool moveFirst, ref bool moveSecond)
{
moveFirst = moveFirst && firstEnumerator.MoveNext();
moveSecond = moveSecond && secondEnumerator.MoveNext();

return moveFirst || moveSecond;
}

public void Dispose()
{
firstEnumerator.Dispose();
secondEnumerator.Dispose();
}

[MustDisposeResource]
private static IEnumerator<T> GetNoThrowEnumeratorIfPossible<T>(IEnumerable<T> enumerable)
{
if (enumerable is ImmutableArray<T> immutableArray)
{
return new ImmutableArrayEnumeratorNoThrow<T>(immutableArray);
}

return enumerable.GetEnumerator();
}
}

This file was deleted.

Loading

0 comments on commit 90495cd

Please sign in to comment.