Hajagha Posted October 18, 2023 Report Posted October 18, 2023 hello from last steam down i cant client.on('webSession' i get ping of api steam i have ping bot cant Quote
Hajagha Posted October 18, 2023 Author Report Posted October 18, 2023 (edited) steamcommunity : 3.47.0 steam : 1.4.1 steam-user : 5.0.1 steam-totp : 2.1.2 steamid : 2.0.0 steam-tradeoffer-manager : 2.10.6 steam-trade : 0.2.6 steamcommunity : 3.47.0 Edited October 18, 2023 by Hajagha Quote
accxak Posted October 18, 2023 Report Posted October 18, 2023 logOnResponse not contain webapi_authenticate_user_nonce Quote
Hajagha Posted October 18, 2023 Author Report Posted October 18, 2023 i have 7 VPS and 7 Account all of them after 12H ago is down Quote
Dr. McKay Posted October 18, 2023 Report Posted October 18, 2023 client.setPersona(SteamUser.Steam.EPersonaState.Online, Config.access.setNickname) This line tells me that you're using steam-user v3.x.x or earlier, as SteamUser.Steam was removed in v4.0.0. Quote
accxak Posted October 18, 2023 Report Posted October 18, 2023 6 hours ago, accxak said: logOnResponse not contain webapi_authenticate_user_nonce Yes. The issue lies with the old version of steam-user. We used steam-client for the connection and then another module handled acquiring the session using webapi_authenticate_user_nonce from logOnResponse. It seems that Steam removed this parameter from the response overnight. The latest version of steam-user successfully connects and obtains the session. I have rewritten the connection and will be reworking the rest of the code to adapt to it. Thanks to the Doctor for his hard work! 😉 Quote
Panp858 Posted October 18, 2023 Report Posted October 18, 2023 Hello! Any chance that you are sharing the solution? My bot uses tons of old libs with I fixed from time to time (e.g., steam-web-api-key, steam-weblogon, and steam-tradeoffers) but I am unsure how to fix this issue because the whole flow is now broken. Quote
Dr. McKay Posted October 19, 2023 Report Posted October 19, 2023 The solution is to stop using unsupported, deprecated libraries and migrate to things that are supported. For logging into web, steam-session is what you're looking for. Quote
accxak Posted October 19, 2023 Report Posted October 19, 2023 (edited) 18 hours ago, Panp858 said: Any chance that you are sharing the solution? Hi! We also had legacy code that used steam-weblogon, which was layered on top of steam-client. Replacing them with steam-user for session handling is quite simple. Here's a part of my code, hope this helps. let WebSession = false const SteamUser = require('steam-user'); const SteamTradeOffers = require('steam-tradeoffers'); const getSteamAPIKey = require('steam-web-api-key'); const SteamTotp = require('steam-totp'); const SteamCommunity = require('node-steamcommunity'); const community = new SteamCommunity(config.ip); const offers = new SteamTradeOffers(); const steamUser = new SteamUser({ localAddress: config.ip }) SteamTotp.generateAuthCode(user.shared, (err, code, offset, latency) => { const details = { accountName: user.username, password: user.password, twoFactorCode: code }; steamUser.logOn(details); }) steamUser.on('loggedOn', function(details) { steamUser.setPersona(SteamUser.EPersonaState.Online) }); steamUser.on('webSession', (sessionID, cookies) => { console.log('WEBSESSION STARTED') getSteamAPIKey({ sessionID: sessionID, webCookie: cookies }, function (err, APIKey) { if (!APIKey) APIKey = config.apikey; const sessionData = { sessionID: sessionID, webCookie: cookies, APIKey: APIKey, localAddress: config.ip } offers.setup(sessionData) WebSession = true; startConfirmations(cookies) }); }) function startConfirmations (cookies) { community.setCookies(cookies) community.startConfirmationChecker(20000, user.identity) } steamUser.on('tradeOffers', function (count) { if (!count || !WebSession) return handleOffers(); }); The latest version of steam-user is being used, so I had to update npm and node to version 14. Edited October 19, 2023 by accxak Quote
qulery Posted October 19, 2023 Report Posted October 19, 2023 community.login(params); The login method via SteamCommunity no longer returns incorrect Cookies. Trying to use it with manager.setCookies() will result in an error. The solution is to use steam-user, as shown in the @accxak example above. This returns the full-fledged cookies. 😀 Quote
Hajagha Posted October 20, 2023 Author Report Posted October 20, 2023 My problem is solved im using node js v 8 upgrade to last version v18 and fixed Quote
Panp858 Posted October 23, 2023 Report Posted October 23, 2023 (edited) Thanks mate, that helped! On 10/19/2023 at 11:45 AM, accxak said: Hi! We also had legacy code that used steam-weblogon, which was layered on top of steam-client. Replacing them with steam-user for session handling is quite simple. Here's a part of my code, hope this helps. let WebSession = false const SteamUser = require('steam-user'); const SteamTradeOffers = require('steam-tradeoffers'); const getSteamAPIKey = require('steam-web-api-key'); const SteamTotp = require('steam-totp'); const SteamCommunity = require('node-steamcommunity'); const community = new SteamCommunity(config.ip); const offers = new SteamTradeOffers(); const steamUser = new SteamUser({ localAddress: config.ip }) SteamTotp.generateAuthCode(user.shared, (err, code, offset, latency) => { const details = { accountName: user.username, password: user.password, twoFactorCode: code }; steamUser.logOn(details); }) steamUser.on('loggedOn', function(details) { steamUser.setPersona(SteamUser.EPersonaState.Online) }); steamUser.on('webSession', (sessionID, cookies) => { console.log('WEBSESSION STARTED') getSteamAPIKey({ sessionID: sessionID, webCookie: cookies }, function (err, APIKey) { if (!APIKey) APIKey = config.apikey; const sessionData = { sessionID: sessionID, webCookie: cookies, APIKey: APIKey, localAddress: config.ip } offers.setup(sessionData) WebSession = true; startConfirmations(cookies) }); }) function startConfirmations (cookies) { community.setCookies(cookies) community.startConfirmationChecker(20000, user.identity) } steamUser.on('tradeOffers', function (count) { if (!count || !WebSession) return handleOffers(); }); The latest version of steam-user is being used, so I had to update npm and node to version 14. Edited October 23, 2023 by Panp858 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.