mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-28 23:19:53 +08:00
Misc
This commit is contained in:
@@ -1,60 +1,60 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>System</RootNamespace>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
<!--(SignAssembly)对此程序集进行签名会导致编译失败(CompileAvaloniaXamlTask)-->
|
||||
<AssemblyName>System.Application.SteamTools.Client.Desktop.Avalonia</AssemblyName>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>System</RootNamespace>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
<!--(SignAssembly)对此程序集进行签名会导致编译失败(CompileAvaloniaXamlTask)-->
|
||||
<AssemblyName>System.Application.SteamTools.Client.Desktop.Avalonia</AssemblyName>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="**\*.xaml.cs">
|
||||
<DependentUpon>%(Filename)</DependentUpon>
|
||||
</Compile>
|
||||
<AvaloniaResource Include="**\*.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</AvaloniaResource>
|
||||
<AvaloniaResource Include="Assets\**" />
|
||||
<AvaloniaResource Include="Application\UI\Assets\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="**\*.xaml.cs">
|
||||
<DependentUpon>%(Filename)</DependentUpon>
|
||||
</Compile>
|
||||
<AvaloniaResource Include="**\*.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</AvaloniaResource>
|
||||
<AvaloniaResource Include="Assets\**" />
|
||||
<AvaloniaResource Include="Application\UI\Assets\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Application\UI\Assets\Fonts\WenQuanYiMicroHei-01.ttf" />
|
||||
<None Remove="Application\UI\Assets\movecross.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Application\UI\Assets\Fonts\WenQuanYiMicroHei-01.ttf" />
|
||||
<None Remove="Application\UI\Assets\movecross.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Common.CoreLib\Properties\AssemblyInfo.cs">
|
||||
<Link>Properties\AssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common.CoreLib\Properties\AssemblyInfo.Version.cs">
|
||||
<Link>Properties\AssemblyInfo.Version.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\ST\Properties\InternalsVisibleTo.cs">
|
||||
<Link>Properties\InternalsVisibleTo.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Common.CoreLib\Properties\AssemblyInfo.cs">
|
||||
<Link>Properties\AssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common.CoreLib\Properties\AssemblyInfo.Version.cs">
|
||||
<Link>Properties\AssemblyInfo.Version.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\ST\Properties\InternalsVisibleTo.cs">
|
||||
<Link>Properties\InternalsVisibleTo.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\references\AvaloniaGif\AvaloniaGif\AvaloniaGif.csproj" />
|
||||
<ProjectReference Include="..\Common.CoreLib\Common.CoreLib.csproj" />
|
||||
<ProjectReference Include="..\ST.Client.Desktop\ST.Client.Desktop.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\references\AvaloniaGif\AvaloniaGif\AvaloniaGif.csproj" />
|
||||
<ProjectReference Include="..\Common.CoreLib\Common.CoreLib.csproj" />
|
||||
<ProjectReference Include="..\ST.Client.Desktop\ST.Client.Desktop.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="0.10.999-cibuild0014582-beta" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="0.10.999-cibuild0014582-beta" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.999-cibuild0014582-beta" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.999-cibuild0014582-beta" />
|
||||
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.6" />
|
||||
<PackageReference Include="CefNet.Avalonia" Version="90.6.21124.1851" />
|
||||
<PackageReference Include="LibVLCSharp.Avalonia" Version="3.5.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="0.10.999-cibuild0014750-beta" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="0.10.999-cibuild0014750-beta" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.999-cibuild0014750-beta" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.999-cibuild0014750-beta" />
|
||||
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.6" />
|
||||
<PackageReference Include="CefNet.Avalonia" Version="90.6.21124.1851" />
|
||||
<PackageReference Include="LibVLCSharp.Avalonia" Version="3.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.999-cibuild0014582-beta" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.999-cibuild0014750-beta" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -16,5 +16,11 @@ namespace System.Application.Services
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
void Start(string[]? args = null);
|
||||
|
||||
/// <summary>
|
||||
/// 执行asf指令
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
Task<string?> ExecuteCommand(string command);
|
||||
}
|
||||
}
|
||||
@@ -4,19 +4,24 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ArchiSteamFarm.Core;
|
||||
using ArchiSteamFarm.Storage;
|
||||
using ArchiSteamFarm.NLog.Targets;
|
||||
using ArchiSteamFarm.Steam;
|
||||
using NLog;
|
||||
|
||||
namespace System.Application.Services.Implementation
|
||||
{
|
||||
public class ArchiSteamFarmServiceImpl : IArchiSteamFarmService
|
||||
{
|
||||
public Func<string, Task<string?>>? GetConsoleWirteFunc { get; set; }
|
||||
public Action<string>? GetConsoleWirteFunc { get; set; }
|
||||
|
||||
public async void Start(string[]? args = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
await ArchiSteamFarm.Program.Init(args).ConfigureAwait(false);
|
||||
|
||||
InitHistoryLogger();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -24,6 +29,19 @@ namespace System.Application.Services.Implementation
|
||||
}
|
||||
}
|
||||
|
||||
private void InitHistoryLogger()
|
||||
{
|
||||
ArchiSteamFarm.NLog.Logging.InitHistoryLogger();
|
||||
|
||||
HistoryTarget? historyTarget = LogManager.Configuration.AllTargets.OfType<HistoryTarget>().FirstOrDefault();
|
||||
|
||||
if (historyTarget != null)
|
||||
historyTarget.NewHistoryEntry += (object? sender, HistoryTarget.NewHistoryEntryArgs newHistoryEntryArgs) =>
|
||||
{
|
||||
GetConsoleWirteFunc?.Invoke(newHistoryEntryArgs.Message);
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 执行asf指令
|
||||
/// </summary>
|
||||
@@ -57,15 +75,24 @@ namespace System.Application.Services.Implementation
|
||||
return Bot.BotsReadOnly;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置并保存bot
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public void SetBot(string botName)
|
||||
public void SaveBot(string botName)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public GlobalConfig? GetGlobalConfig()
|
||||
{
|
||||
return ASF.GlobalConfig;
|
||||
}
|
||||
|
||||
|
||||
public void SaveGlobalConfig(GlobalConfig config)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user