Starward icon indicating copy to clipboard operation
Starward copied to clipboard

[Feature] 优化下载功能

Open Scighost opened this issue 2 years ago • 2 comments

Checklist

  • [X] I have already read docs/Tips.md, but my feature is not implemented.
  • [X] My suggested feature was not mentioned by others, and it is not a duplicate feature.

Summary

当前版本的下载功能存在着一些问题和不足的地方,比如

  • 无法继续官方启动器未完成的下载任务 #169
  • 没有自动重试机制 #545
  • 不支持限速 #417

Solution or Design

  • [x] 单方面兼容官方启动器
  • [ ] 增加自动重试机制
  • [ ] 下载限速

除此之外,当游戏的目标存储位置是机械硬盘时,多线程下载将产生大量的磁盘碎片,影响后续解压过程的速度。需要为机械硬盘应用额外的下载方案,有以下几个可能的解决办法:

  • 单线程下载+单线程写入
  • 预分配磁盘空间+多线程下载+多线程写入
  • 大内存缓冲+多线程下载+单线程写入

考虑到如今固态硬盘的普及程度,这个优化方向的优先级很低。

Scighost avatar Dec 19 '23 10:12 Scighost

希望可以添加自定义资源包(预下载)下载路径

固态经常是游戏解压后的空间是够的,但(解压前+解压后)就不够了。考虑过IDM手动下载到仓库盘再解压+hdiff+hpatchz,仔细一想比挪空间还麻烦。结果就是每次都先把别的游戏移动到机械仓库盘,等版本更新完后再移回来。😂😂😂

如果启动器能集成上述过程就非常理想了。

livilivi avatar Jan 31 '24 22:01 livilivi

下載異常中斷-遠端主機已強制關閉一個現存的連線

[18:01:53.614] [INFO] Welcome to Starward v0.11.3 System: Microsoft Windows NT 10.0.19045.0 Command Line: C:\Users\R\Desktop\應用程式\Starward_Portable_0.11.2_x64\Starward\app-0.11.3\Starward.dll download --biz hkrpg_global --loc "C:\Program Files\MHY\starrail" --lang 15

[18:01:53.648] [INFO] Starward.Services.DatabaseService Database path is 'C:\Users\R\Documents\2'

[18:01:53.669] [INFO] Starward.Services.DatabaseService Database version is 8, target version is 8.

[18:01:53.866] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Initialize install game service biz: hkrpg_global path: "C:\Program Files\MHY\starrail" lang: All repair: False reinstall: False

[18:01:53.903] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Start install game, skipVerify: False

[18:01:53.904] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Prepare for download.

[18:01:53.904] [WARN] Starward.Services.GameResourceService config.ini not found: "C:\Program Files\MHY\starrail\config.ini"

[18:01:54.176] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Install full game.

[18:01:54.179] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Request head: "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/Japanese.zip"

[18:01:54.179] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Request head: "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/English.zip"

[18:01:54.179] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Request head: "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/StarRail_2.0.0.zip"

[18:01:54.179] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Request head: "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/Chinese.zip"

[18:01:54.180] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Request head: "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/Korean.zip"

[18:01:55.003] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Start download files.

[18:01:55.003] [INFO] Starward.Services.InstallGame.StarRailInstallGameService 5 files need to download.

[18:01:55.005] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Download: FileName "English.zip", Url "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/English.zip"

[18:01:55.007] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Download: FileName "Korean.zip", Url "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/Korean.zip"

[18:01:55.007] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Download: FileName "StarRail_2.0.0.zip", Url "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/StarRail_2.0.0.zip"

[18:01:55.007] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Download: FileName "Chinese.zip", Url "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/Chinese.zip"

[18:01:55.008] [INFO] Starward.Services.InstallGame.StarRailInstallGameService Download: FileName "Japanese.zip", Url "https://autopatchos.starrails.com/client/download/20240126105613_xi8FVxCWfDpjdC2r/PC/Japanese.zip"

[18:06:57.770] [EROR] Starward.Services.InstallGame.StarRailInstallGameService Install game error. System.IO.IOException: Unable to read data from the transport connection: 遠端主機已強制關閉一個現存的連線。. ---> System.Net.Sockets.SocketException (10054): 遠端主機已強制關閉一個現存的連線。 --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError, CancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken, Int32) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory1, CancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16) at System.Net.Http.HttpConnection.ReadAsync(Memory1) at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory1, CancellationToken) at Starward.Services.InstallGame.InstallGameService.DownloadFileAsync(DownloadFileTask task, CancellationToken cancellationToken, Boolean noTmp) in D:\a\Starward\Starward\src\Starward\Services\InstallGame\InstallGameService.cs:line 844 at Starward.Services.InstallGame.InstallGameService.<>c__DisplayClass74_0.<<DownloadAsync>b__2>d.MoveNext() in D:\a\Starward\Starward\src\Starward\Services\InstallGame\InstallGameService.cs:line 572 --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__531.<<ForEachAsync>b__53_0>d.MoveNext() --- End of stack trace from previous location --- at Starward.Services.InstallGame.InstallGameService.DownloadAsync(CancellationToken cancellationToken, Boolean noTmp) in D:\a\Starward\Starward\src\Starward\Services\InstallGame\InstallGameService.cs:line 566 at Starward.Services.InstallGame.InstallGameService.StartAsync(Boolean skipVerify) in D:\a\Starward\Starward\src\Starward\Services\InstallGame\InstallGameService.cs:line 241

SSB-ARFCN avatar Mar 22 '24 10:03 SSB-ARFCN