diff --git a/src/controller/login.js b/src/controller/login.js index 3a677541..f1a152db 100644 --- a/src/controller/login.js +++ b/src/controller/login.js @@ -4,7 +4,7 @@ * Created Date: 2021-07-09 16:26:00 * Author: 3urobeat * - * Last Modified: 2024-05-04 21:53:58 + * Last Modified: 2024-05-04 22:46:20 * Modified By: 3urobeat * * Copyright (c) 2021 - 2024 3urobeat @@ -23,6 +23,8 @@ const ascii = require("../data/ascii.js"); const misc = require("./helpers/misc.js"); +let postponedRetries = 0; // Tracks the amount of reruns caused by accounts with POSTPONED status + /** * Attempts to log in all bot accounts which are currently offline one after another. * Creates a new bot object for every new account and reuses existing one if possible @@ -137,8 +139,12 @@ Controller.prototype.login = async function(firstLogin) { this.info.activeLogin = false; // Emit ready event if this is the first start and no login is pending - if (this.info.readyAfter == 0 && !Object.values(this.bots).some((e) => e.status == Bot.EStatus.POSTPONED)) { - this._readyEvent(); + if (this.info.readyAfter == 0) { + if (!Object.values(this.bots).some((e) => e.status == Bot.EStatus.POSTPONED) || postponedRetries > 0) { // Emit ready event either way if we are already on a rerun to make the bot usable + this._readyEvent(); + } + + postponedRetries++; } // Call itself again to process any POSTPONED or newly qualified accounts - this has to happen after the ready check above as login() sets every POSTPONED account to OFFLINE diff --git a/src/data/fileStructure.json b/src/data/fileStructure.json index 63026c5e..5e88f96c 100644 --- a/src/data/fileStructure.json +++ b/src/data/fileStructure.json @@ -553,7 +553,7 @@ { "path": "src/controller/login.js", "url": "https://raw.githubusercontent.com/3urobeat/steam-comment-service-bot/beta-testing/src/controller/login.js", - "checksum": "ca44fdc848b159d90a0c4dfba43037ae" + "checksum": "5c2004ff7748ccb64d90f1ae61d93f5a" }, { "path": "src/data/ascii.js",