Skip to content

Commit

Permalink
Catch RequestFreeAppLicense exception
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Nov 14, 2024
1 parent 2a93905 commit 0fb803b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions DepotDownloader/Steam3Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,17 @@ public async Task RequestPackageInfo(IEnumerable<uint> packageIds)

public async Task<bool> RequestFreeAppLicense(uint appId)
{
var resultInfo = await steamApps.RequestFreeLicense(appId);
try
{
var resultInfo = await steamApps.RequestFreeLicense(appId);

return resultInfo.GrantedApps.Contains(appId);
return resultInfo.GrantedApps.Contains(appId);
}
catch (Exception ex)
{
Console.WriteLine($"Failed to request FreeOnDemand license for app {appId}: {ex.Message}");
return false;
}
}

public async Task RequestDepotKey(uint depotId, uint appid = 0)
Expand Down

0 comments on commit 0fb803b

Please sign in to comment.