Skip to content

Commit

Permalink
Merge pull request #46 from LittleBigRefresh/fix-multi-download
Browse files Browse the repository at this point in the history
Fix crash when multiple users have a license.
  • Loading branch information
jvyden authored Jan 24, 2024
2 parents 12eab81 + ffe6d73 commit 79fccc6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Refresher/UI/IntegratedPatchForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ protected virtual void GameChanged(object? sender, EventArgs ev)

foreach (string user in this.Accessor.GetDirectoriesInDirectory(Path.Combine("home")))
{
bool found = false;

Console.WriteLine($"Checking all license files in {user}");
foreach (string licenseFile in this.Accessor.GetFilesInDirectory(Path.Combine(user, "exdata")))
{
Expand All @@ -177,7 +179,13 @@ protected virtual void GameChanged(object? sender, EventArgs ev)
File.Move(downloadedLicenseFile, Path.Join(licenseDir, Path.GetFileName(licenseFile)));

Console.WriteLine($"Downloaded license file {licenseFile}.");

found = true;
break;
}

if (found)
break;
}

//If we are using the console patch accessor, fill out the IDPS patch file.
Expand Down

0 comments on commit 79fccc6

Please sign in to comment.