mirror of
https://github.com/SteamRE/DepotDownloader.git
synced 2026-10-20 01:46:17 +00:00
address feedback
This commit is contained in:
1 parent
29eed5b9df
commit
69707095cd
3 files changed
+13
-14
No files matched your search
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Security.Cryptography;
|
||||
using ProtoBuf;
|
||||
using SteamKit2;
|
||||
|
||||
@@ -135,7 +136,7 @@ namespace DepotDownloader
|
||||
using (var ds = new DeflateStream(fs, CompressionMode.Decompress))
|
||||
ds.CopyTo(ms);
|
||||
|
||||
checksum = Util.SHAHash(ms.ToArray());
|
||||
checksum = SHA1.HashData(ms.ToArray());
|
||||
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
return Serializer.Deserialize<ProtoManifest>(ms);
|
||||
@@ -148,7 +149,7 @@ namespace DepotDownloader
|
||||
{
|
||||
Serializer.Serialize(ms, this);
|
||||
|
||||
checksum = Util.SHAHash(ms.ToArray());
|
||||
checksum = SHA1.HashData(ms.ToArray());
|
||||
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
|
||||
@@ -560,8 +560,14 @@ namespace DepotDownloader
|
||||
logonDetails.Password = null;
|
||||
logonDetails.AccessToken = result.RefreshToken;
|
||||
|
||||
// Should i check if guardData is null ?
|
||||
AccountSettingsStore.Instance.GuardData[result.AccountName] = result.NewGuardData;
|
||||
if (result.NewGuardData != null)
|
||||
{
|
||||
AccountSettingsStore.Instance.GuardData[result.AccountName] = result.NewGuardData;
|
||||
}
|
||||
else
|
||||
{
|
||||
AccountSettingsStore.Instance.GuardData.Remove(result.AccountName);
|
||||
}
|
||||
AccountSettingsStore.Instance.LoginTokens[result.AccountName] = result.RefreshToken;
|
||||
AccountSettingsStore.Save();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -113,13 +112,6 @@ namespace DepotDownloader
|
||||
return BitConverter.GetBytes(a | (b << 16));
|
||||
}
|
||||
|
||||
public static byte[] SHAHash(byte[] input)
|
||||
{
|
||||
var output = SHA1.HashData(input);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
public static byte[] DecodeHexString(string hex)
|
||||
{
|
||||
if (hex == null)
|
||||
@@ -144,7 +136,7 @@ namespace DepotDownloader
|
||||
public static async Task InvokeAsync(IEnumerable<Func<Task>> taskFactories, int maxDegreeOfParallelism)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(taskFactories);
|
||||
if (maxDegreeOfParallelism <= 0) throw new ArgumentException(nameof(maxDegreeOfParallelism));
|
||||
ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(0, maxDegreeOfParallelism);
|
||||
|
||||
var queue = taskFactories.ToArray();
|
||||
|
||||
|
||||
Reference in new issue
Block a user