accxak
Member-
Posts
3 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
accxak's Achievements
-
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.
-
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! 😉
-
accxak joined the community
-