mirror of
https://github.com/SteamRE/DepotDownloader.git
synced 2026-10-20 01:46:17 +00:00
Added -all-platforms switch to download all platform-specific depots when -game is used.
This commit is contained in:
1 parent
a86eac90de
commit
ed4bd4a1d3
2 files changed
+24
-14
No files matched your search
@@ -164,28 +164,36 @@ namespace DepotDownloader
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<int> GetDepotIDsForGameserver( string gameName )
|
||||
public static List<int> GetDepotIDsForGameserver( string gameName, bool allPlatforms )
|
||||
{
|
||||
List<int> appIDs = new List<int>();
|
||||
|
||||
App serverAppInfoBlob = GetAppBlob( 4 );
|
||||
|
||||
PlatformID platform = Environment.OSVersion.Platform;
|
||||
string suffix = "";
|
||||
string platformSuffix = "";
|
||||
|
||||
if (platform == PlatformID.Win32NT)
|
||||
suffix = "-win32";
|
||||
else if (platform == PlatformID.Unix)
|
||||
suffix = "-linux";
|
||||
if ( platform == PlatformID.Win32NT )
|
||||
platformSuffix = "-win32";
|
||||
else if ( platform == PlatformID.Unix )
|
||||
platformSuffix = "-linux";
|
||||
|
||||
int gameLen = gameName.Length;
|
||||
|
||||
foreach ( var blobField in serverAppInfoBlob.FileSystems )
|
||||
{
|
||||
string mountName = blobField.Name;
|
||||
|
||||
if ( mountName.Equals( gameName, StringComparison.OrdinalIgnoreCase ) ||
|
||||
mountName.Equals( gameName + suffix, StringComparison.OrdinalIgnoreCase ) )
|
||||
if ( String.Compare(mountName, 0, gameName, 0, gameLen, true) == 0 )
|
||||
{
|
||||
appIDs.Add( blobField.AppID );
|
||||
string suffix = mountName.Substring( gameLen );
|
||||
|
||||
if (suffix == "" ||
|
||||
suffix == platformSuffix ||
|
||||
allPlatforms && ( suffix == "-win32" || suffix == "-linux" ) )
|
||||
{
|
||||
appIDs.Add( blobField.AppID );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,8 @@ namespace DepotDownloader
|
||||
string username = GetStringParameter( args, "-username" );
|
||||
string password = GetStringParameter( args, "-password" );
|
||||
string installDir = GetStringParameter( args, "-dir" );
|
||||
bool noExclude = HasParamater( args, "-no-exclude" );
|
||||
bool bNoExclude = HasParameter( args, "-no-exclude" );
|
||||
bool bAllPlatforms = HasParameter( args, "-all-platforms" );
|
||||
|
||||
if ( !bGameserver )
|
||||
{
|
||||
@@ -111,7 +112,7 @@ namespace DepotDownloader
|
||||
}
|
||||
else
|
||||
{
|
||||
List<int> depotIDs = CDRManager.GetDepotIDsForGameserver( gameName );
|
||||
List<int> depotIDs = CDRManager.GetDepotIDsForGameserver( gameName, bAllPlatforms );
|
||||
|
||||
foreach ( int currentDepotId in depotIDs )
|
||||
{
|
||||
@@ -125,7 +126,7 @@ namespace DepotDownloader
|
||||
string depotName = CDRManager.GetDepotName( currentDepotId );
|
||||
Console.WriteLine( "Downloading \"{0}\" version {1} ...", depotName, depotVersion );
|
||||
|
||||
ContentDownloader.Download( currentDepotId, depotVersion, cellId, username, password, false, bGameserver, !noExclude, installDir, files );
|
||||
ContentDownloader.Download( currentDepotId, depotVersion, cellId, username, password, false, bGameserver, !bNoExclude, installDir, files );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,7 +140,7 @@ namespace DepotDownloader
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
static bool HasParamater( string[] args, string param )
|
||||
static bool HasParameter( string[] args, string param )
|
||||
{
|
||||
return IndexOfParam( args, param ) > -1;
|
||||
}
|
||||
@@ -184,7 +185,8 @@ namespace DepotDownloader
|
||||
Console.WriteLine( "\t-password pass\t\t\t- the password of the account to login to for restricted content." );
|
||||
Console.WriteLine( "\t-dir installdir\t\t\t- the directory in which to place downloaded files." );
|
||||
Console.WriteLine( "\t-filelist filename.txt\t\t- a list of files to download (from the manifest). Can optionally use regex to download only certain files." );
|
||||
Console.WriteLine( "\t-no-exclude\t\t\t- don't exclude any files when downloading depots with the -game parameter.\n");
|
||||
Console.WriteLine( "\t-no-exclude\t\t\t- don't exclude any files when downloading depots with the -game parameter." );
|
||||
Console.WriteLine( "\t-all-platforms\t\t\t- downloads all platform-specific depots when -game is used.\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user