Extracted code to library in .net standard

pull/143/head
Raphael Guntersweiler 5 years ago
parent a6d30efade
commit ee560060f6

@ -8,10 +8,10 @@ using System.Linq;
using SteamKit2; using SteamKit2;
using SteamKit2.Discovery; using SteamKit2.Discovery;
namespace DepotDownloader namespace DepotDownloader.Core
{ {
[ProtoContract] [ProtoContract]
class AccountSettingsStore public class AccountSettingsStore
{ {
[ProtoMember(1, IsRequired=false)] [ProtoMember(1, IsRequired=false)]
public Dictionary<string, byte[]> SentryData { get; private set; } public Dictionary<string, byte[]> SentryData { get; private set; }

@ -7,12 +7,12 @@ using System.Net;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DepotDownloader namespace DepotDownloader.Core
{ {
/// <summary> /// <summary>
/// CDNClientPool provides a pool of connections to CDN endpoints, requesting CDN tokens as needed /// CDNClientPool provides a pool of connections to CDN endpoints, requesting CDN tokens as needed
/// </summary> /// </summary>
class CDNClientPool public class CDNClientPool
{ {
private const int ServerEndpointMinimumSize = 8; private const int ServerEndpointMinimumSize = 8;

@ -9,14 +9,14 @@ using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DepotDownloader namespace DepotDownloader.Core
{ {
public class ContentDownloaderException : System.Exception public class ContentDownloaderException : System.Exception
{ {
public ContentDownloaderException( String value ) : base( value ) {} public ContentDownloaderException( String value ) : base( value ) {}
} }
static class ContentDownloader public static class ContentDownloader
{ {
public const uint INVALID_APP_ID = uint.MaxValue; public const uint INVALID_APP_ID = uint.MaxValue;
public const uint INVALID_DEPOT_ID = uint.MaxValue; public const uint INVALID_DEPOT_ID = uint.MaxValue;

@ -4,7 +4,7 @@ using ProtoBuf;
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
namespace DepotDownloader namespace DepotDownloader.Core
{ {
[ProtoContract] [ProtoContract]
class DepotConfigStore class DepotConfigStore

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="protobuf-net" Version="3.0.52" />
<PackageReference Include="SteamKit2" Version="2.3.0" />
</ItemGroup>
</Project>

@ -1,9 +1,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace DepotDownloader namespace DepotDownloader.Core
{ {
class DownloadConfig public class DownloadConfig
{ {
public int CellID { get; set; } public int CellID { get; set; }
public bool DownloadAllPlatforms { get; set; } public bool DownloadAllPlatforms { get; set; }

@ -6,10 +6,10 @@ using System.IO.Compression;
using ProtoBuf; using ProtoBuf;
using SteamKit2; using SteamKit2;
namespace DepotDownloader namespace DepotDownloader.Core
{ {
[ProtoContract()] [ProtoContract()]
class ProtoManifest public class ProtoManifest
{ {
// Proto ctor // Proto ctor
private ProtoManifest() private ProtoManifest()

@ -9,10 +9,10 @@ using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DepotDownloader namespace DepotDownloader.Core
{ {
class Steam3Session public class Steam3Session
{ {
public class Credentials public class Credentials
{ {
@ -649,7 +649,7 @@ namespace DepotDownloader
{ {
if ( license.AccessToken > 0 ) if ( license.AccessToken > 0 )
{ {
PackageTokens.TryAdd( license.PackageID, license.AccessToken ); PackageTokens.Add(license.PackageID, license.AccessToken);
} }
} }
} }

@ -6,9 +6,9 @@ using System.Runtime.InteropServices;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
namespace DepotDownloader namespace DepotDownloader.Core
{ {
static class Util public static class Util
{ {
public static string GetSteamOS() public static string GetSteamOS()
{ {

@ -1,9 +1,11 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio Version 16
VisualStudioVersion = 15.0.26228.4 VisualStudioVersion = 16.0.30517.126
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DepotDownloader", "DepotDownloader\DepotDownloader.csproj", "{39159C47-ACD3-449F-96CA-4F30C8ED147A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DepotDownloader", "DepotDownloader\DepotDownloader.csproj", "{39159C47-ACD3-449F-96CA-4F30C8ED147A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DepotDownloader.Core", "DepotDownloader.Core\DepotDownloader.Core.csproj", "{8303B6A1-CE40-4C26-9376-DB08290645F7}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -15,8 +17,15 @@ Global
{39159C47-ACD3-449F-96CA-4F30C8ED147A}.Debug|Any CPU.Build.0 = Debug|Any CPU {39159C47-ACD3-449F-96CA-4F30C8ED147A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39159C47-ACD3-449F-96CA-4F30C8ED147A}.Release|Any CPU.ActiveCfg = Release|Any CPU {39159C47-ACD3-449F-96CA-4F30C8ED147A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39159C47-ACD3-449F-96CA-4F30C8ED147A}.Release|Any CPU.Build.0 = Release|Any CPU {39159C47-ACD3-449F-96CA-4F30C8ED147A}.Release|Any CPU.Build.0 = Release|Any CPU
{8303B6A1-CE40-4C26-9376-DB08290645F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8303B6A1-CE40-4C26-9376-DB08290645F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8303B6A1-CE40-4C26-9376-DB08290645F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8303B6A1-CE40-4C26-9376-DB08290645F7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B9D19618-4471-4B6A-999B-3884575BE066}
EndGlobalSection
EndGlobal EndGlobal

@ -1,11 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="protobuf-net" Version="3.0.24" /> <ProjectReference Include="..\DepotDownloader.Core\DepotDownloader.Core.csproj" />
<PackageReference Include="SteamKit2" Version="2.3.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -6,6 +6,8 @@ using SteamKit2;
using System.ComponentModel; using System.ComponentModel;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using DepotDownloader.Core;
namespace DepotDownloader namespace DepotDownloader
{ {
class Program class Program

Loading…
Cancel
Save