Jump to content
McKay Development

Van Kappa

Member
  • Posts

    20
  • Joined

  • Last visited

Everything posted by Van Kappa

  1. throw new Error("Cannot log onto steamcommunity.com without first being connected to Steam network"); This clearly means you tried to webLogOn before loggedOn was successfull. Since it doesn't trigger for EResults that differ from OK, you should handle the logon error on disconnected or error events as McKay said.
  2. I don't know if you can actually be logged in an account in two clients at the same time. Does it set your chat status to offline or it disconnects you from steam? If it just sets the chat to offline you can still play.
  3. You should check if loggedOn event's eresult is OK, otherwise there was an error logging in and therefore you can't proceed (request web session cookies). Replace: client.on('loggedOn', function(details) { client.getPersonas([client.steamID], function(personas) { console.log("============ Logged in ===============================") console.log('== Name: ' + personas[client.steamID]["player_name"]); console.log('== ID64: ' + client.steamID); console.log("======================================================"); console.log(""); }); console.log(); client.setPersona(1); // Shows the status as online. 0 = offline (It will still work though!) 1 = online setInterval(function() { client.webLogOn(); }, 1000 * 60); // Refreshes session every 10 minutes }); with client.on('loggedOn', function(details) { if(details.eresult == SteamUser.EResult.OK) { client.getPersonas([client.steamID], function(personas) { console.log("============ Logged in ===============================") console.log('== Name: ' + personas[client.steamID]["player_name"]); console.log('== ID64: ' + client.steamID); console.log("======================================================"); console.log(""); }); console.log(); client.setPersona(1); // Shows the status as online. 0 = offline (It will still work though!) 1 = online client.webLogOn(); } else { console.log(details); //Do whatever u want to handle the error... } }); Also, you should rate limit this: community.on("sessionExpired", function(err) { console.log("## Session Expired, relogging."); client.webLogOn(); }); since it can be triggered too often and make steam temporary block your IP. You can do it like this: var lastWebLoginAttempt = 0; community.on("sessionExpired", function(err) { if(Date.now() - lastLoginAttempt >= 30000) { lastLoginAttempt = Date.now(); console.log("## Session Expired, relogging."); client.webLogOn(); } else { console.log("## Session Expired, waiting a while before attempting to relogin."); } });
  4. As I said, it should only crash when err is set, as there won't be any data on me nor them. If you added a line to log err, the next time it crashes you should have an error object output just before the crash line
  5. You should check if there is an error when you call getUserDetails. If "err" is set, both "me" and "them" won't be. Also you don't need to "refresh the session every 10 minutes". When the session expires, community emmits a sessionExpired event.
  6. There is something I'm not getting. Steam states a method to get trade history, called GetTradeHistory, but, as they explicity show the difference between a Trade and a TradeOffer, I can't understand what'd be the point of this GetTradeHistory method given also that it's already possible to get the TradeOffer history from the GetTradeOffers method.
  7. You can use both intanceid and classid combined. They are unique and don't change after trade.
  8. For that you will need to get the items price. Here's something for you to start with https://github.com/Arze1/CSGO-Overpay-Bot/blob/master/bot.js
  9. If you mean a trade offer, it is > acceptConfirmationForObject If you mean a live trade (not the offer generated from it) >
  10. Post your read from form.serializeArray() I can take a look if you want. Probably profile_showcase[] is an array that's not being correctly converted on the code that loads the current profile data: form.serializeArray().forEach(function(item) { values[item.name] = item.value; });
  11. https://github.com/DoctorMcKay/node-steamcommunity/pull/148
  12. Why don't you use steam-user's 2FA methods? If you still want to rely on others authenticators, I'd recommend Steam Desktop Authenticator since it's the easiest way of getting the secrets/revocation code you will need.
  13. Hmm that explains why then I think I will go with the GetPlayerSummary API method then Thabk you
  14. No i am not. It does not work if they arent friends?
  15. self.steamInterface.on("webSession", function (sessionID, sessionCookies) { self.sessionID = sessionID; self.sessionCookies = sessionCookies; sessionCookies.forEach( function(cookie) { self.httpRequestJar.setCookie(self.httpRequest.cookie(cookie), 'https://steamcommunity.com'); } ); self.steamWebInterface.setCookies(sessionCookies); self.steamTradeOffers.setCookies(sessionCookies, function (e) { if(!e) { self.apiKey = self.steamTradeOffers.apiKey; //I DO REQUEST getPersonas HERE } else { self.emit("error", e); } } ); } ); self.steamInterface.on("loggedOn", function (response) { if(response.eresult == steamInterface.EResult.OK) { self.steamInterface.setPersona(steamInterface.EPersonaState.Online, self.nickname); } } );Maybe I should wait for an event/callback from setPersona, but how?
  16. Yes it is. As I said, I called that method as soon as the webSession event fires.
  17. Persona State is null, and should be 1 (since i am online on steam) or at least 0 (offline)
  18. Hello, and sorry for bumping! I am getting this as response, which I supose being invalid: My code: steamUser.getPersonas(["76561198313712684"], function (data) { console.log(data) }); Not sure if helps, but I'm calling this as soon as the webSession event fires (already tried with loggedOn event, same result). Am I missing something? Thank you
×
×
  • Create New...