mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-19 15:58:39 +00:00
Compare commits
4 Commits
2.0.0.0-pr
...
2.0.0.0-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9064bbfda | ||
|
|
eddcc2816a | ||
|
|
52360a682a | ||
|
|
709ce6489b |
@@ -24,9 +24,11 @@
|
||||
|
||||
using SteamKit2;
|
||||
using SteamKit2.Internal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class ArchiHandler : ClientMsgHandler {
|
||||
@@ -216,7 +218,7 @@ namespace ArchiSteamFarm {
|
||||
Client.Send(request);
|
||||
}
|
||||
|
||||
internal AsyncJob<PurchaseResponseCallback> RedeemKey(string key) {
|
||||
internal async Task<PurchaseResponseCallback> RedeemKey(string key) {
|
||||
if (string.IsNullOrEmpty(key) || !Client.IsConnected) {
|
||||
return null;
|
||||
}
|
||||
@@ -228,7 +230,12 @@ namespace ArchiSteamFarm {
|
||||
request.Body.key = key;
|
||||
|
||||
Client.Send(request);
|
||||
return new AsyncJob<PurchaseResponseCallback>(Client, request.SourceJobID);
|
||||
try {
|
||||
return await new AsyncJob<PurchaseResponseCallback>(Client, request.SourceJobID);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -27,7 +27,6 @@ using SteamAuth;
|
||||
using SteamKit2;
|
||||
using SteamKit2.Internal;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
@@ -40,7 +39,7 @@ namespace ArchiSteamFarm {
|
||||
private const ulong ArchiSCFarmGroup = 103582791440160998;
|
||||
private const ushort CallbackSleep = 500; // In miliseconds
|
||||
|
||||
internal static readonly ConcurrentDictionary<string, Bot> Bots = new ConcurrentDictionary<string, Bot>();
|
||||
internal static readonly Dictionary<string, Bot> Bots = new Dictionary<string, Bot>();
|
||||
|
||||
private static readonly uint LoginID = MsgClientLogon.ObfuscationMask; // This must be the same for all ASF bots and all ASF processes
|
||||
|
||||
@@ -111,18 +110,6 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
bool alreadyExists;
|
||||
lock (Bots) {
|
||||
alreadyExists = Bots.ContainsKey(botName);
|
||||
if (!alreadyExists) {
|
||||
Bots[botName] = this;
|
||||
}
|
||||
}
|
||||
|
||||
if (alreadyExists) {
|
||||
return;
|
||||
}
|
||||
|
||||
BotName = botName;
|
||||
|
||||
string botPath = Path.Combine(Program.ConfigDirectory, botName);
|
||||
@@ -176,6 +163,18 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
bool alreadyExists;
|
||||
lock (Bots) {
|
||||
alreadyExists = Bots.ContainsKey(botName);
|
||||
if (!alreadyExists) {
|
||||
Bots[botName] = this;
|
||||
}
|
||||
}
|
||||
|
||||
if (alreadyExists) {
|
||||
return;
|
||||
}
|
||||
|
||||
BotDatabase = BotDatabase.Load(botPath + ".db");
|
||||
SentryFile = botPath + ".bin";
|
||||
|
||||
@@ -525,7 +524,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
ArchiHandler.PurchaseResponseCallback result;
|
||||
try {
|
||||
result = await currentBot.ArchiHandler.RedeemKey(key);
|
||||
result = await currentBot.ArchiHandler.RedeemKey(key).ConfigureAwait(false);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e, currentBot.BotName);
|
||||
break;
|
||||
@@ -576,7 +575,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
ArchiHandler.PurchaseResponseCallback otherResult;
|
||||
try {
|
||||
otherResult = await bot.ArchiHandler.RedeemKey(key);
|
||||
otherResult = await bot.ArchiHandler.RedeemKey(key).ConfigureAwait(false);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e, bot.BotName);
|
||||
break; // We're done with this key
|
||||
@@ -1267,7 +1266,7 @@ namespace ArchiSteamFarm {
|
||||
Trading.CheckTrades();
|
||||
}
|
||||
|
||||
if (markInventory) {
|
||||
if (markInventory && BotConfig.DismissInventoryNotifications) {
|
||||
await ArchiWebHandler.MarkInventory().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,9 @@ namespace ArchiSteamFarm {
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool CardDropsRestricted { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool DismissInventoryNotifications { get; private set; } = true;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool FarmOffline { get; private set; } = false;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"SteamMasterID": 0,
|
||||
"SteamMasterClanID": 0,
|
||||
"CardDropsRestricted": false,
|
||||
"DismissInventoryNotifications": true,
|
||||
"FarmOffline": false,
|
||||
"HandleOfflineMessages": false,
|
||||
"ForwardKeysToOtherBots": false,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ArchiSteamFarm
|
||||
===================
|
||||
|
||||
[](https://ci.appveyor.com/project/JustArchi/archisteamfarm) [](https://github.com/JustArchi/ArchiSteamFarm/releases/latest) [](https://github.com/JustArchi/ArchiSteamFarm/releases) [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HD2P2P3WGS5Y4)
|
||||
[](https://ci.appveyor.com/project/JustArchi/archisteamfarm) [](https://github.com/JustArchi/ArchiSteamFarm/releases/latest) [](https://github.com/JustArchi/ArchiSteamFarm/releases) [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HD2P2P3WGS5Y4) [](https://steamcommunity.com/tradeoffer/new/?partner=46697991&token=0ix2Ruv_)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user