mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix bilibili server convert
This commit is contained in:
@@ -163,7 +163,7 @@ internal sealed partial class GameService : IGameService
|
||||
}
|
||||
}
|
||||
|
||||
return changed || !LaunchSchemeMatchesExecutable(scheme, Path.GetFileName(gamePath));
|
||||
return changed;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -398,4 +398,6 @@ internal sealed partial class GameService : IGameService
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
private static bool LaunchScheme
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using System.IO;
|
||||
|
||||
namespace Snap.Hutao.Service.Game;
|
||||
|
||||
@@ -64,4 +65,29 @@ internal sealed partial class LaunchScheme
|
||||
{
|
||||
return Channel == multiChannel.Channel && SubChannel == multiChannel.SubChannel;
|
||||
}
|
||||
|
||||
public bool ExecutableMatches(string gameFileName)
|
||||
{
|
||||
return (IsOversea, gameFileName) switch
|
||||
{
|
||||
(true, GameConstants.GenshinImpactFileName) => true,
|
||||
(false, GameConstants.YuanShenFileName) => true,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
public bool SdkLibraryMatches(string gameFolder)
|
||||
{
|
||||
if (IsOversea)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (LauncherId is SdkStaticLauncherBilibiliId)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
string sdkDll = Path.Combine(gameFolder, GameConstants.YuanShenData, "Plugins\\PCGameSDK.dll");
|
||||
}
|
||||
}
|
||||
@@ -186,18 +186,17 @@ internal sealed partial class LaunchGameViewModel : Abstraction.ViewModel
|
||||
{
|
||||
try
|
||||
{
|
||||
if (gameService.SetChannelOptions(SelectedScheme))
|
||||
gameService.SetChannelOptions(SelectedScheme);
|
||||
|
||||
// Whether or not the channel options changed, we always ensure game resouces
|
||||
LaunchGamePackageConvertDialog dialog = await contentDialogFactory.CreateInstanceAsync<LaunchGamePackageConvertDialog>().ConfigureAwait(false);
|
||||
IProgress<PackageReplaceStatus> convertProgress = taskContext.CreateProgressForMainThread<PackageReplaceStatus>(state => dialog.State = state);
|
||||
using (await dialog.BlockAsync(taskContext).ConfigureAwait(false))
|
||||
{
|
||||
// Channel changed, we need to change local file.
|
||||
LaunchGamePackageConvertDialog dialog = await contentDialogFactory.CreateInstanceAsync<LaunchGamePackageConvertDialog>().ConfigureAwait(false);
|
||||
IProgress<PackageReplaceStatus> convertProgress = taskContext.CreateProgressForMainThread<PackageReplaceStatus>(state => dialog.State = state);
|
||||
using (await dialog.BlockAsync(taskContext).ConfigureAwait(false))
|
||||
if (!await gameService.EnsureGameResourceAsync(SelectedScheme, convertProgress).ConfigureAwait(false))
|
||||
{
|
||||
if (!await gameService.EnsureGameResourceAsync(SelectedScheme, convertProgress).ConfigureAwait(false))
|
||||
{
|
||||
infoBarService.Warning(SH.ViewModelLaunchGameEnsureGameResourceFail);
|
||||
return;
|
||||
}
|
||||
infoBarService.Warning(SH.ViewModelLaunchGameEnsureGameResourceFail);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user