From 55fda1a0ddb73f4a5772e48551e90336dc8b1c8e Mon Sep 17 00:00:00 2001 From: Yaakov Date: Wed, 31 Jan 2024 20:59:52 +1100 Subject: [PATCH 1/7] update tfm to net8.0 --- DepotDownloader/DepotDownloader.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index 98ded2a..e2b822a 100644 --- a/DepotDownloader/DepotDownloader.csproj +++ b/DepotDownloader/DepotDownloader.csproj @@ -1,7 +1,7 @@ - + Exe - net6.0 + net8.0 true LatestMajor 2.5.0 From 679e019f27bc9d4b794cf305c4dc610795f0c924 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Wed, 31 Jan 2024 21:00:50 +1100 Subject: [PATCH 2/7] fix compiler warning re. IDE0005 --- DepotDownloader/DepotDownloader.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index e2b822a..7ead18c 100644 --- a/DepotDownloader/DepotDownloader.csproj +++ b/DepotDownloader/DepotDownloader.csproj @@ -1,4 +1,4 @@ - + Exe net8.0 @@ -9,6 +9,7 @@ SteamRE Team Copyright © SteamRE Team 2021 ..\Icon\DepotDownloader.ico + true From 6c51846c5b1e84616bdf7b41eed5d2ee222fcd71 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Wed, 31 Jan 2024 21:01:27 +1100 Subject: [PATCH 3/7] fix public types causing xmldoc warnings by making them internal --- DepotDownloader/ContentDownloader.cs | 2 +- DepotDownloader/PlatformUtilities.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 43254c2..21a482c 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -11,7 +11,7 @@ using SteamKit2.CDN; namespace DepotDownloader { - public class ContentDownloaderException : Exception + class ContentDownloaderException : Exception { public ContentDownloaderException(String value) : base(value) { } } diff --git a/DepotDownloader/PlatformUtilities.cs b/DepotDownloader/PlatformUtilities.cs index 5ecdc8d..9ffb70f 100644 --- a/DepotDownloader/PlatformUtilities.cs +++ b/DepotDownloader/PlatformUtilities.cs @@ -3,7 +3,7 @@ using System.Runtime.InteropServices; namespace DepotDownloader { - public static class PlatformUtilities + static class PlatformUtilities { private const int ModeExecuteOwner = 0x0040; private const int ModeExecuteGroup = 0x0008; From 09f9674bad6f77b14df8b504dfd27eb6939bd720 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Wed, 31 Jan 2024 21:03:14 +1100 Subject: [PATCH 4/7] Update NuGet packages (uncl SK2) --- DepotDownloader/DepotDownloader.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index 7ead18c..b142ba2 100644 --- a/DepotDownloader/DepotDownloader.csproj +++ b/DepotDownloader/DepotDownloader.csproj @@ -13,8 +13,8 @@ - + - + From 225a26c321bca46761206a656b8c565383da24c2 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Wed, 31 Jan 2024 21:05:49 +1100 Subject: [PATCH 5/7] Fix warning NETSDK1194 about --output from .sln files --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac45f0a..3e4e354 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,31 +45,31 @@ jobs: - name: Publish Windows-x64 if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest' - run: dotnet publish --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-x64 --output selfcontained-win-x64 + run: dotnet publish DepotDownloader\DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-x64 --output selfcontained-win-x64 - name: Publish Windows-arm64 if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest' - run: dotnet publish --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-arm64 --output selfcontained-win-arm64 + run: dotnet publish DepotDownloader\DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-arm64 --output selfcontained-win-arm64 - name: Publish Linux-x64 if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - run: dotnet publish --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-x64 --output selfcontained-linux-x64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-x64 --output selfcontained-linux-x64 - name: Publish Linux-arm if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - run: dotnet publish --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-arm --output selfcontained-linux-arm + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-arm --output selfcontained-linux-arm - name: Publish Linux-arm64 if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - run: dotnet publish --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-arm64 --output selfcontained-linux-arm64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-arm64 --output selfcontained-linux-arm64 - name: Publish macOS-x64 if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-latest' - run: dotnet publish --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime osx-x64 --output selfcontained-osx-x64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime osx-x64 --output selfcontained-osx-x64 - name: Publish macOS-arm64 if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-14' - run: dotnet publish --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime osx-arm64 --output selfcontained-osx-arm64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime osx-arm64 --output selfcontained-osx-arm64 - name: Upload Windows-x64 uses: actions/upload-artifact@v3 From bf71c4c0b992f3c27bd13316ac28f28e34abde66 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Wed, 31 Jan 2024 21:07:27 +1100 Subject: [PATCH 6/7] Remove obsolete sentry file code --- DepotDownloader/AccountSettingsStore.cs | 4 +-- DepotDownloader/Steam3Session.cs | 48 ------------------------- 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/DepotDownloader/AccountSettingsStore.cs b/DepotDownloader/AccountSettingsStore.cs index 8bed962..6407886 100644 --- a/DepotDownloader/AccountSettingsStore.cs +++ b/DepotDownloader/AccountSettingsStore.cs @@ -11,8 +11,7 @@ namespace DepotDownloader [ProtoContract] class AccountSettingsStore { - [ProtoMember(1, IsRequired = false)] - public Dictionary SentryData { get; private set; } + // Member 1 was a Dictionary for SentryData. [ProtoMember(2, IsRequired = false)] public ConcurrentDictionary ContentServerPenalty { get; private set; } @@ -26,7 +25,6 @@ namespace DepotDownloader AccountSettingsStore() { - SentryData = new Dictionary(); ContentServerPenalty = new ConcurrentDictionary(); LoginTokens = new Dictionary(); } diff --git a/DepotDownloader/Steam3Session.cs b/DepotDownloader/Steam3Session.cs index 206b3b5..09ed25a 100644 --- a/DepotDownloader/Steam3Session.cs +++ b/DepotDownloader/Steam3Session.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -112,26 +111,8 @@ namespace DepotDownloader this.callbacks.Subscribe(LogOnCallback); this.callbacks.Subscribe(SessionTokenCallback); this.callbacks.Subscribe(LicenseListCallback); - this.callbacks.Subscribe(UpdateMachineAuthCallback); Console.Write("Connecting to Steam3..."); - - if (details.Username != null) - { - var fi = new FileInfo(String.Format("{0}.sentryFile", logonDetails.Username)); - if (AccountSettingsStore.Instance.SentryData != null && AccountSettingsStore.Instance.SentryData.ContainsKey(logonDetails.Username)) - { - logonDetails.SentryFileHash = Util.SHAHash(AccountSettingsStore.Instance.SentryData[logonDetails.Username]); - } - else if (fi.Exists && fi.Length > 0) - { - var sentryData = File.ReadAllBytes(fi.FullName); - logonDetails.SentryFileHash = Util.SHAHash(sentryData); - AccountSettingsStore.Instance.SentryData[logonDetails.Username] = sentryData; - AccountSettingsStore.Save(); - } - } - Connect(); } @@ -749,35 +730,6 @@ namespace DepotDownloader } } - private void UpdateMachineAuthCallback(SteamUser.UpdateMachineAuthCallback machineAuth) - { - var hash = Util.SHAHash(machineAuth.Data); - Console.WriteLine("Got Machine Auth: {0} {1} {2} {3}", machineAuth.FileName, machineAuth.Offset, machineAuth.BytesToWrite, machineAuth.Data.Length); - - AccountSettingsStore.Instance.SentryData[logonDetails.Username] = machineAuth.Data; - AccountSettingsStore.Save(); - - var authResponse = new SteamUser.MachineAuthDetails - { - BytesWritten = machineAuth.BytesToWrite, - FileName = machineAuth.FileName, - FileSize = machineAuth.BytesToWrite, - Offset = machineAuth.Offset, - - SentryFileHash = hash, // should be the sha1 hash of the sentry file we just wrote - - OneTimePassword = machineAuth.OneTimePassword, // not sure on this one yet, since we've had no examples of steam using OTPs - - LastError = 0, // result from win32 GetLastError - Result = EResult.OK, // if everything went okay, otherwise ~who knows~ - - JobID = machineAuth.JobID, // so we respond to the correct server job - }; - - // send off our response - steamUser.SendMachineAuthResponse(authResponse); - } - private static void DisplayQrCode(string challengeUrl) { // Encode the link as a QR code From 3429010f50ac6c45e672a64eb63c81b421649198 Mon Sep 17 00:00:00 2001 From: Yaakov Date: Wed, 31 Jan 2024 21:10:14 +1100 Subject: [PATCH 7/7] Fix another instance of new .NET 8 SDK warning --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e4e354..60a96c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: dotnet-version: 8.0.x - name: Build - run: dotnet publish -c ${{ matrix.configuration }} -o artifacts + run: dotnet publish DepotDownloader/DepotDownloader.csproj -c ${{ matrix.configuration }} -o artifacts - name: Upload artifact uses: actions/upload-artifact@v3 @@ -45,11 +45,11 @@ jobs: - name: Publish Windows-x64 if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest' - run: dotnet publish DepotDownloader\DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-x64 --output selfcontained-win-x64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-x64 --output selfcontained-win-x64 - name: Publish Windows-arm64 if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest' - run: dotnet publish DepotDownloader\DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-arm64 --output selfcontained-win-arm64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-arm64 --output selfcontained-win-arm64 - name: Publish Linux-x64 if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest'