Share HttpClient with SK2 WebAPI

This commit is contained in:
JustArchi
2019-02-11 03:52:14 +01:00
parent 756888b0c4
commit 46d61196c7
3 changed files with 15 additions and 10 deletions

View File

@@ -93,6 +93,7 @@ namespace ArchiSteamFarm {
internal readonly ConcurrentDictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)> OwnedPackageIDs = new ConcurrentDictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)>();
internal readonly SteamApps SteamApps;
internal readonly SteamConfiguration SteamConfiguration;
internal readonly SteamFriends SteamFriends;
internal bool CanReceiveSteamCards => !IsAccountLimited && !IsAccountLocked;
@@ -213,10 +214,10 @@ namespace ArchiSteamFarm {
ArchiWebHandler = new ArchiWebHandler(this);
SteamConfiguration steamConfiguration = SteamConfiguration.Create(builder => builder.WithProtocolTypes(ASF.GlobalConfig.SteamProtocols).WithCellID(ASF.GlobalDatabase.CellID).WithServerListProvider(ASF.GlobalDatabase.ServerListProvider).WithHttpClientFactory(() => ArchiWebHandler.GenerateDisposableHttpClient()));
SteamConfiguration = SteamConfiguration.Create(builder => builder.WithProtocolTypes(ASF.GlobalConfig.SteamProtocols).WithCellID(ASF.GlobalDatabase.CellID).WithServerListProvider(ASF.GlobalDatabase.ServerListProvider).WithHttpClientFactory(ArchiWebHandler.GenerateDisposableHttpClient));
// Initialize
SteamClient = new SteamClient(steamConfiguration);
SteamClient = new SteamClient(SteamConfiguration);
if (Debugging.IsUserDebugging && Directory.Exists(SharedInfo.DebugDirectory)) {
string debugListenerPath = Path.Combine(SharedInfo.DebugDirectory, botName);