mirror of
https://github.com/SteamRE/DepotDownloader.git
synced 2026-10-19 15:51:50 +00:00
Place server installs into directory specified by "dedicatedserverfolder" if available.
This commit is contained in:
1 parent
0fc89f465a
commit
3cbe8539a6
2 files changed
+30
-1
No files matched your search
@@ -30,6 +30,9 @@ namespace DepotDownloader
|
||||
|
||||
[BlobField( FieldKey = CDRAppRecordFields.eFieldFilesystemsRecord, Complex = true, Depth = 1 )]
|
||||
public List<FileSystem> FileSystems { get; private set; }
|
||||
|
||||
[BlobField( FieldKey = CDRAppRecordFields.eFieldUserDefinedRecord, Depth = 1 )]
|
||||
public Dictionary<string, string> UserDefined { get; private set; }
|
||||
}
|
||||
|
||||
class AppVersion
|
||||
@@ -183,6 +186,24 @@ namespace DepotDownloader
|
||||
return appIDs;
|
||||
}
|
||||
|
||||
public static string GetDedicatedServerFolder( int depotId )
|
||||
{
|
||||
App app = GetAppBlob( depotId );
|
||||
|
||||
if ( app.UserDefined == null )
|
||||
return null;
|
||||
|
||||
foreach ( var entry in app.UserDefined )
|
||||
{
|
||||
if ( entry.Key.Equals( "dedicatedserverfolder", StringComparison.OrdinalIgnoreCase ) )
|
||||
{
|
||||
return entry.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static byte[] GetCdr()
|
||||
{
|
||||
try
|
||||
|
||||
@@ -34,6 +34,14 @@ namespace DepotDownloader
|
||||
else
|
||||
{
|
||||
Directory.CreateDirectory( installDir );
|
||||
|
||||
string serverFolder = CDRManager.GetDedicatedServerFolder( depotId );
|
||||
if ( serverFolder != null || !serverFolder.Equals( "" ) )
|
||||
{
|
||||
installDir = Path.Combine( installDir, serverFolder );
|
||||
Directory.CreateDirectory( installDir );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -191,7 +199,7 @@ namespace DepotDownloader
|
||||
}
|
||||
|
||||
float perc = ( ( float )x / ( float )manifest.Nodes.Count ) * 100.0f;
|
||||
Console.WriteLine( " {0:0.00}%\t{1}", perc, dirEntry.FullName );
|
||||
Console.WriteLine( " {0:0.00}%\t{1}", perc, Path.Combine( installDir, dirEntry.FullName ) );
|
||||
|
||||
FileInfo fi = new FileInfo( downloadPath );
|
||||
|
||||
|
||||
Reference in new issue
Block a user