mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-20 00:08:38 +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;
|
||||||
using SteamKit2.Internal;
|
using SteamKit2.Internal;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal sealed class ArchiHandler : ClientMsgHandler {
|
internal sealed class ArchiHandler : ClientMsgHandler {
|
||||||
@@ -216,7 +218,7 @@ namespace ArchiSteamFarm {
|
|||||||
Client.Send(request);
|
Client.Send(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal AsyncJob<PurchaseResponseCallback> RedeemKey(string key) {
|
internal async Task<PurchaseResponseCallback> RedeemKey(string key) {
|
||||||
if (string.IsNullOrEmpty(key) || !Client.IsConnected) {
|
if (string.IsNullOrEmpty(key) || !Client.IsConnected) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -228,7 +230,12 @@ namespace ArchiSteamFarm {
|
|||||||
request.Body.key = key;
|
request.Body.key = key;
|
||||||
|
|
||||||
Client.Send(request);
|
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;
|
||||||
using SteamKit2.Internal;
|
using SteamKit2.Internal;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
@@ -40,7 +39,7 @@ namespace ArchiSteamFarm {
|
|||||||
private const ulong ArchiSCFarmGroup = 103582791440160998;
|
private const ulong ArchiSCFarmGroup = 103582791440160998;
|
||||||
private const ushort CallbackSleep = 500; // In miliseconds
|
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
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool alreadyExists;
|
|
||||||
lock (Bots) {
|
|
||||||
alreadyExists = Bots.ContainsKey(botName);
|
|
||||||
if (!alreadyExists) {
|
|
||||||
Bots[botName] = this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alreadyExists) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BotName = botName;
|
BotName = botName;
|
||||||
|
|
||||||
string botPath = Path.Combine(Program.ConfigDirectory, botName);
|
string botPath = Path.Combine(Program.ConfigDirectory, botName);
|
||||||
@@ -176,6 +163,18 @@ namespace ArchiSteamFarm {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool alreadyExists;
|
||||||
|
lock (Bots) {
|
||||||
|
alreadyExists = Bots.ContainsKey(botName);
|
||||||
|
if (!alreadyExists) {
|
||||||
|
Bots[botName] = this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (alreadyExists) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
BotDatabase = BotDatabase.Load(botPath + ".db");
|
BotDatabase = BotDatabase.Load(botPath + ".db");
|
||||||
SentryFile = botPath + ".bin";
|
SentryFile = botPath + ".bin";
|
||||||
|
|
||||||
@@ -525,7 +524,7 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
ArchiHandler.PurchaseResponseCallback result;
|
ArchiHandler.PurchaseResponseCallback result;
|
||||||
try {
|
try {
|
||||||
result = await currentBot.ArchiHandler.RedeemKey(key);
|
result = await currentBot.ArchiHandler.RedeemKey(key).ConfigureAwait(false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logging.LogGenericException(e, currentBot.BotName);
|
Logging.LogGenericException(e, currentBot.BotName);
|
||||||
break;
|
break;
|
||||||
@@ -576,7 +575,7 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
ArchiHandler.PurchaseResponseCallback otherResult;
|
ArchiHandler.PurchaseResponseCallback otherResult;
|
||||||
try {
|
try {
|
||||||
otherResult = await bot.ArchiHandler.RedeemKey(key);
|
otherResult = await bot.ArchiHandler.RedeemKey(key).ConfigureAwait(false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logging.LogGenericException(e, bot.BotName);
|
Logging.LogGenericException(e, bot.BotName);
|
||||||
break; // We're done with this key
|
break; // We're done with this key
|
||||||
@@ -1267,7 +1266,7 @@ namespace ArchiSteamFarm {
|
|||||||
Trading.CheckTrades();
|
Trading.CheckTrades();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (markInventory) {
|
if (markInventory && BotConfig.DismissInventoryNotifications) {
|
||||||
await ArchiWebHandler.MarkInventory().ConfigureAwait(false);
|
await ArchiWebHandler.MarkInventory().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ namespace ArchiSteamFarm {
|
|||||||
[JsonProperty(Required = Required.DisallowNull)]
|
[JsonProperty(Required = Required.DisallowNull)]
|
||||||
internal bool CardDropsRestricted { get; private set; } = false;
|
internal bool CardDropsRestricted { get; private set; } = false;
|
||||||
|
|
||||||
|
[JsonProperty(Required = Required.DisallowNull)]
|
||||||
|
internal bool DismissInventoryNotifications { get; private set; } = true;
|
||||||
|
|
||||||
[JsonProperty(Required = Required.DisallowNull)]
|
[JsonProperty(Required = Required.DisallowNull)]
|
||||||
internal bool FarmOffline { get; private set; } = false;
|
internal bool FarmOffline { get; private set; } = false;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"SteamMasterID": 0,
|
"SteamMasterID": 0,
|
||||||
"SteamMasterClanID": 0,
|
"SteamMasterClanID": 0,
|
||||||
"CardDropsRestricted": false,
|
"CardDropsRestricted": false,
|
||||||
|
"DismissInventoryNotifications": true,
|
||||||
"FarmOffline": false,
|
"FarmOffline": false,
|
||||||
"HandleOfflineMessages": false,
|
"HandleOfflineMessages": false,
|
||||||
"ForwardKeysToOtherBots": false,
|
"ForwardKeysToOtherBots": false,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
ArchiSteamFarm
|
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