mirror of
https://github.com/wangdage12/Snap.Hutao.git
synced 2026-02-18 02:42:15 +08:00
Compare commits
2 Commits
db6df72791
...
5fad9ad855
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fad9ad855 | ||
|
|
1ed2f4f29e |
Binary file not shown.
@@ -2,7 +2,7 @@
|
|||||||
<Package
|
<Package
|
||||||
Name="Snap.Hutao"
|
Name="Snap.Hutao"
|
||||||
Manufacturer="Millennium Science Technology R-D Inst"
|
Manufacturer="Millennium Science Technology R-D Inst"
|
||||||
Version="1.17.4.0"
|
Version="1.18.1.0"
|
||||||
UpgradeCode="121203be-60cb-408f-92cc-7080f6598e68"
|
UpgradeCode="121203be-60cb-408f-92cc-7080f6598e68"
|
||||||
Scope="perMachine">
|
Scope="perMachine">
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<Identity
|
<Identity
|
||||||
Name="60568DGPStudio.SnapHutao"
|
Name="60568DGPStudio.SnapHutao"
|
||||||
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
|
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
|
||||||
Version="1.18.0.0" />
|
Version="1.18.1.0" />
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>Snap Hutao</DisplayName>
|
<DisplayName>Snap Hutao</DisplayName>
|
||||||
|
|||||||
@@ -139,6 +139,13 @@ internal sealed class GameFpsUnlockInterop : IGameIslandInterop, IDisposable
|
|||||||
category: "fps.unlocker",
|
category: "fps.unlocker",
|
||||||
level: Sentry.BreadcrumbLevel.Info);
|
level: Sentry.BreadcrumbLevel.Info);
|
||||||
|
|
||||||
|
// 构建游戏启动参数,传递给 unlockfps.exe
|
||||||
|
string gameArguments = BuildGameArguments(context);
|
||||||
|
SentrySdk.AddBreadcrumb(
|
||||||
|
$"Game arguments for unlocker: {gameArguments}",
|
||||||
|
category: "fps.unlocker",
|
||||||
|
level: Sentry.BreadcrumbLevel.Info);
|
||||||
|
|
||||||
ProcessStartInfo startInfo = new()
|
ProcessStartInfo startInfo = new()
|
||||||
{
|
{
|
||||||
FileName = unlockerPath,
|
FileName = unlockerPath,
|
||||||
@@ -148,11 +155,12 @@ internal sealed class GameFpsUnlockInterop : IGameIslandInterop, IDisposable
|
|||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
RedirectStandardError = true,
|
RedirectStandardError = true,
|
||||||
WindowStyle = ProcessWindowStyle.Normal,
|
WindowStyle = ProcessWindowStyle.Normal,
|
||||||
|
Arguments = gameArguments,
|
||||||
};
|
};
|
||||||
|
|
||||||
unlockerProcess = new Process { StartInfo = startInfo };
|
unlockerProcess = new Process { StartInfo = startInfo };
|
||||||
|
|
||||||
|
|
||||||
unlockerProcess.Start();
|
unlockerProcess.Start();
|
||||||
|
|
||||||
|
|
||||||
@@ -170,7 +178,7 @@ internal sealed class GameFpsUnlockInterop : IGameIslandInterop, IDisposable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Task errorTask = Task.Run(async () =>
|
Task errorTask = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
while (!unlockerProcess.StandardError.EndOfStream)
|
while (!unlockerProcess.StandardError.EndOfStream)
|
||||||
@@ -197,6 +205,53 @@ internal sealed class GameFpsUnlockInterop : IGameIslandInterop, IDisposable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string BuildGameArguments(BeforeLaunchExecutionContext context)
|
||||||
|
{
|
||||||
|
LaunchOptions launchOptions = context.LaunchOptions;
|
||||||
|
|
||||||
|
if (!launchOptions.AreCommandLineArgumentsEnabled.Value)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder arguments = new();
|
||||||
|
|
||||||
|
// 构建与 GameProcessFactory.CreateForDefault 相同的命令行参数
|
||||||
|
if (launchOptions.IsBorderless.Value)
|
||||||
|
{
|
||||||
|
arguments.Append(" -popupwindow");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (launchOptions.IsExclusive.Value)
|
||||||
|
{
|
||||||
|
arguments.Append(" -window-mode exclusive");
|
||||||
|
}
|
||||||
|
|
||||||
|
arguments.Append($" -screen-fullscreen {(launchOptions.IsFullScreen.Value ? "1" : "0")}");
|
||||||
|
|
||||||
|
if (launchOptions.IsScreenWidthEnabled.Value)
|
||||||
|
{
|
||||||
|
arguments.Append($" -screen-width {launchOptions.ScreenWidth.Value}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (launchOptions.IsScreenHeightEnabled.Value)
|
||||||
|
{
|
||||||
|
arguments.Append($" -screen-height {launchOptions.ScreenHeight.Value}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (launchOptions.IsMonitorEnabled.Value)
|
||||||
|
{
|
||||||
|
arguments.Append($" -monitor {launchOptions.Monitor.Value?.Value ?? 1}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (launchOptions.IsPlatformTypeEnabled.Value)
|
||||||
|
{
|
||||||
|
arguments.Append($" -platform_type {launchOptions.PlatformType.Value:G}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return arguments.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
private async ValueTask MonitorExistingUnlockerAsync(LaunchExecutionContext context, CancellationToken token)
|
private async ValueTask MonitorExistingUnlockerAsync(LaunchExecutionContext context, CancellationToken token)
|
||||||
{
|
{
|
||||||
// 恢复模式下,检查是否有解锁器进程在运行
|
// 恢复模式下,检查是否有解锁器进程在运行
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<UseWinUI>true</UseWinUI>
|
<UseWinUI>true</UseWinUI>
|
||||||
<UseWPF>False</UseWPF>
|
<UseWPF>False</UseWPF>
|
||||||
<!-- 配置版本号 -->
|
<!-- 配置版本号 -->
|
||||||
<Version>1.18.0.0</Version>
|
<Version>1.18.1.0</Version>
|
||||||
|
|
||||||
<UseWindowsForms>False</UseWindowsForms>
|
<UseWindowsForms>False</UseWindowsForms>
|
||||||
<ImplicitUsings>False</ImplicitUsings>
|
<ImplicitUsings>False</ImplicitUsings>
|
||||||
|
|||||||
Reference in New Issue
Block a user