If account doesn't own app, attempt to obtain FreeOnDemand license for it.

pull/25/head
Nicholas Hastings 9 years ago
parent 01d87d6102
commit ab86a7d6ac

@ -369,9 +369,16 @@ namespace DepotDownloader
if (!AccountHasAccess(appId))
{
string contentName = GetAppOrDepotName(INVALID_DEPOT_ID, appId);
Console.WriteLine("App {0} ({1}) is not available from this account.", appId, contentName);
return;
if (steam3.RequestFreeAppLicense(appId))
{
Console.WriteLine("Obtained FreeOnDemand license for app {0}", appId);
}
else
{
string contentName = GetAppOrDepotName(INVALID_DEPOT_ID, appId);
Console.WriteLine("App {0} ({1}) is not available from this account.", appId, contentName);
return;
}
}
Console.WriteLine("Using app branch: '{0}'.", branch);

@ -225,6 +225,23 @@ namespace DepotDownloader
}, () => { return completed; });
}
public bool RequestFreeAppLicense(uint appId)
{
bool success = false;
bool completed = false;
Action<SteamApps.FreeLicenseCallback> cbMethod = (resultInfo) =>//(packageInfo) =>
{
completed = true;
success = resultInfo.GrantedApps.Contains(appId);
};
WaitUntilCallback(() => {
callbacks.Subscribe(steamApps.RequestFreeLicense(appId), cbMethod);
}, () => { return completed; });
return success;
}
public void RequestAppTicket(uint appId)
{
if (AppTickets.ContainsKey(appId) || bAborted)

Loading…
Cancel
Save