diff --git a/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj b/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj
index fffc9e5b3..e460297b8 100644
--- a/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj
+++ b/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj
@@ -1,60 +1,60 @@
-
- net6.0
- System
- false
-
- System.Application.SteamTools.Client.Desktop.Avalonia
- true
-
+
+ net6.0
+ System
+ false
+
+ System.Application.SteamTools.Client.Desktop.Avalonia
+ true
+
-
-
- %(Filename)
-
-
- Designer
-
-
-
-
+
+
+ %(Filename)
+
+
+ Designer
+
+
+
+
-
-
-
-
+
+
+
+
-
-
- Properties\AssemblyInfo.cs
-
-
- Properties\AssemblyInfo.Version.cs
-
-
- Properties\InternalsVisibleTo.cs
-
-
+
+
+ Properties\AssemblyInfo.cs
+
+
+ Properties\AssemblyInfo.Version.cs
+
+
+ Properties\InternalsVisibleTo.cs
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/src/ST.Client/Services/IArchiSteamFarmService.cs b/src/ST.Client/Services/IArchiSteamFarmService.cs
index 2ea2a13d9..5f7779b32 100644
--- a/src/ST.Client/Services/IArchiSteamFarmService.cs
+++ b/src/ST.Client/Services/IArchiSteamFarmService.cs
@@ -16,5 +16,11 @@ namespace System.Application.Services
///
///
void Start(string[]? args = null);
+
+ ///
+ /// 执行asf指令
+ ///
+ ///
+ Task ExecuteCommand(string command);
}
}
\ No newline at end of file
diff --git a/src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs b/src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs
index fdc25c5f1..10c0c074d 100644
--- a/src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs
+++ b/src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs
@@ -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>? GetConsoleWirteFunc { get; set; }
+ public Action? 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().FirstOrDefault();
+
+ if (historyTarget != null)
+ historyTarget.NewHistoryEntry += (object? sender, HistoryTarget.NewHistoryEntryArgs newHistoryEntryArgs) =>
+ {
+ GetConsoleWirteFunc?.Invoke(newHistoryEntryArgs.Message);
+ };
+ }
+
///
/// 执行asf指令
///
@@ -57,15 +75,24 @@ namespace System.Application.Services.Implementation
return Bot.BotsReadOnly;
}
-
///
/// 设置并保存bot
///
///
- public void SetBot(string botName)
+ public void SaveBot(string botName)
{
}
+ public GlobalConfig? GetGlobalConfig()
+ {
+ return ASF.GlobalConfig;
+ }
+
+
+ public void SaveGlobalConfig(GlobalConfig config)
+ {
+
+ }
}
}