Reformat code

pull/231/head
js6pak 5 years ago
parent f0dcb5f57d
commit 239d31441f
No known key found for this signature in database
GPG Key ID: EFE980EFD32F8EE9

@ -297,7 +297,6 @@ namespace DepotDownloader
Console.WriteLine( "Unhandled depot encryption for depotId {0}", depotId ); Console.WriteLine( "Unhandled depot encryption for depotId {0}", depotId );
return INVALID_MANIFEST_ID; return INVALID_MANIFEST_ID;
} }
} }
return INVALID_MANIFEST_ID; return INVALID_MANIFEST_ID;
@ -566,6 +565,7 @@ namespace DepotDownloader
depotManifestIds.Add( ( id, ContentDownloader.INVALID_MANIFEST_ID ) ); depotManifestIds.Add( ( id, ContentDownloader.INVALID_MANIFEST_ID ) );
} }
} }
if ( depotManifestIds.Count == 0 && !hasSpecificDepots ) if ( depotManifestIds.Count == 0 && !hasSpecificDepots )
{ {
throw new ContentDownloaderException( String.Format( "Couldn't find any depots to download for app {0}", appId ) ); throw new ContentDownloaderException( String.Format( "Couldn't find any depots to download for app {0}", appId ) );
@ -660,6 +660,7 @@ namespace DepotDownloader
OldChunk = oldChunk; OldChunk = oldChunk;
NewChunk = newChunk; NewChunk = newChunk;
} }
public ProtoManifest.ChunkData OldChunk { get; private set; } public ProtoManifest.ChunkData OldChunk { get; private set; }
public ProtoManifest.ChunkData NewChunk { get; private set; } public ProtoManifest.ChunkData NewChunk { get; private set; }
} }
@ -694,7 +695,6 @@ namespace DepotDownloader
public ulong SizeDownloaded; public ulong SizeDownloaded;
public ulong DepotBytesCompressed; public ulong DepotBytesCompressed;
public ulong DepotBytesUncompressed; public ulong DepotBytesUncompressed;
} }
private static async Task DownloadSteam3Async( uint appId, List<DepotDownloadInfo> depots ) private static async Task DownloadSteam3Async( uint appId, List<DepotDownloadInfo> depots )
@ -882,8 +882,7 @@ namespace DepotDownloader
cdnPool.ReturnBrokenConnection( connection ); cdnPool.ReturnBrokenConnection( connection );
Console.WriteLine( "Encountered error downloading manifest for depot {0} {1}: {2}", depot.id, depot.manifestId, e.Message ); Console.WriteLine( "Encountered error downloading manifest for depot {0} {1}: {2}", depot.id, depot.manifestId, e.Message );
} }
} } while ( depotManifest == null );
while (depotManifest == null);
if ( depotManifest == null ) if ( depotManifest == null )
{ {
@ -1052,6 +1051,7 @@ namespace DepotDownloader
{ {
throw new ContentDownloaderException( String.Format( "Failed to allocate file {0}: {1}", fileFinalPath, ex.Message ) ); throw new ContentDownloaderException( String.Format( "Failed to allocate file {0}: {1}", fileFinalPath, ex.Message ) );
} }
neededChunks = new List<ProtoManifest.ChunkData>( file.Chunks ); neededChunks = new List<ProtoManifest.ChunkData>( file.Chunks );
} }
else else
@ -1274,8 +1274,7 @@ namespace DepotDownloader
cdnPool.ReturnBrokenConnection( connection ); cdnPool.ReturnBrokenConnection( connection );
Console.WriteLine( "Encountered unexpected error downloading chunk {0}: {1}", chunkID, e.Message ); Console.WriteLine( "Encountered unexpected error downloading chunk {0}: {1}", chunkID, e.Message );
} }
} } while ( chunkData == null );
while (chunkData == null);
if ( chunkData == null ) if ( chunkData == null )
{ {
@ -1325,7 +1324,6 @@ namespace DepotDownloader
var fileFinalPath = Path.Combine( depot.installDir, file.FileName ); var fileFinalPath = Path.Combine( depot.installDir, file.FileName );
Console.WriteLine( "{0,6:#00.00}% {1}", ( ( float )sizeDownloaded / ( float )depotDownloadCounter.CompleteDownloadSize ) * 100.0f, fileFinalPath ); Console.WriteLine( "{0,6:#00.00}% {1}", ( ( float )sizeDownloaded / ( float )depotDownloadCounter.CompleteDownloadSize ) * 100.0f, fileFinalPath );
} }
} }
static void DumpManifestToTextFile( DepotDownloadInfo depot, ProtoManifest manifest ) static void DumpManifestToTextFile( DepotDownloadInfo depot, ProtoManifest manifest )

@ -277,6 +277,7 @@ namespace DepotDownloader
// Avoid console echoing of password // Avoid console echoing of password
password = Util.ReadPassword(); password = Util.ReadPassword();
} }
Console.WriteLine(); Console.WriteLine();
} while ( String.Empty == password ); } while ( String.Empty == password );
} }
@ -298,8 +299,10 @@ namespace DepotDownloader
if ( args[ x ].Equals( param, StringComparison.OrdinalIgnoreCase ) ) if ( args[ x ].Equals( param, StringComparison.OrdinalIgnoreCase ) )
return x; return x;
} }
return -1; return -1;
} }
static bool HasParameter( string[] args, string param ) static bool HasParameter( string[] args, string param )
{ {
return IndexOfParam( args, param ) > -1; return IndexOfParam( args, param ) > -1;

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using ProtoBuf; using ProtoBuf;
using SteamKit2; using SteamKit2;
@ -145,7 +144,6 @@ namespace DepotDownloader
public void SaveToFile( string filename, out byte[] checksum ) public void SaveToFile( string filename, out byte[] checksum )
{ {
using ( MemoryStream ms = new MemoryStream() ) using ( MemoryStream ms = new MemoryStream() )
{ {
ProtoBuf.Serializer.Serialize<ProtoManifest>( ms, this ); ProtoBuf.Serializer.Serialize<ProtoManifest>( ms, this );

@ -11,7 +11,6 @@ using System.Threading.Tasks;
namespace DepotDownloader namespace DepotDownloader
{ {
class Steam3Session class Steam3Session
{ {
public class Credentials public class Credentials
@ -135,6 +134,7 @@ namespace DepotDownloader
} }
public delegate bool WaitCondition(); public delegate bool WaitCondition();
private object steamLock = new object(); private object steamLock = new object();
public bool WaitUntilCallback( Action submitter, WaitCondition waiter ) public bool WaitUntilCallback( Action submitter, WaitCondition waiter )
@ -153,8 +153,7 @@ namespace DepotDownloader
{ {
WaitForCallbacks(); WaitForCallbacks();
} }
} } while ( !bAborted && this.seq == seq && !waiter() );
while ( !bAborted && this.seq == seq && !waiter() );
} }
return bAborted; return bAborted;
@ -470,6 +469,7 @@ namespace DepotDownloader
{ {
Disconnect( sendLogOff ); Disconnect( sendLogOff );
} }
public void Disconnect( bool sendLogOff = true ) public void Disconnect( bool sendLogOff = true )
{ {
if ( sendLogOff ) if ( sendLogOff )
@ -734,7 +734,5 @@ namespace DepotDownloader
bDidReceiveLoginKey = true; bDidReceiveLoginKey = true;
} }
} }
} }

@ -50,6 +50,7 @@ namespace DepotDownloader
password.Remove( password.Length - 1, 1 ); password.Remove( password.Length - 1, 1 );
Console.Write( "\x1B[1D\x1B[1P" ); Console.Write( "\x1B[1D\x1B[1P" );
} }
continue; continue;
} }
@ -106,6 +107,7 @@ namespace DepotDownloader
a = ( a + input[ i ] ) % 65521; a = ( a + input[ i ] ) % 65521;
b = ( b + a ) % 65521; b = ( b + a ) % 65521;
} }
return BitConverter.GetBytes( a | ( b << 16 ) ); return BitConverter.GetBytes( a | ( b << 16 ) );
} }
@ -169,8 +171,7 @@ namespace DepotDownloader
await completedTask.ConfigureAwait( false ); await completedTask.ConfigureAwait( false );
tasksInFlight.Remove( completedTask ); tasksInFlight.Remove( completedTask );
} } while ( index < queue.Length || tasksInFlight.Count != 0 );
while (index < queue.Length || tasksInFlight.Count != 0);
} }
} }
} }

Loading…
Cancel
Save