mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
remove redundant attribute
This commit is contained in:
@@ -25,7 +25,6 @@ internal static class AppInstanceExtension
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="appInstance">app实例</param>
|
/// <param name="appInstance">app实例</param>
|
||||||
/// <param name="args">参数</param>
|
/// <param name="args">参数</param>
|
||||||
[SuppressMessage("", "VSTHRD002")]
|
|
||||||
public static unsafe void RedirectActivationTo(this AppInstance appInstance, AppActivationArguments args)
|
public static unsafe void RedirectActivationTo(this AppInstance appInstance, AppActivationArguments args)
|
||||||
{
|
{
|
||||||
redirectEventHandle = CreateEvent(default(SECURITY_ATTRIBUTES*), true, false, null);
|
redirectEventHandle = CreateEvent(default(SECURITY_ATTRIBUTES*), true, false, null);
|
||||||
|
|||||||
@@ -11,19 +11,16 @@ internal readonly struct Delay
|
|||||||
/// <param name="minMilliSeconds">最小,闭</param>
|
/// <param name="minMilliSeconds">最小,闭</param>
|
||||||
/// <param name="maxMilliSeconds">最小,开</param>
|
/// <param name="maxMilliSeconds">最小,开</param>
|
||||||
/// <returns>任务</returns>
|
/// <returns>任务</returns>
|
||||||
[SuppressMessage("", "VSTHRD200")]
|
|
||||||
public static ValueTask Random(int minMilliSeconds, int maxMilliSeconds)
|
public static ValueTask Random(int minMilliSeconds, int maxMilliSeconds)
|
||||||
{
|
{
|
||||||
return Task.Delay((int)(System.Random.Shared.NextDouble() * (maxMilliSeconds - minMilliSeconds)) + minMilliSeconds).AsValueTask();
|
return Task.Delay((int)(System.Random.Shared.NextDouble() * (maxMilliSeconds - minMilliSeconds)) + minMilliSeconds).AsValueTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("", "VSTHRD200")]
|
|
||||||
public static ValueTask FromSeconds(int seconds)
|
public static ValueTask FromSeconds(int seconds)
|
||||||
{
|
{
|
||||||
return Task.Delay(TimeSpan.FromSeconds(seconds)).AsValueTask();
|
return Task.Delay(TimeSpan.FromSeconds(seconds)).AsValueTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("", "VSTHRD200")]
|
|
||||||
public static ValueTask FromMilliSeconds(int seconds)
|
public static ValueTask FromMilliSeconds(int seconds)
|
||||||
{
|
{
|
||||||
return Task.Delay(TimeSpan.FromMilliseconds(seconds)).AsValueTask();
|
return Task.Delay(TimeSpan.FromMilliseconds(seconds)).AsValueTask();
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ internal class DispatcherQueueProgress<T> : IProgress<T>
|
|||||||
|
|
||||||
public event EventHandler<T>? ProgressChanged;
|
public event EventHandler<T>? ProgressChanged;
|
||||||
|
|
||||||
[SuppressMessage("", "VSTHRD001")]
|
|
||||||
public void Report(T value)
|
public void Report(T value)
|
||||||
{
|
{
|
||||||
Action<T>? handler = this.handler;
|
Action<T>? handler = this.handler;
|
||||||
|
|||||||
@@ -225,14 +225,8 @@ internal sealed partial class GameService : IGameService
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (launchOptions.MultipleInstances)
|
return Process.GetProcessesByName(YuanShenProcessName) is [_, ..]
|
||||||
{
|
|| Process.GetProcessesByName(GenshinImpactProcessName) is [_, ..];
|
||||||
// If multiple instances is enabled, always treat as not running.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Process.GetProcessesByName(YuanShenProcessName).Any()
|
|
||||||
|| Process.GetProcessesByName(GenshinImpactProcessName).Any();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
@@ -254,13 +248,7 @@ internal sealed partial class GameService : IGameService
|
|||||||
|
|
||||||
game.Start();
|
game.Start();
|
||||||
|
|
||||||
bool isAdvancedOptionsAllowed = runtimeOptions.IsElevated && appOptions.IsAdvancedLaunchOptionsEnabled;
|
if (runtimeOptions.IsElevated && appOptions.IsAdvancedLaunchOptionsEnabled && launchOptions.UnlockFps)
|
||||||
if (isAdvancedOptionsAllowed && launchOptions.MultipleInstances && !isFirstInstance)
|
|
||||||
{
|
|
||||||
ProcessInterop.DisableProtection(game, gamePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isAdvancedOptionsAllowed && launchOptions.UnlockFps)
|
|
||||||
{
|
{
|
||||||
await ProcessInterop.UnlockFpsAsync(serviceProvider, game, default).ConfigureAwait(false);
|
await ProcessInterop.UnlockFpsAsync(serviceProvider, game, default).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ internal sealed class LaunchOptions : DbStoreOptions
|
|||||||
private bool? unlockFps;
|
private bool? unlockFps;
|
||||||
private int? targetFps;
|
private int? targetFps;
|
||||||
private NameValue<int>? monitor;
|
private NameValue<int>? monitor;
|
||||||
private bool? multipleInstances;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造一个新的启动游戏选项
|
/// 构造一个新的启动游戏选项
|
||||||
@@ -151,15 +150,6 @@ internal sealed class LaunchOptions : DbStoreOptions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 多开启动原神
|
|
||||||
/// </summary>
|
|
||||||
public bool MultipleInstances
|
|
||||||
{
|
|
||||||
get => GetOption(ref multipleInstances, SettingEntry.MultipleInstances);
|
|
||||||
set => SetOption(ref multipleInstances, SettingEntry.MultipleInstances, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void InitializeMonitors(List<NameValue<int>> monitors)
|
private static void InitializeMonitors(List<NameValue<int>> monitors)
|
||||||
{
|
{
|
||||||
// This list can't use foreach
|
// This list can't use foreach
|
||||||
|
|||||||
@@ -214,17 +214,6 @@
|
|||||||
|
|
||||||
<StackPanel Spacing="{StaticResource SettingsCardSpacing}" Visibility="{Binding AppOptions.IsAdvancedLaunchOptionsEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}" Visibility="{Binding AppOptions.IsAdvancedLaunchOptionsEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageLaunchGameAdvanceHeader}"/>
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageLaunchGameAdvanceHeader}"/>
|
||||||
<cwc:SettingsCard
|
|
||||||
Description="{shcm:ResourceString Name=ViewPageLaunchGameMultipleInstancesDescription}"
|
|
||||||
Header="{shcm:ResourceString Name=ViewPageLaunchGameMultipleInstancesHeader}"
|
|
||||||
HeaderIcon="{shcm:FontIcon Glyph=}"
|
|
||||||
IsEnabled="{Binding HutaoOptions.IsElevated}">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<shvc:Elevation Visibility="{Binding HutaoOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
|
|
||||||
<ToggleSwitch Width="120" IsOn="{Binding Options.MultipleInstances, Mode=TwoWay}"/>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
</cwc:SettingsCard>
|
|
||||||
<cwc:SettingsCard
|
<cwc:SettingsCard
|
||||||
Description="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsDescription}"
|
Description="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsDescription}"
|
||||||
Header="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsHeader}"
|
Header="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsHeader}"
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ internal sealed partial class LoginHoyoverseUserPage : Microsoft.UI.Xaml.Control
|
|||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("", "VSTHRD100")]
|
|
||||||
private async void OnRootLoaded(object sender, RoutedEventArgs e)
|
private async void OnRootLoaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ internal sealed partial class LoginMihoyoUserPage : Microsoft.UI.Xaml.Controls.P
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("", "VSTHRD100")]
|
|
||||||
private async void OnRootLoaded(object sender, RoutedEventArgs e)
|
private async void OnRootLoaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -375,7 +375,6 @@ internal class MiHoYoJSInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("", "VSTHRD100")]
|
|
||||||
private async void OnWebMessageReceived(CoreWebView2 webView2, CoreWebView2WebMessageReceivedEventArgs args)
|
private async void OnWebMessageReceived(CoreWebView2 webView2, CoreWebView2WebMessageReceivedEventArgs args)
|
||||||
{
|
{
|
||||||
string message = args.TryGetWebMessageAsString();
|
string message = args.TryGetWebMessageAsString();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ internal readonly struct PlayerUid
|
|||||||
{
|
{
|
||||||
Must.Argument(value.Length == 9, "uid 应为9位数字");
|
Must.Argument(value.Length == 9, "uid 应为9位数字");
|
||||||
Value = value;
|
Value = value;
|
||||||
Region = region ?? EvaluateRegion(value[0]);
|
Region = region ?? EvaluateRegion(value.AsSpan()[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator PlayerUid(string source)
|
public static implicit operator PlayerUid(string source)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace Snap.Hutao.Web.Hoyolab.Takumi.Event.BbsSignReward;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 补签说明
|
/// 补签说明
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SignInRewardReSignInfo
|
internal sealed class SignInRewardReSignInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当日补签次数
|
/// 当日补签次数
|
||||||
|
|||||||
Reference in New Issue
Block a user