|
|
|
@ -12,6 +12,9 @@ namespace DepotDownloader
|
|
|
|
|
{
|
|
|
|
|
[BlobField( FieldKey = CDRFields.eFieldApplicationsRecord, Depth = 1, Complex = true )]
|
|
|
|
|
public List<App> Apps { get; set; }
|
|
|
|
|
|
|
|
|
|
[BlobField( FieldKey = CDRFields.eFieldSubscriptionsRecord, Depth = 1, Complex = true )]
|
|
|
|
|
public List<Sub> Subs { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class App
|
|
|
|
@ -35,6 +38,15 @@ namespace DepotDownloader
|
|
|
|
|
public Dictionary<string, string> UserDefined { get; private set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Sub
|
|
|
|
|
{
|
|
|
|
|
[BlobField( FieldKey = CDRSubRecordFields.eFieldSubId, Depth = 1 )]
|
|
|
|
|
public int SubID { get; set; }
|
|
|
|
|
|
|
|
|
|
[BlobField( FieldKey = CDRSubRecordFields.eFieldAppIdsRecord, Depth = 1 )]
|
|
|
|
|
public List<int> AppIDs { get; private set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class AppVersion
|
|
|
|
|
{
|
|
|
|
|
[BlobField( FieldKey = CDRAppVersionFields.eFieldVersionId )]
|
|
|
|
@ -121,6 +133,11 @@ namespace DepotDownloader
|
|
|
|
|
return cdrObj.Apps.Find( ( app ) => app.AppID == appID );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Sub GetSubBlob( int subID )
|
|
|
|
|
{
|
|
|
|
|
return cdrObj.Subs.Find( ( sub ) => sub.SubID == subID );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetDepotName( int depotId )
|
|
|
|
|
{
|
|
|
|
|
// Match hardcoded names from hldsupdatetool for certain HL1 depots
|
|
|
|
@ -352,6 +369,16 @@ namespace DepotDownloader
|
|
|
|
|
Console.WriteLine( "\t\"{0}\"", game );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool SubHasDepot( int subId, int depotId )
|
|
|
|
|
{
|
|
|
|
|
Sub sub = GetSubBlob( subId );
|
|
|
|
|
|
|
|
|
|
if ( sub == null )
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return sub.AppIDs.Contains( depotId );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static byte[] GetCdr()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|