mirror of
https://github.com/SteamRE/DepotDownloader.git
synced 2026-10-19 15:51:50 +00:00
DepotDownloader: More steam3 support
This commit is contained in:
1 parent
028e9ce8c8
commit
1a281f3182
2 files changed
+19
-8
No files matched your search
@@ -192,19 +192,27 @@ namespace DepotDownloader
|
||||
|
||||
static bool AccountHasAccess( int depotId, bool appId=false )
|
||||
{
|
||||
if ( steam3 == null || steam3.Licenses == null )
|
||||
if ( steam3 == null || (steam3.Licenses == null && steam3.steamUser.SteamID.AccountType != EAccountType.AnonUser) )
|
||||
return CDRManager.SubHasDepot( 0, depotId );
|
||||
|
||||
steam3.RequestPackageInfo( steam3.Licenses.Select( x => x.PackageID ) );
|
||||
|
||||
foreach ( var license in steam3.Licenses )
|
||||
IEnumerable<uint> licenseQuery;
|
||||
if ( steam3.steamUser.SteamID.AccountType == EAccountType.AnonUser )
|
||||
{
|
||||
|
||||
licenseQuery = new List<uint>() { 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
licenseQuery = steam3.Licenses.Select( x => x.PackageID );
|
||||
}
|
||||
|
||||
steam3.RequestPackageInfo( licenseQuery );
|
||||
|
||||
foreach ( var license in licenseQuery )
|
||||
{
|
||||
SteamApps.PICSProductInfoCallback.PICSProductInfo package;
|
||||
if ( steam3.PackageInfo.TryGetValue( (uint)license.PackageID, out package ) || package == null )
|
||||
if ( steam3.PackageInfo.TryGetValue( license, out package ) || package == null )
|
||||
{
|
||||
KeyValue root = package.KeyValues[license.PackageID.ToString()];
|
||||
KeyValue root = package.KeyValues[license.ToString()];
|
||||
KeyValue subset = (appId == true ? root["appids"] : root["depotids"]);
|
||||
|
||||
foreach ( var child in subset.Children )
|
||||
@@ -214,7 +222,7 @@ namespace DepotDownloader
|
||||
}
|
||||
}
|
||||
|
||||
if ( CDRManager.SubHasDepot( ( int )license.PackageID, depotId ) )
|
||||
if ( CDRManager.SubHasDepot( ( int )license, depotId ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,10 @@ namespace DepotDownloader
|
||||
|
||||
SteamApps.PICSRequest request = new SteamApps.PICSRequest(appId);
|
||||
if (AppTokens.ContainsKey(appId))
|
||||
{
|
||||
request.AccessToken = AppTokens[appId];
|
||||
request.Public = false;
|
||||
}
|
||||
|
||||
using (JobCallback<SteamApps.PICSProductInfoCallback> appInfoCallback = new JobCallback<SteamApps.PICSProductInfoCallback>(cbMethod, callbacks, steamApps.PICSGetProductInfo(new List<SteamApps.PICSRequest>() { request }, new List<SteamApps.PICSRequest>() { })))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user