Skip to content

Commit

Permalink
Version 2.15.1
Browse files Browse the repository at this point in the history
Merge pull request #237
  • Loading branch information
3urobeat committed Mar 8, 2024
2 parents be41d68 + 3e1f859 commit a8a04eb
Show file tree
Hide file tree
Showing 21 changed files with 131 additions and 113 deletions.
19 changes: 19 additions & 0 deletions docs/wiki/changelogs/CHANGELOG_v2.15.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

**Current**
- [2.15.0](#2.15.0)
- [2.15.1](#2.15.1)

 

Expand Down Expand Up @@ -139,3 +140,21 @@ If you've made a plugin, check the 'Creating Plugins' wiki page and add the `bot
This list was generated using my [langStringsChangeDetector.js](/scripts/langStringsChangeDetector.js) script.

</details>

Commit: [be41d68](https://github.com/3urobeat/steam-comment-service-bot/commit/be41d68)

&nbsp;

<a id="2.15.1"></a>

## **2024-03-08, Version 2.15.1**
**Fixes:**
- Fixed login process being softlocked after an account attempted to switch from their faulty proxy
- Fixed failed vote & fav requests throwing an error when trying to log the error

**Changes:**
- Reduced amount of log messages logged during login, disconnect and relog
- Reduced amount of log messages logged during the general startup
- Reduced chances of startup ascii art showing an easter egg ascii art
- Updated dependencies
- Minor other changes
56 changes: 28 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steam-comment-service-bot",
"version": "2.15.0",
"version": "2.15.1",
"description": "The most advanced Steam Multi Account Manager with built-in comment, like & favorite commands and extensive plugin support.",
"main": "start.js",
"dependencies": {
Expand All @@ -13,7 +13,7 @@
"qrcode": "^1.5.3",
"request": "^2.88.2",
"steam-comment-bot-discord-plugin": "^1.0.2",
"steam-comment-bot-rest": "^1.1.0",
"steam-comment-bot-rest": "^1.2.1",
"steam-comment-bot-webserver": "^1.0.1",
"steam-session": "^1.7.2",
"steam-user": "^5.0.8",
Expand All @@ -36,7 +36,7 @@
"repository": "https://github.com/3urobeat/steam-comment-service-bot",
"devDependencies": {
"eslint": "^8.57.0",
"eslint-plugin-jsdoc": "^48.2.0",
"eslint-plugin-jsdoc": "^48.2.1",
"tsd-jsdoc": "^2.5.0"
},
"types": "./types/types.d.ts"
Expand Down
10 changes: 4 additions & 6 deletions src/bot/events/disconnected.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* Created Date: 2021-07-09 16:26:00
* Author: 3urobeat
*
* Last Modified: 2023-12-27 13:58:37
* Last Modified: 2024-03-08 17:40:03
* Modified By: 3urobeat
*
* Copyright (c) 2021 - 2023 3urobeat <https://github.com/3urobeat>
* Copyright (c) 2021 - 2024 3urobeat <https://github.com/3urobeat>
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Expand All @@ -28,8 +28,6 @@ Bot.prototype._attachSteamDisconnectedEvent = function() {

if (this.status == Bot.EStatus.OFFLINE && this.controller.info.activeLogin) return; // Ignore if account is already marked as offline and a login process is active

logger("info", `${logger.colors.fgred}[${this.logPrefix}] Lost connection to Steam. Message: ${msg} | Check: https://steamstat.us`);

// Store disconnect timestamp & reason
this.lastDisconnect.timestamp = Date.now();
this.lastDisconnect.reason = msg;
Expand All @@ -38,11 +36,11 @@ Bot.prototype._attachSteamDisconnectedEvent = function() {

// Don't relog if account is in skippedaccounts array or if relogAfterDisconnect is false
if (!this.controller.info.skippedaccounts.includes(this.loginData.logOnOptions.accountName) && this.controller.info.relogAfterDisconnect) {
logger("info", `${logger.colors.fggreen}[${this.logPrefix}] Initiating a login retry in ${this.controller.data.advancedconfig.loginRetryTimeout / 1000} seconds.`); // Announce relog
logger("info", `${logger.colors.fgred}[${this.logPrefix}] Lost connection to Steam: '${msg}'. Initiating a login retry in ${this.controller.data.advancedconfig.loginRetryTimeout / 1000} seconds.`); // Announce relog

setTimeout(() => this.controller.login(), this.controller.data.advancedconfig.loginRetryTimeout); // Relog in loginRetryTimeout ms
} else {
logger("info", `[${this.logPrefix}] I won't queue myself for a relog because this account is either already being relogged, was skipped or this is an intended logOff.`);
logger("info", `${logger.colors.fgred}[${this.logPrefix}] Lost connection to Steam: '${msg}'. I won't queue for a relog because this account is either already being relogged, was skipped or this is an intended logOff.`);
}

});
Expand Down
24 changes: 12 additions & 12 deletions src/bot/events/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2021-07-09 16:26:00
* Author: 3urobeat
*
* Last Modified: 2024-02-29 14:32:11
* Last Modified: 2024-03-08 17:44:50
* Modified By: 3urobeat
*
* Copyright (c) 2021 - 2024 3urobeat <https://github.com/3urobeat>
Expand All @@ -31,7 +31,7 @@ Bot.prototype._attachSteamErrorEvent = function() {
// Custom behavior for LogonSessionReplaced error
if (err.eresult == EResult.LogonSessionReplaced) {
logger("", "", true);
logger("warn", `${logger.colors.fgred}[${this.logPrefix}] Lost connection to Steam! Reason: LogonSessionReplaced. I won't try to relog this account because someone else is using it now.`, false, false, null, true); // Force print this message now
logger("warn", `${logger.colors.fgred}[${this.logPrefix}] Lost connection to Steam! Reason: 'Error: LogonSessionReplaced'. I won't try to relog this account because someone else is using it now.`, false, false, null, true); // Force print this message now

// Abort or skip account. No need to attach handleRelog() here
if (this.index == 0) {
Expand All @@ -49,7 +49,6 @@ Bot.prototype._attachSteamErrorEvent = function() {

// Check if this is a connection loss and not a login error (because disconnects are thrown here when SteamUser's autoRelogin is false)
if (this.status == Bot.EStatus.ONLINE) { // It must be a fresh connection loss if status has not changed yet
logger("info", `${logger.colors.fgred}[${this.logPrefix}] Lost connection to Steam. Reason: ${err}`);
this.controller._statusUpdateEvent(this, Bot.EStatus.OFFLINE); // Set status of this account to offline

// Store disconnect timestamp & reason
Expand All @@ -58,18 +57,24 @@ Bot.prototype._attachSteamErrorEvent = function() {

// Check if this is an intended logoff
if (this.controller.info.relogAfterDisconnect && !this.controller.info.skippedaccounts.includes(this.loginData.logOnOptions.accountName)) {
logger("info", `${logger.colors.fggreen}[${this.logPrefix}] Initiating a login retry in ${this.controller.data.advancedconfig.loginRetryTimeout / 1000} seconds.`); // Announce relog
logger("info", `${logger.colors.fgred}[${this.logPrefix}] Lost connection to Steam: '${err}'. Initiating a login retry in ${this.controller.data.advancedconfig.loginRetryTimeout / 1000} seconds.`); // Announce relog

setTimeout(() => this.controller.login(), this.controller.data.advancedconfig.loginRetryTimeout); // Relog after waiting loginRetryTimeout ms
} else {
logger("info", `[${this.logPrefix}] I won't queue myself for a relog because this account was skipped or this is an intended logOff.`);
logger("info", `${logger.colors.fgred}[${this.logPrefix}] Lost connection to Steam: '${err}'. I won't queue for a relog because this account was skipped or this is an intended logOff.`);
}

} else { // Actual error during login

let blockedEnumsForRetries = [EResult.Banned, EResult.AccountNotFound]; // No need to block InvalidPassword anymore as the SessionHandler handles credentials
// Unlock login, but only if not already done by loginTimeout handler to prevent duplicate login requests
if (!this.loginData.pendingLogin) return logger("debug", `[${this.logPrefix}] Won't handle this login error because 'pendingLogin' is already 'false'; handleLoginTimeout must already have taken action`);

this.loginData.pendingLogin = false;


// Check if all logOnTries are used or if this is a fatal error
let blockedEnumsForRetries = [EResult.Banned, EResult.AccountNotFound]; // No need to block InvalidPassword anymore as the SessionHandler handles credentials

if (this.loginData.logOnTries > this.controller.data.advancedconfig.maxLogOnRetries || blockedEnumsForRetries.includes(err.eresult)) {
logger("error", `Couldn't log in bot${this.index} after ${this.loginData.logOnTries} attempt(s). ${err} (${err.eresult})`);

Expand Down Expand Up @@ -100,12 +105,7 @@ Bot.prototype._attachSteamErrorEvent = function() {

} else {

logger("warn", `[${this.logPrefix}] '${err}' while trying to log in.${this.loginData.pendingLogin ? " Retrying in 5 seconds..." : ""}`, false, false, null, true); // Log error as warning

// Unlock login, but only if not already done by loginTimeout handler to prevent duplicate login requests
if (!this.loginData.pendingLogin) return logger("debug", `[${this.logPrefix}] Won't handle this login error because 'pendingLogin' is already 'false'; handleLoginTimeout must already have taken action`);

this.loginData.pendingLogin = false;
logger("warn", `[${this.logPrefix}] '${err}' while trying to log in. Retrying in 5 seconds...`, false, false, null, true); // Log error as warning

// Try again in 5 sec, Controller's login function waits for any status that is not offline
setTimeout(() => this._loginToSteam(), 5000);
Expand Down
7 changes: 2 additions & 5 deletions src/bot/events/loggedOn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2021-07-09 16:26:00
* Author: 3urobeat
*
* Last Modified: 2024-02-10 14:08:02
* Last Modified: 2024-03-08 18:23:17
* Modified By: 3urobeat
*
* Copyright (c) 2021 - 2024 3urobeat <https://github.com/3urobeat>
Expand All @@ -28,7 +28,7 @@ Bot.prototype._attachSteamLoggedOnEvent = function() {
this.user.on("loggedOn", () => {

// Print message and set status to online
logger("info", `[${this.logPrefix}] Account logged in! Waiting for websession...`, false, true, logger.animation("loading"));
logger("debug", `[${this.logPrefix}] Account logged in! Public IP of this account: ${this.user.publicIP}`);

if (this.index == 0) {
logger("debug", `[${this.logPrefix}] Setting online status '${this.data.advancedconfig.onlineStatus}' as enum '${EPersonaState[this.data.advancedconfig.onlineStatus]}'`);
Expand All @@ -38,9 +38,6 @@ Bot.prototype._attachSteamLoggedOnEvent = function() {
this.user.setPersona(EPersonaState[this.data.advancedconfig.childAccOnlineStatus]); // Set child acc online status
}

logger("debug", `[${this.logPrefix}] Public IP of this account: ${this.user.publicIP}`);


// Increase progress bar if one is active
if (logger.getProgressBar()) logger.increaseProgressBar((100 / this.data.logininfo.length) / 3);

Expand Down
11 changes: 7 additions & 4 deletions src/bot/events/webSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2021-07-09 16:26:00
* Author: 3urobeat
*
* Last Modified: 2024-02-29 14:10:29
* Last Modified: 2024-03-08 16:21:53
* Modified By: 3urobeat
*
* Copyright (c) 2021 - 2024 3urobeat <https://github.com/3urobeat>
Expand Down Expand Up @@ -39,9 +39,12 @@ Bot.prototype._attachSteamWebSessionEvent = function() {
this.loginData.relogTries = 0; // Reset relogTries to indicate that this proxy is working should one of the next logOn retries fail
this.loginData.pendingLogin = false; // Unlock login again


if (!this.controller.info.readyAfter) logger("info", `[${this.logPrefix}] Got websession and set cookies. Accepting offline friend & group invites...`, false, true, logger.animation("loading")); // Only print message with animation if the bot was not fully started yet
else logger("info", `[${this.logPrefix}] Got websession and set cookies. Accepting offline friend & group invites...`, false, true);
// Print logged in message with animation on initial login, otherwise without
if (!this.controller.info.readyAfter) {
logger("info", `[${this.logPrefix}] Logged in! Accepting pending friend requests & group invites...`, false, true, logger.animation("loading"));
} else {
logger("info", `[${this.logPrefix}] Logged in! Accepting pending friend requests & group invites...`, false, true);
}


// Run check if all friends are in lastcomment.db database for main bot account
Expand Down
6 changes: 3 additions & 3 deletions src/bot/helpers/handleRelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* Created Date: 2023-10-05 16:14:46
* Author: 3urobeat
*
* Last Modified: 2023-12-27 13:59:47
* Last Modified: 2024-03-08 11:48:23
* Modified By: 3urobeat
*
* Copyright (c) 2023 3urobeat <https://github.com/3urobeat>
* Copyright (c) 2023 - 2024 3urobeat <https://github.com/3urobeat>
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Expand Down Expand Up @@ -106,7 +106,7 @@ Bot.prototype.checkAndSwitchMyProxy = async function() {

// Switch proxy and relog, no need for handleRelog() to do something
this.switchProxy(leastUsedProxy.proxyIndex);
this.status = Bot.EStatus.OFFLINE;
this.controller._statusUpdateEvent(this, Bot.EStatus.OFFLINE);
this.controller.login();
return true;

Expand Down
4 changes: 2 additions & 2 deletions src/commands/commandHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2023-04-01 21:54:21
* Author: 3urobeat
*
* Last Modified: 2024-02-29 20:17:33
* Last Modified: 2024-03-08 18:18:46
* Modified By: 3urobeat
*
* Copyright (c) 2023 - 2024 3urobeat <https://github.com/3urobeat>
Expand Down Expand Up @@ -67,7 +67,7 @@ const CommandHandler = function(controller) {
CommandHandler.prototype._importCoreCommands = function() {
return new Promise((resolve) => {

logger("info", "CommandHandler: Loading all core commands...", false, true, logger.animation("loading"));
logger("debug", "CommandHandler: Loading all core commands...");

fs.readdir("./src/commands/core", (err, files) => {

Expand Down

0 comments on commit a8a04eb

Please sign in to comment.