Skip to content

Commit

Permalink
Adjust new StarRail Repair game mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-nyan committed Nov 4, 2024
1 parent 2e6f81c commit 74bab3b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions CollapseLauncher/Classes/RepairManagement/StarRail/Check.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ private async ValueTask CheckAssetType(FilePropertiesRemote asset, List<FileProp

// Check if the file exist on both persistent and streaming path for non-patch file, then mark the
// persistent path as redundant (unused)
if (IsPersistentExist && IsStreamingExist && !asset.IsPatchApplicable)
bool isNonPatchHasRedundantPersistent = !asset.IsPatchApplicable && IsPersistentExist && IsStreamingExist && fileInfoStreaming.Length == asset.S;

if (isNonPatchHasRedundantPersistent)
{
// Add the count and asset. Mark the type as "RepairAssetType.Unused"
_progressAllCountFound++;
Expand All @@ -236,14 +238,18 @@ private async ValueTask CheckAssetType(FilePropertiesRemote asset, List<FileProp
)
));

// Fix the asset detected as a used file even though it's actually unused
asset.FT = FileType.Unused;
targetAssetIndex.Add(asset);

// Set the file to be used from Persistent one
UsePersistent = true;

LogWriteLine($"File [T: {asset.FT}]: {asset.N} is redundant (exist both on persistent and streaming)", LogType.Warning, true);
// Create a new instance as unused one
FilePropertiesRemote unusedAsset = new FilePropertiesRemote
{
N = fileInfoPersistent.FullName,
FT = FileType.Unused,
RN = asset.RN,
CRC = asset.CRC,
S = asset.S
};
targetAssetIndex.Add(unusedAsset);

LogWriteLine($"File [T: {asset.FT}]: {unusedAsset.N} is redundant (exist both on persistent and streaming)", LogType.Warning, true);
}

// If the file has Hash Mark or is persistent, then create the hash mark file
Expand Down

0 comments on commit 74bab3b

Please sign in to comment.