mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 22:40:30 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14867f470d | ||
|
|
187f0800b2 | ||
|
|
3afa202d0b | ||
|
|
d33e76c8b0 | ||
|
|
3061c55eaf | ||
|
|
621a1dc2cb | ||
|
|
1a832780a2 |
@@ -262,16 +262,16 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!await BotDatabase.SteamGuardAccount.RefreshSessionAsync().ConfigureAwait(false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Confirmation[] confirmations = await BotDatabase.SteamGuardAccount.FetchConfirmationsAsync().ConfigureAwait(false);
|
||||
if (confirmations == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (!await BotDatabase.SteamGuardAccount.RefreshSessionAsync().ConfigureAwait(false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Confirmation[] confirmations = await BotDatabase.SteamGuardAccount.FetchConfirmationsAsync().ConfigureAwait(false);
|
||||
if (confirmations == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (Confirmation confirmation in confirmations) {
|
||||
if (BotDatabase.SteamGuardAccount.AcceptConfirmation(confirmation)) {
|
||||
Logging.LogGenericInfo("Accepting confirmation: Success!", BotName);
|
||||
@@ -283,6 +283,9 @@ namespace ArchiSteamFarm {
|
||||
Logging.LogGenericWarning("Accepting confirmation: Failed!", 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);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e, BotName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,6 +332,10 @@ namespace ArchiSteamFarm {
|
||||
case "!exit":
|
||||
Program.Exit();
|
||||
return null;
|
||||
case "!farm":
|
||||
return await ResponseFarm().ConfigureAwait(false);
|
||||
case "!loot":
|
||||
return await ResponseSendTrade().ConfigureAwait(false);
|
||||
case "!rejoinchat":
|
||||
return ResponseRejoinChat();
|
||||
case "!restart":
|
||||
@@ -340,8 +347,9 @@ namespace ArchiSteamFarm {
|
||||
return ResponseStatusAll();
|
||||
case "!stop":
|
||||
return ResponseStop();
|
||||
case "!loot":
|
||||
return await ResponseSendTrade().ConfigureAwait(false);
|
||||
case "!update":
|
||||
await Program.CheckForUpdate().ConfigureAwait(false);
|
||||
return "Done!";
|
||||
default:
|
||||
return "Unrecognized command: " + message;
|
||||
}
|
||||
@@ -360,6 +368,10 @@ namespace ArchiSteamFarm {
|
||||
} else {
|
||||
return await ResponseAddLicense(BotName, args[1]).ConfigureAwait(false);
|
||||
}
|
||||
case "!farm":
|
||||
return await ResponseFarm(args[1]).ConfigureAwait(false);
|
||||
case "!loot":
|
||||
return await ResponseSendTrade(args[1]).ConfigureAwait(false);
|
||||
case "!play":
|
||||
if (args.Length > 2) {
|
||||
return await ResponsePlay(args[1], args[2]).ConfigureAwait(false);
|
||||
@@ -374,12 +386,10 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
case "!start":
|
||||
return await ResponseStart(args[1]).ConfigureAwait(false);
|
||||
case "!stop":
|
||||
return ResponseStop(args[1]);
|
||||
case "!status":
|
||||
return ResponseStatus(args[1]);
|
||||
case "!loot":
|
||||
return await ResponseSendTrade(args[1]).ConfigureAwait(false);
|
||||
case "!stop":
|
||||
return ResponseStop(args[1]);
|
||||
default:
|
||||
return "Unrecognized command: " + args[0];
|
||||
}
|
||||
@@ -562,6 +572,24 @@ namespace ArchiSteamFarm {
|
||||
return await bot.Response2FAOK().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<string> ResponseFarm() {
|
||||
await CardsFarmer.RestartFarming().ConfigureAwait(false);
|
||||
return "Done!";
|
||||
}
|
||||
|
||||
private static async Task<string> ResponseFarm(string botName) {
|
||||
if (string.IsNullOrEmpty(botName)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Bot bot;
|
||||
if (!Bots.TryGetValue(botName, out bot)) {
|
||||
return "Couldn't find any bot named " + botName + "!";
|
||||
}
|
||||
|
||||
return await bot.ResponseFarm().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<string> ResponseRedeem(string message, bool validate) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
return null;
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace ArchiSteamFarm {
|
||||
private static Timer AutoUpdatesTimer;
|
||||
private static EMode Mode = EMode.Normal;
|
||||
|
||||
private static async Task CheckForUpdate() {
|
||||
internal static async Task CheckForUpdate() {
|
||||
string oldExeFile = ExecutableFile + ".old";
|
||||
|
||||
// We booted successfully so we can now remove old exe file
|
||||
@@ -334,7 +334,7 @@ namespace ArchiSteamFarm {
|
||||
private static void InitServices() {
|
||||
GlobalConfig = GlobalConfig.Load();
|
||||
if (GlobalConfig == null) {
|
||||
Logging.LogGenericError("Global config could not be loaded, please make sure that ASF.db 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);
|
||||
Exit(1);
|
||||
}
|
||||
@@ -464,7 +464,7 @@ namespace ArchiSteamFarm {
|
||||
string botName = Path.GetFileNameWithoutExtension(configFile);
|
||||
Logging.LogGenericWarning("Found legacy " + botName + ".xml config file, it will now be converted to new ASF V2.0 format!");
|
||||
Bot bot = new Bot(botName);
|
||||
if (!bot.BotConfig.Enabled) {
|
||||
if (bot.BotConfig == null || !bot.BotConfig.Enabled) {
|
||||
Logging.LogGenericInfo("Not starting this instance because it's disabled in config file", botName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.0.0.4")]
|
||||
[assembly: AssemblyFileVersion("2.0.0.4")]
|
||||
[assembly: AssemblyVersion("2.0.0.6")]
|
||||
[assembly: AssemblyFileVersion("2.0.0.6")]
|
||||
|
||||
Reference in New Issue
Block a user