Skip to content

Commit

Permalink
migrate Steam.Service
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Feb 26, 2021
1 parent 7fca600 commit 1d92c13
Show file tree
Hide file tree
Showing 20 changed files with 700 additions and 84 deletions.
24 changes: 14 additions & 10 deletions SteamToolsV1.2+.sln
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ Global
{D1F15D97-802E-4AA3-A4A5-B890ABE32897}.Release|Any CPU.Build.0 = Release|Any CPU
{D1F15D97-802E-4AA3-A4A5-B890ABE32897}.Release|x86.ActiveCfg = Release|Any CPU
{D1F15D97-802E-4AA3-A4A5-B890ABE32897}.Release|x86.Build.0 = Release|Any CPU
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Debug|x86.ActiveCfg = Debug|Any CPU
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Debug|x86.Build.0 = Debug|Any CPU
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Release|Any CPU.Build.0 = Release|Any CPU
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Debug|Any CPU.ActiveCfg = Debug|x86
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Debug|Any CPU.Build.0 = Debug|x86
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Debug|x86.ActiveCfg = Debug|x86
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Debug|x86.Build.0 = Debug|x86
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Release|Any CPU.ActiveCfg = Release|x86
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Release|Any CPU.Build.0 = Release|x86
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Release|x86.ActiveCfg = Release|Any CPU
{2FFA5BCE-B3C3-46EA-8830-838C938BF814}.Release|x86.Build.0 = Release|Any CPU
{4F09B6D1-3F83-45A0-AEC8-0F243E7CD263}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -227,12 +227,12 @@ Global
{948C1EA8-12DB-4F8A-A190-8615DFBD9FE4}.Release|Any CPU.Build.0 = Release|Any CPU
{948C1EA8-12DB-4F8A-A190-8615DFBD9FE4}.Release|x86.ActiveCfg = Release|Any CPU
{948C1EA8-12DB-4F8A-A190-8615DFBD9FE4}.Release|x86.Build.0 = Release|Any CPU
{141532E1-540E-4E50-8723-96936C191281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{141532E1-540E-4E50-8723-96936C191281}.Debug|Any CPU.Build.0 = Debug|Any CPU
{141532E1-540E-4E50-8723-96936C191281}.Debug|Any CPU.ActiveCfg = Debug|x86
{141532E1-540E-4E50-8723-96936C191281}.Debug|Any CPU.Build.0 = Debug|x86
{141532E1-540E-4E50-8723-96936C191281}.Debug|x86.ActiveCfg = Debug|Any CPU
{141532E1-540E-4E50-8723-96936C191281}.Debug|x86.Build.0 = Debug|Any CPU
{141532E1-540E-4E50-8723-96936C191281}.Release|Any CPU.ActiveCfg = Release|Any CPU
{141532E1-540E-4E50-8723-96936C191281}.Release|Any CPU.Build.0 = Release|Any CPU
{141532E1-540E-4E50-8723-96936C191281}.Release|Any CPU.ActiveCfg = Release|x86
{141532E1-540E-4E50-8723-96936C191281}.Release|Any CPU.Build.0 = Release|x86
{141532E1-540E-4E50-8723-96936C191281}.Release|x86.ActiveCfg = Release|Any CPU
{141532E1-540E-4E50-8723-96936C191281}.Release|x86.Build.0 = Release|Any CPU
{60530AF8-4790-4A85-BCE2-C5673E9C601B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -260,15 +260,19 @@ Global
{D018C980-17FD-49BB-A95D-EDE3C18BBE0A}.Release|x86.ActiveCfg = Release|Any CPU
{D018C980-17FD-49BB-A95D-EDE3C18BBE0A}.Release|x86.Build.0 = Release|Any CPU
{6DD9644F-F005-4C19-8ADF-70C303EC5BB8}.Debug|Any CPU.ActiveCfg = Debug|x86
{6DD9644F-F005-4C19-8ADF-70C303EC5BB8}.Debug|Any CPU.Build.0 = Debug|x86
{6DD9644F-F005-4C19-8ADF-70C303EC5BB8}.Debug|x86.ActiveCfg = Debug|x86
{6DD9644F-F005-4C19-8ADF-70C303EC5BB8}.Debug|x86.Build.0 = Debug|x86
{6DD9644F-F005-4C19-8ADF-70C303EC5BB8}.Release|Any CPU.ActiveCfg = Release|x86
{6DD9644F-F005-4C19-8ADF-70C303EC5BB8}.Release|Any CPU.Build.0 = Release|x86
{6DD9644F-F005-4C19-8ADF-70C303EC5BB8}.Release|x86.ActiveCfg = Release|x86
{6DD9644F-F005-4C19-8ADF-70C303EC5BB8}.Release|x86.Build.0 = Release|x86
{3C05CED6-7712-40F0-AF17-8DD3F4C0A224}.Debug|Any CPU.ActiveCfg = Debug|x86
{3C05CED6-7712-40F0-AF17-8DD3F4C0A224}.Debug|Any CPU.Build.0 = Debug|x86
{3C05CED6-7712-40F0-AF17-8DD3F4C0A224}.Debug|x86.ActiveCfg = Debug|x86
{3C05CED6-7712-40F0-AF17-8DD3F4C0A224}.Debug|x86.Build.0 = Debug|x86
{3C05CED6-7712-40F0-AF17-8DD3F4C0A224}.Release|Any CPU.ActiveCfg = Release|x86
{3C05CED6-7712-40F0-AF17-8DD3F4C0A224}.Release|Any CPU.Build.0 = Release|x86
{3C05CED6-7712-40F0-AF17-8DD3F4C0A224}.Release|x86.ActiveCfg = Release|x86
{3C05CED6-7712-40F0-AF17-8DD3F4C0A224}.Release|x86.Build.0 = Release|x86
{35D60129-6652-4B6E-A04A-9766C3CF1869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public override void OnFrameworkInitializationCompleted()
// ÔÚUIÔ¤ÀÀÖУ¬ApplicationLifetime Ϊ null
ViewModelBase.IsInDesignMode = ApplicationLifetime == null;

Startup.Init();

if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
if (!AppHelper.IsOfficialChannelPackage)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using Avalonia;
using Avalonia.ReactiveUI;
using Microsoft.Extensions.DependencyInjection;
using NLog;
using System.Application.Models;
using System.Application.Services.Implementation;
using System.Application.UI.ViewModels;

namespace System.Application.UI
{
Expand All @@ -22,9 +18,6 @@ static void Main(string[] args)
var logger = LogManager.GetCurrentClassLogger();
try
{
FileSystemDesktop.InitFileSystem();
ModelValidatorProvider.Init();
DI.Init(ConfigureServices);
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
catch (Exception ex)
Expand All @@ -49,57 +42,5 @@ static AppBuilder BuildAvaloniaApp()
.With(new Win32PlatformOptions { AllowEglInitialization = true })
.LogToTrace()
.UseReactiveUI();

static void ConfigureServices(IServiceCollection services)
{
// 添加日志实现
services.AddDesktopLogging();

// 模型验证框架
services.TryAddModelValidator();

//var options = AppClientAttribute.Get<AppSettings>();
var options = new AppSettings
{
//AppSecretVisualStudioAppCenter = "",
};
// app 配置项
services.TryAddOptions(options);

// 键值对存储
services.TryAddStorage();

// 业务平台用户管理
services.TryAddUserManager();

// 服务端API调用
services.TryAddCloudServiceClient<CloudServiceClient>();

// 桌面平台服务
services.AddDesktopPlatformService();

// 本地化服务
services.AddLocalizationService();

// 主线程助手类(MainThreadDesktop)
services.AddMainThreadPlatformService();

// 模型视图组
services.AddViewModelCollectionService();
services.AddViewModel<MainWindowViewModel>();
services.AddViewModel<SettingsPageViewModel>();

// 业务用户配置文件服务
services.AddConfigFileService();

// hosts 文件助手服务
services.AddHostsFileService();

// 通用 Http 服务
services.AddHttpService();

// Steam 相关助手、工具类服务
services.AddSteamService();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
using Microsoft.Extensions.DependencyInjection;
using System.Application.Models;
using System.Application.Services.Implementation;
using System.Application.UI.ViewModels;

namespace System.Application.UI
{
internal static class Startup
{
public static void Init()
{
FileSystemDesktop.InitFileSystem();
ModelValidatorProvider.Init();
DI.Init(ConfigureServices);
}

static void ConfigureServices(IServiceCollection services)
{
// 添加日志实现
services.AddDesktopLogging();

// 模型验证框架
services.TryAddModelValidator();

//var options = AppClientAttribute.Get<AppSettings>();
var options = new AppSettings
{
//AppSecretVisualStudioAppCenter = "",
};
// app 配置项
services.TryAddOptions(options);

// 键值对存储
services.TryAddStorage();

// 业务平台用户管理
services.TryAddUserManager();

// 服务端API调用
services.TryAddCloudServiceClient<CloudServiceClient>();

// 桌面平台服务 此项放在其他通用业务实现服务之前
services.AddDesktopPlatformService();

// 本地化服务
services.AddLocalizationService();

// 主线程助手类(MainThreadDesktop)
services.AddMainThreadPlatformService();

// 模型视图组
services.AddViewModelCollectionService();
services.AddViewModel<MainWindowViewModel>();
services.AddViewModel<SettingsPageViewModel>();

// 业务用户配置文件服务
services.AddConfigFileService();

// hosts 文件助手服务
services.AddHostsFileService();

// 通用 Http 服务
services.AddHttpService();

// Steam 相关助手、工具类服务
services.AddSteamService();

// Steamworks LocalApi Service
services.TryAddSteamworksLocalApiService();

// SteamDb WebApi Service
services.AddSteamDbWebApiService();

// Steamworks WebApi Service
services.AddSteamworksWebApiService();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>

<PropertyGroup Condition=" $(RuntimeIdentifier.Contains(`win`)) Or ('$(OS)' == 'Windows_NT' And !$(DefineConstants.Contains(`PUBLISH`))) ">
<!--因Win平台引入了SAM/Steam4NET仅支持x86构架-->
<Platforms>x86</Platforms>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\System.Common.CoreLib\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
Expand Down
Loading

0 comments on commit 1d92c13

Please sign in to comment.