Skip to content

Commit

Permalink
[Urgent] Stable 1.80.19 Hotfix Release (#558)
Browse files Browse the repository at this point in the history
# What's New? - 1.80.19
- **[New]** ZZZ Pre-download Support, by @neon-nyan 
- **[New]** Bilibili Region Support for ZZZ, by @bagusnl & @neon-nyan  
- **[Imp]** Bring back the old file download behavior to store chunk
files as sequential ``.001`` files, by @neon-nyan
This change however, is backward compatible if you still have the
hash-based (``.xxxxx``) extension chunks.
- **[Fix]** Random "File is being used by another process" Errors when
Downloading, by @neon-nyan
- **[Fix]** Potentially skipping HDiff patching and old files removal
routine while applying ZZZ Update, by @neon-nyan
- **[Fix]** ``Hi3Helper.Http`` submodule causing size miscalculation
while downloading files, by @neon-nyan

### Templates

<details>
  <summary>Changelog Prefixes</summary>
  
  ```
    **[New]**
    **[Imp]**
    **[Fix]**
    **[Loc]**
    **[Doc]**
  ```

</details>
  • Loading branch information
neon-nyan authored Aug 12, 2024
2 parents 9d6ba7d + d66c2b4 commit 1ccee78
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1137,21 +1137,19 @@ private async ValueTask<int> RunPackageVerificationRoutine(GameInstallPackage as

private long GetAssetIndexTotalUncompressSize(List<GameInstallPackage> assetIndex)
{
long returnSize = 0;
ArgumentNullException.ThrowIfNull(assetIndex);

foreach (GameInstallPackage asset in assetIndex)
{
using (Stream stream = GetSingleOrSegmentedDownloadStream(asset))
using (ArchiveFile archiveFile = new ArchiveFile(stream!))
{
returnSize += archiveFile.Entries.Sum(x => (long)x!.Size);
}
}

long returnSize = assetIndex.Sum(GetSingleOrSegmentedUncompressedSize);
return returnSize;
}

private long GetSingleOrSegmentedUncompressedSize(GameInstallPackage asset)
{
using Stream stream = GetSingleOrSegmentedDownloadStream(asset);
using ArchiveFile archiveFile = new ArchiveFile(stream!);
return archiveFile.Entries.Sum(x => (long)x!.Size);
}

private Stream GetSingleOrSegmentedDownloadStream(GameInstallPackage asset)
{
if (asset == null) return null;
Expand Down Expand Up @@ -1213,6 +1211,9 @@ protected virtual async Task StartPackageInstallationInner(List<GameInstallPacka
_status!.IsProgressAllIndetermined = false;
UpdateStatus();

_progressPerFileSizeCurrent = 0;
_progressPerFileSizeTotal = GetSingleOrSegmentedUncompressedSize(asset);

// Assign extractor
string packageExtension = Path.GetExtension(asset!.PathOutput).ToLower();
#if USENEWZIPDECOMPRESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

// ReSharper disable GrammarMistakeInComment
// ReSharper disable CommentTypo
Expand Down Expand Up @@ -81,6 +82,26 @@ public ZenlessInstall(UIElement parentUI, IGameVersionCheck GameVersionManager,
ZenlessSettings = zenlessSettings;
}

#region Override Methods - StartPackageInstallationInner
protected override async Task StartPackageInstallationInner(List<GameInstallPackage>? gamePackage = null,
bool isOnlyInstallPackage = false,
bool doNotDeleteZipExplicit = false)
{
// Run the base installation process
await base.StartPackageInstallationInner(gamePackage, isOnlyInstallPackage, doNotDeleteZipExplicit);

// Then start on processing hdifffiles list and deletefiles list
await ApplyHdiffListPatch();
ApplyDeleteFileAction();

// Update the audio lang list if not in isOnlyInstallPackage mode
if (!isOnlyInstallPackage)
{
WriteAudioLangList(_assetIndex);
}
}
#endregion

#region Override Methods - Audio Lang List
protected override void WriteAudioLangList(List<GameInstallPackage> gamePackage)
{
Expand Down
2 changes: 1 addition & 1 deletion CollapseLauncher/CollapseLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Authors>$(Company). neon-nyan, Cry0, bagusnl, shatyuka, gablm.</Authors>
<Copyright>Copyright 2022-2024 $(Company)</Copyright>
<!-- Versioning -->
<Version>1.80.18</Version>
<Version>1.80.19</Version>
<LangVersion>preview</LangVersion>
<!-- Target Settings -->
<Platforms>x64</Platforms>
Expand Down

0 comments on commit 1ccee78

Please sign in to comment.