mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-19 07:50:29 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e9be09944 | ||
|
|
6a79a89a10 | ||
|
|
d67be4f092 | ||
|
|
a8e1039e32 | ||
|
|
2ad9d9e197 | ||
|
|
fd6e2c72d7 | ||
|
|
1eed0f7647 | ||
|
|
c018c08260 | ||
|
|
72fa98cb89 | ||
|
|
71215d695e |
@@ -257,6 +257,7 @@ namespace ArchiSteamFarm {
|
|||||||
request.Body.key = key;
|
request.Body.key = key;
|
||||||
|
|
||||||
Client.Send(request);
|
Client.Send(request);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await new AsyncJob<PurchaseResponseCallback>(Client, request.SourceJobID);
|
return await new AsyncJob<PurchaseResponseCallback>(Client, request.SourceJobID);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
if (AcceptConfirmationsTimer == null && BotConfig.AcceptConfirmationsPeriod > 0) {
|
if (AcceptConfirmationsTimer == null && BotConfig.AcceptConfirmationsPeriod > 0) {
|
||||||
AcceptConfirmationsTimer = new Timer(
|
AcceptConfirmationsTimer = new Timer(
|
||||||
async e => await AcceptConfirmations().ConfigureAwait(false),
|
async e => await AcceptConfirmations(true).ConfigureAwait(false),
|
||||||
null,
|
null,
|
||||||
TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod), // Delay
|
TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod), // Delay
|
||||||
TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod) // Period
|
TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod) // Period
|
||||||
@@ -223,7 +223,7 @@ namespace ArchiSteamFarm {
|
|||||||
Start().Forget();
|
Start().Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async Task AcceptConfirmations(Confirmation.ConfirmationType allowedConfirmationType = Confirmation.ConfirmationType.Unknown) {
|
internal async Task AcceptConfirmations(bool confirm, Confirmation.ConfirmationType allowedConfirmationType = Confirmation.ConfirmationType.Unknown) {
|
||||||
if (BotDatabase.SteamGuardAccount == null) {
|
if (BotDatabase.SteamGuardAccount == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -243,10 +243,14 @@ namespace ArchiSteamFarm {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
BotDatabase.SteamGuardAccount.AcceptConfirmation(confirmation);
|
if (confirm) {
|
||||||
|
BotDatabase.SteamGuardAccount.AcceptConfirmation(confirmation);
|
||||||
|
} else {
|
||||||
|
BotDatabase.SteamGuardAccount.DenyConfirmation(confirmation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (SteamGuardAccount.WGTokenInvalidException) {
|
} catch (SteamGuardAccount.WGTokenInvalidException) {
|
||||||
Logging.LogGenericWarning("Accepting confirmation: Failed!", BotName);
|
Logging.LogGenericWarning("Handling confirmation: Failed!", BotName);
|
||||||
Logging.LogGenericWarning("Confirmation could not be accepted because of invalid token exception", BotName);
|
Logging.LogGenericWarning("Confirmation could not be accepted because of invalid token exception", BotName);
|
||||||
Logging.LogGenericWarning("If issue persists, consider removing and readding ASF 2FA", BotName);
|
Logging.LogGenericWarning("If issue persists, consider removing and readding ASF 2FA", BotName);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -297,17 +301,19 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!message.StartsWith("!")) {
|
if (!message.StartsWith("!")) {
|
||||||
return await ResponseRedeem(steamID, BotName, message, true).ConfigureAwait(false);
|
return await ResponseRedeem(steamID, message.Replace(",", Environment.NewLine), true).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!message.Contains(" ")) {
|
if (!message.Contains(" ")) {
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case "!2fa":
|
case "!2fa":
|
||||||
return Response2FA(steamID);
|
return Response2FA(steamID);
|
||||||
|
case "!2fano":
|
||||||
|
return await Response2FAConfirm(steamID, false).ConfigureAwait(false);
|
||||||
case "!2faoff":
|
case "!2faoff":
|
||||||
return Response2FAOff(steamID);
|
return Response2FAOff(steamID);
|
||||||
case "!2faok":
|
case "!2faok":
|
||||||
return await Response2FAOK(steamID).ConfigureAwait(false);
|
return await Response2FAConfirm(steamID, true).ConfigureAwait(false);
|
||||||
case "!exit":
|
case "!exit":
|
||||||
return ResponseExit(steamID);
|
return ResponseExit(steamID);
|
||||||
case "!farm":
|
case "!farm":
|
||||||
@@ -338,10 +344,12 @@ namespace ArchiSteamFarm {
|
|||||||
switch (args[0]) {
|
switch (args[0]) {
|
||||||
case "!2fa":
|
case "!2fa":
|
||||||
return Response2FA(steamID, args[1]);
|
return Response2FA(steamID, args[1]);
|
||||||
|
case "!2fano":
|
||||||
|
return await Response2FAConfirm(steamID, args[1], false).ConfigureAwait(false);
|
||||||
case "!2faoff":
|
case "!2faoff":
|
||||||
return Response2FAOff(steamID, args[1]);
|
return Response2FAOff(steamID, args[1]);
|
||||||
case "!2faok":
|
case "!2faok":
|
||||||
return await Response2FAOK(steamID, args[1]).ConfigureAwait(false);
|
return await Response2FAConfirm(steamID, args[1], true).ConfigureAwait(false);
|
||||||
case "!addlicense":
|
case "!addlicense":
|
||||||
if (args.Length > 2) {
|
if (args.Length > 2) {
|
||||||
return await ResponseAddLicense(steamID, args[1], args[2]).ConfigureAwait(false);
|
return await ResponseAddLicense(steamID, args[1], args[2]).ConfigureAwait(false);
|
||||||
@@ -370,9 +378,9 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
case "!redeem":
|
case "!redeem":
|
||||||
if (args.Length > 2) {
|
if (args.Length > 2) {
|
||||||
return await ResponseRedeem(steamID, args[1], args[2], false).ConfigureAwait(false);
|
return await ResponseRedeem(steamID, args[1], args[2].Replace(",", Environment.NewLine), false).ConfigureAwait(false);
|
||||||
} else {
|
} else {
|
||||||
return await ResponseRedeem(steamID, BotName, args[1], false).ConfigureAwait(false);
|
return await ResponseRedeem(steamID, BotName, args[1].Replace(",", Environment.NewLine), false).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
case "!start":
|
case "!start":
|
||||||
return await ResponseStart(steamID, args[1]).ConfigureAwait(false);
|
return await ResponseStart(steamID, args[1]).ConfigureAwait(false);
|
||||||
@@ -572,7 +580,7 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (await ArchiWebHandler.SendTradeOffer(inventory, BotConfig.SteamMasterID, BotConfig.SteamTradeToken).ConfigureAwait(false)) {
|
if (await ArchiWebHandler.SendTradeOffer(inventory, BotConfig.SteamMasterID, BotConfig.SteamTradeToken).ConfigureAwait(false)) {
|
||||||
await AcceptConfirmations(Confirmation.ConfirmationType.Trade).ConfigureAwait(false);
|
await AcceptConfirmations(true, Confirmation.ConfirmationType.Trade).ConfigureAwait(false);
|
||||||
return "Trade offer sent successfully!";
|
return "Trade offer sent successfully!";
|
||||||
} else {
|
} else {
|
||||||
return "Trade offer failed due to error!";
|
return "Trade offer failed due to error!";
|
||||||
@@ -647,7 +655,7 @@ namespace ArchiSteamFarm {
|
|||||||
return bot.Response2FAOff(steamID);
|
return bot.Response2FAOff(steamID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> Response2FAOK(ulong steamID) {
|
private async Task<string> Response2FAConfirm(ulong steamID, bool confirm) {
|
||||||
if (steamID == 0 || !IsMaster(steamID)) {
|
if (steamID == 0 || !IsMaster(steamID)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -656,11 +664,11 @@ namespace ArchiSteamFarm {
|
|||||||
return "That bot doesn't have ASF 2FA enabled!";
|
return "That bot doesn't have ASF 2FA enabled!";
|
||||||
}
|
}
|
||||||
|
|
||||||
await AcceptConfirmations().ConfigureAwait(false);
|
await AcceptConfirmations(confirm).ConfigureAwait(false);
|
||||||
return "Done!";
|
return "Done!";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<string> Response2FAOK(ulong steamID, string botName) {
|
private static async Task<string> Response2FAConfirm(ulong steamID, string botName, bool confirm) {
|
||||||
if (steamID == 0 || string.IsNullOrEmpty(botName)) {
|
if (steamID == 0 || string.IsNullOrEmpty(botName)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -670,7 +678,7 @@ namespace ArchiSteamFarm {
|
|||||||
return "Couldn't find any bot named " + botName + "!";
|
return "Couldn't find any bot named " + botName + "!";
|
||||||
}
|
}
|
||||||
|
|
||||||
return await bot.Response2FAOK(steamID).ConfigureAwait(false);
|
return await bot.Response2FAConfirm(steamID, confirm).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ResponseExit(ulong steamID) {
|
private static string ResponseExit(ulong steamID) {
|
||||||
@@ -682,8 +690,13 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Environment.Exit(0);
|
// Schedule the task after some time so user can receive response
|
||||||
return null;
|
Task.Run(async () => {
|
||||||
|
await Utilities.SleepAsync(1000).ConfigureAwait(false);
|
||||||
|
Program.Exit();
|
||||||
|
}).Forget();
|
||||||
|
|
||||||
|
return "Done!";
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ResponseFarm(ulong steamID) {
|
private string ResponseFarm(ulong steamID) {
|
||||||
@@ -739,117 +752,82 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder response = new StringBuilder();
|
StringBuilder response = new StringBuilder();
|
||||||
using (StringReader reader = new StringReader(message)) {
|
using (StringReader reader = new StringReader(message))
|
||||||
|
using (IEnumerator<Bot> iterator = Bots.Values.GetEnumerator()) {
|
||||||
string key = reader.ReadLine();
|
string key = reader.ReadLine();
|
||||||
IEnumerator<Bot> iterator = Bots.Values.GetEnumerator();
|
|
||||||
Bot currentBot = this;
|
Bot currentBot = this;
|
||||||
while (key != null) {
|
while (!string.IsNullOrEmpty(key) && currentBot != null) {
|
||||||
if (currentBot == null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (validate && !IsValidCdKey(key)) {
|
if (validate && !IsValidCdKey(key)) {
|
||||||
key = reader.ReadLine();
|
key = reader.ReadLine(); // Next key
|
||||||
continue;
|
continue; // Without changing the bot
|
||||||
}
|
}
|
||||||
|
|
||||||
ArchiHandler.PurchaseResponseCallback result = await currentBot.ArchiHandler.RedeemKey(key).ConfigureAwait(false);
|
if (currentBot.SteamClient.IsConnected) {
|
||||||
if (result == null) {
|
ArchiHandler.PurchaseResponseCallback result = await currentBot.ArchiHandler.RedeemKey(key).ConfigureAwait(false);
|
||||||
break;
|
if (result != null) {
|
||||||
|
switch (result.PurchaseResult) {
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.DuplicatedKey:
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.InvalidKey:
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OK:
|
||||||
|
response.Append(Environment.NewLine + "<" + currentBot.BotName + "> Key: " + key + " | Status: " + result.PurchaseResult + " | Items: " + string.Join("", result.Items));
|
||||||
|
|
||||||
|
key = reader.ReadLine(); // Next key
|
||||||
|
break; // Next bot (if needed)
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.AlreadyOwned:
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.BaseGameRequired:
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OnCooldown:
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.RegionLocked:
|
||||||
|
response.Append(Environment.NewLine + "<" + currentBot.BotName + "> Key: " + key + " | Status: " + result.PurchaseResult + " | Items: " + string.Join("", result.Items));
|
||||||
|
|
||||||
|
if (!BotConfig.ForwardKeysToOtherBots) {
|
||||||
|
key = reader.ReadLine(); // Next key
|
||||||
|
break; // Next bot (if needed)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BotConfig.DistributeKeys) {
|
||||||
|
break; // Next bot, without changing key
|
||||||
|
}
|
||||||
|
|
||||||
|
bool alreadyHandled = false;
|
||||||
|
foreach (Bot bot in Bots.Values) {
|
||||||
|
if (bot == this || !bot.SteamClient.IsConnected) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ArchiHandler.PurchaseResponseCallback otherResult = await bot.ArchiHandler.RedeemKey(key).ConfigureAwait(false);
|
||||||
|
if (otherResult == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (otherResult.PurchaseResult) {
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.DuplicatedKey:
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.InvalidKey:
|
||||||
|
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OK:
|
||||||
|
alreadyHandled = true; // This key is already handled, as we either redeemed it or we're sure it's dupe/invalid
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
response.Append(Environment.NewLine + "<" + bot.BotName + "> Key: " + key + " | Status: " + otherResult.PurchaseResult + " | Items: " + string.Join("", otherResult.Items));
|
||||||
|
|
||||||
|
if (alreadyHandled) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
key = reader.ReadLine(); // Next key
|
||||||
|
break; // Next bot (if needed)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var purchaseResult = result.PurchaseResult;
|
if (BotConfig.DistributeKeys) {
|
||||||
var items = result.Items;
|
do {
|
||||||
|
if (iterator.MoveNext()) {
|
||||||
switch (purchaseResult) {
|
currentBot = iterator.Current;
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.AlreadyOwned:
|
} else {
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.BaseGameRequired:
|
currentBot = null;
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OnCooldown:
|
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.RegionLocked:
|
|
||||||
response.Append(Environment.NewLine + "<" + currentBot.BotName + "> Key: " + key + " | Status: " + purchaseResult + " | Items: " + string.Join("", items));
|
|
||||||
if (BotConfig.DistributeKeys) {
|
|
||||||
do {
|
|
||||||
if (iterator.MoveNext()) {
|
|
||||||
currentBot = iterator.Current;
|
|
||||||
} else {
|
|
||||||
currentBot = null;
|
|
||||||
}
|
|
||||||
} while (currentBot == this);
|
|
||||||
|
|
||||||
if (!BotConfig.ForwardKeysToOtherBots) {
|
|
||||||
key = reader.ReadLine();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
} while (currentBot == this || (currentBot != null && !currentBot.SteamClient.IsConnected));
|
||||||
if (!BotConfig.ForwardKeysToOtherBots) {
|
|
||||||
key = reader.ReadLine();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool alreadyHandled = false;
|
|
||||||
foreach (Bot bot in Bots.Values) {
|
|
||||||
if (alreadyHandled) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bot == this) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ArchiHandler.PurchaseResponseCallback otherResult = await bot.ArchiHandler.RedeemKey(key).ConfigureAwait(false);
|
|
||||||
|
|
||||||
if (otherResult == null) {
|
|
||||||
break; // We're done with this key
|
|
||||||
}
|
|
||||||
|
|
||||||
var otherPurchaseResult = otherResult.PurchaseResult;
|
|
||||||
var otherItems = otherResult.Items;
|
|
||||||
|
|
||||||
switch (otherPurchaseResult) {
|
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OK:
|
|
||||||
alreadyHandled = true; // We're done with this key
|
|
||||||
response.Append(Environment.NewLine + "<" + bot.BotName + "> Key: " + key + " | Status: " + otherPurchaseResult + " | Items: " + string.Join("", otherItems));
|
|
||||||
break;
|
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.DuplicatedKey:
|
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.InvalidKey:
|
|
||||||
alreadyHandled = true; // This key doesn't work, don't try to redeem it anymore
|
|
||||||
response.Append(Environment.NewLine + "<" + bot.BotName + "> Key: " + key + " | Status: " + otherPurchaseResult + " | Items: " + string.Join("", otherItems));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
response.Append(Environment.NewLine + "<" + bot.BotName + "> Key: " + key + " | Status: " + otherPurchaseResult + " | Items: " + string.Join("", otherItems));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
key = reader.ReadLine();
|
|
||||||
break;
|
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OK:
|
|
||||||
response.Append(Environment.NewLine + "<" + currentBot.BotName + "> Key: " + key + " | Status: " + purchaseResult + " | Items: " + string.Join("", items));
|
|
||||||
if (BotConfig.DistributeKeys) {
|
|
||||||
do {
|
|
||||||
if (iterator.MoveNext()) {
|
|
||||||
currentBot = iterator.Current;
|
|
||||||
} else {
|
|
||||||
currentBot = null;
|
|
||||||
}
|
|
||||||
} while (currentBot == this);
|
|
||||||
}
|
|
||||||
key = reader.ReadLine();
|
|
||||||
break;
|
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.DuplicatedKey:
|
|
||||||
case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.InvalidKey:
|
|
||||||
response.Append(Environment.NewLine + "<" + currentBot.BotName + "> Key: " + key + " | Status: " + purchaseResult + " | Items: " + string.Join("", items));
|
|
||||||
if (BotConfig.DistributeKeys && !BotConfig.ForwardKeysToOtherBots) {
|
|
||||||
do {
|
|
||||||
if (iterator.MoveNext()) {
|
|
||||||
currentBot = iterator.Current;
|
|
||||||
} else {
|
|
||||||
currentBot = null;
|
|
||||||
}
|
|
||||||
} while (currentBot == this);
|
|
||||||
}
|
|
||||||
key = reader.ReadLine();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -899,8 +877,13 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.Restart();
|
// Schedule the task after some time so user can receive response
|
||||||
return null;
|
Task.Run(async () => {
|
||||||
|
await Utilities.SleepAsync(1000).ConfigureAwait(false);
|
||||||
|
Program.Restart();
|
||||||
|
}).Forget();
|
||||||
|
|
||||||
|
return "Done!";
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> ResponseAddLicense(ulong steamID, HashSet<uint> gameIDs) {
|
private async Task<string> ResponseAddLicense(ulong steamID, HashSet<uint> gameIDs) {
|
||||||
|
|||||||
@@ -247,10 +247,15 @@ namespace ArchiSteamFarm {
|
|||||||
Restart();
|
Restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void Exit(int exitCode = 0) {
|
||||||
|
WCF.StopServer();
|
||||||
|
Environment.Exit(exitCode);
|
||||||
|
}
|
||||||
|
|
||||||
internal static void Restart() {
|
internal static void Restart() {
|
||||||
try {
|
try {
|
||||||
Process.Start(ExecutableFile, string.Join(" ", Environment.GetCommandLineArgs().Skip(1)));
|
Process.Start(ExecutableFile, string.Join(" ", Environment.GetCommandLineArgs().Skip(1)));
|
||||||
Environment.Exit(0);
|
Exit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logging.LogGenericException(e);
|
Logging.LogGenericException(e);
|
||||||
}
|
}
|
||||||
@@ -337,14 +342,14 @@ namespace ArchiSteamFarm {
|
|||||||
if (GlobalConfig == null) {
|
if (GlobalConfig == null) {
|
||||||
Logging.LogGenericError("Global config could not be loaded, please make sure that ASF.json exists and is valid!");
|
Logging.LogGenericError("Global config could not be loaded, please make sure that ASF.json exists and is valid!");
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000);
|
||||||
Environment.Exit(1);
|
Exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalDatabase = GlobalDatabase.Load();
|
GlobalDatabase = GlobalDatabase.Load();
|
||||||
if (GlobalDatabase == null) {
|
if (GlobalDatabase == null) {
|
||||||
Logging.LogGenericError("Global database could not be loaded!");
|
Logging.LogGenericError("Global database could not be loaded!");
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000);
|
||||||
Environment.Exit(1);
|
Exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArchiWebHandler.Init();
|
ArchiWebHandler.Init();
|
||||||
@@ -445,7 +450,7 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
// If we ran ASF as a client, we're done by now
|
// If we ran ASF as a client, we're done by now
|
||||||
if (Mode == EMode.Client) {
|
if (Mode == EMode.Client) {
|
||||||
Environment.Exit(0);
|
Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// From now on it's server mode
|
// From now on it's server mode
|
||||||
@@ -454,7 +459,7 @@ namespace ArchiSteamFarm {
|
|||||||
if (!Directory.Exists(ConfigDirectory)) {
|
if (!Directory.Exists(ConfigDirectory)) {
|
||||||
Logging.LogGenericError("Config directory doesn't exist!");
|
Logging.LogGenericError("Config directory doesn't exist!");
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000);
|
||||||
Environment.Exit(1);
|
Exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckForUpdate().Wait();
|
CheckForUpdate().Wait();
|
||||||
@@ -494,7 +499,7 @@ namespace ArchiSteamFarm {
|
|||||||
ShutdownResetEvent.WaitOne();
|
ShutdownResetEvent.WaitOne();
|
||||||
|
|
||||||
// We got a signal to shutdown
|
// We got a signal to shutdown
|
||||||
Environment.Exit(0);
|
Exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.0.2.2")]
|
[assembly: AssemblyVersion("2.0.2.4")]
|
||||||
[assembly: AssemblyFileVersion("2.0.2.2")]
|
[assembly: AssemblyFileVersion("2.0.2.4")]
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await tradeOffers.ForEachAsync(ParseTrade).ConfigureAwait(false);
|
await tradeOffers.ForEachAsync(ParseTrade).ConfigureAwait(false);
|
||||||
await Bot.AcceptConfirmations(Confirmation.ConfirmationType.Trade).ConfigureAwait(false);
|
await Bot.AcceptConfirmations(true, Confirmation.ConfirmationType.Trade).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ParseTrade(Steam.TradeOffer tradeOffer) {
|
private async Task ParseTrade(Steam.TradeOffer tradeOffer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user