Skip to content

Commit

Permalink
Bump to ArchiSteamFarm v5.2.6.3-library
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Jun 8, 2022
1 parent 32ffa2f commit b952be2
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 899 deletions.
633 changes: 0 additions & 633 deletions references/ArchiSteamFarmLogManager.cs

This file was deleted.

91 changes: 0 additions & 91 deletions references/ArchiSteamFarmPathHelper.cs

This file was deleted.

14 changes: 0 additions & 14 deletions references/IArchiSteamFarmHelperService.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Application.UI.ViewModels;
using System.Application.UI.Activities;
using ArchiSteamFarm;
using ArchiSteamFarm.Library;
using static System.Application.UI.Resx.AppResources;

// ReSharper disable once CheckNamespace
Expand Down Expand Up @@ -102,32 +103,32 @@ protected override bool OnClick(View view)
}
else if (view.Id == Resource.Id.layoutRootOpenDirASFConfig)
{
OpenFolder(ASFPathFolder.Config);
OpenFolder(EPathFolder.Config);
return true;
}
else if (view.Id == Resource.Id.layoutRootOpenDirASFPlugin)
{
OpenFolder(ASFPathFolder.Plugin);
OpenFolder(EPathFolder.Plugin);
return true;
}
else if (view.Id == Resource.Id.layoutRootOpenDirASFLog)
{
OpenFolder(ASFPathFolder.Logs);
OpenFolder(EPathFolder.Logs);
return true;
}
else if (view.Id == Resource.Id.layoutRootOpenDirASFWebUI)
{
OpenFolder(ASFPathFolder.WWW);
OpenFolder(EPathFolder.WWW);
return true;
}
return base.OnClick(view);
}

void SetAutoRunArchiSteamFarm() => binding!.swASFSettingsAutoRunArchiSteamFarm.Checked = ASFSettings.AutoRunArchiSteamFarm.Value;

void OpenFolder(ASFPathFolder folderASFPath)
void OpenFolder(EPathFolder folderASFPath)
{
var folderASFPathValue = IArchiSteamFarmService.GetFolderPath(folderASFPath);
var folderASFPathValue = folderASFPath.GetFolderPath();
GoToPlatformPages.StartActivity<ExplorerActivity, string>(Activity, folderASFPathValue);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ private void Dispose(bool disposing)
{
// TODO: 释放托管状态(托管对象)
NLog.LogManager.Shutdown();
ArchiSteamFarm.LogManager.Shutdown();
}

// TODO: 释放未托管的资源(未托管的对象)并重写终结器
Expand Down
10 changes: 0 additions & 10 deletions src/ST.Client/Properties/SR.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/ST.Client/Properties/SR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="asf_ui" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\asf-ui.tbr;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="OpenSourceLibraryList" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OpenSourceLibraryList.mpo;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
Expand Down
Binary file removed src/ST.Client/Resources/asf-ui.tbr
Binary file not shown.
15 changes: 1 addition & 14 deletions src/ST.Client/Services/IArchiSteamFarmService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial interface IArchiSteamFarmService
{
static new IArchiSteamFarmService Instance => DI.Get<IArchiSteamFarmService>();

static Action? InitCoreLoggers { protected get; set; }
//static Action? InitCoreLoggers { protected get; set; }

event Action<string>? OnConsoleWirteLine;

Expand Down Expand Up @@ -78,18 +78,5 @@ async void CommandSubmit(string? command)
ReadLineTask.TrySetResult(command);
}
}

static string GetFolderPath(ASFPathFolder folderASFPath)
{
var folderASFPathValue = folderASFPath switch
{
ASFPathFolder.Config => IOPath.DirCreateByNotExists(SharedInfo.ConfigDirectory),
ASFPathFolder.Plugin => IOPath.DirCreateByNotExists(SharedInfo.PluginsDirectory),
ASFPathFolder.WWW => ASFPathHelper.WebsiteDirectory,
ASFPathFolder.Logs => IApplication.LogDirPathASF,
ASFPathFolder.ASF or _ => ASFPathHelper.AppDataDirectory,
};
return folderASFPathValue;
}
}
}
30 changes: 15 additions & 15 deletions src/ST.Client/Services/IArchiSteamFarmService.lib_impl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
using System.Net;
using System.Net.Sockets;
using System.Text;
using ArchiSteamFarm.Library;

namespace System.Application.Services
namespace System.Application.Services;

partial interface IArchiSteamFarmService : IArchiSteamFarmHelperService
{
partial interface IArchiSteamFarmService : IArchiSteamFarmHelperService
{
int CurrentIPCPortValue { get; protected set; }
int CurrentIPCPortValue { get; protected set; }

int IArchiSteamFarmHelperService.IPCPortValue
int IArchiSteamFarmHelperService.IPCPortValue
{
get
{
get
CurrentIPCPortValue = ASFSettings.IPCPortId.Value;
if (CurrentIPCPortValue == default) CurrentIPCPortValue = ASFSettings.DefaultIPCPortIdValue;
if (ASFSettings.IPCPortOccupiedRandom.Value)
{
CurrentIPCPortValue = ASFSettings.IPCPortId.Value;
if (CurrentIPCPortValue == default) CurrentIPCPortValue = ASFSettings.DefaultIPCPortIdValue;
if (ASFSettings.IPCPortOccupiedRandom.Value)
if (SocketHelper.IsUsePort(CurrentIPCPortValue))
{
if (SocketHelper.IsUsePort(CurrentIPCPortValue))
{
CurrentIPCPortValue = SocketHelper.GetRandomUnusedPort(IPAddress.Loopback);
return CurrentIPCPortValue;
}
CurrentIPCPortValue = SocketHelper.GetRandomUnusedPort(IPAddress.Loopback);
return CurrentIPCPortValue;
}
return CurrentIPCPortValue;
}
return CurrentIPCPortValue;
}
}
}

This file was deleted.

21 changes: 15 additions & 6 deletions src/ST.Client/Services/Implementation/ArchiSteamFarmServiceImpl.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using ArchiSteamFarm;
using ArchiSteamFarm.Core;
using ArchiSteamFarm.Library;
using ArchiSteamFarm.Localization;
using ArchiSteamFarm.NLog.Targets;
using ArchiSteamFarm.Steam;
using ArchiSteamFarm.Steam.Storage;
using ArchiSteamFarm.Storage;
using Microsoft.Extensions.Configuration;
using ReactiveUI;
using System.Application.UI;
using System.Application.UI.Resx;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -40,6 +42,17 @@ public bool IsReadPasswordLine

private bool isFirstStart = true;

sealed class Ioc : IIoc
{
private Ioc() { }

public static Ioc Instance { get; } = new();

public T GetRequiredService<T>() where T : class => DI.Get<T>();

public T? GetService<T>() where T : class => DI.Get_Nullable<T>();
}

public async Task<bool> Start(string[]? args = null)
{
try
Expand All @@ -48,13 +61,9 @@ public async Task<bool> Start(string[]? args = null)

if (isFirstStart)
{
IArchiSteamFarmService.InitCoreLoggers?.Invoke();

TryUnPackASFUI();
//IArchiSteamFarmService.InitCoreLoggers?.Invoke();

// 初始化文件夹
var folders = Enum2.GetAll<ASFPathFolder>();
Array.ForEach(folders, f => IArchiSteamFarmService.GetFolderPath(f));
ArchiSteamFarmLibrary.Init(Ioc.Instance, IOPath.AppDataDirectory, IApplication.LogDirPathASF);

InitHistoryLogger();

Expand Down
Loading

0 comments on commit b952be2

Please sign in to comment.