From 29582efaee9812b2cf0ef4bad63bd463a45c2e6a Mon Sep 17 00:00:00 2001 From: x3zF Love U Date: Sun, 12 Mar 2023 18:15:40 +0800 Subject: [PATCH] reduce the Task waiting time of mult-start --- .../Snap.Hutao/Service/Game/GameService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/GameService.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/GameService.cs index d9d467cb..0563a8ab 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Game/GameService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/GameService.cs @@ -360,7 +360,7 @@ internal sealed class GameService : IGameService { if (options.MultStart && Activation.GetElevated()) { - if (!await CloseDllProcessAsync(game, gamePath)) + if (!await MultStartGameAsync(game, gamePath)) { return; } @@ -383,7 +383,7 @@ internal sealed class GameService : IGameService { if (options.MultStart && Activation.GetElevated()) { - if (!await CloseDllProcessAsync(game, gamePath)) + if (!await MultStartGameAsync(game, gamePath)) { return; } @@ -406,8 +406,8 @@ internal sealed class GameService : IGameService /// /// 游戏线程 /// 游戏路径 - /// 为真时关闭 为假时返回 - public async Task CloseDllProcessAsync(Process gameProcess, string gamePath) + /// 为真时成功 为假时返回 + public async Task MultStartGameAsync(Process gameProcess, string gamePath) { if (gamePath == null) { @@ -434,8 +434,8 @@ internal sealed class GameService : IGameService gameProcess.Start(); - // wait 15sec for loading library files - await Task.Delay(15000); + // wait 12sec for loading library files + await Task.Delay(12000); File.Move(tempPath, mhypbasePath);