Jump to content
McKay Development

Dr. McKay

Administrator
  • Posts

    3389
  • Joined

  • Last visited

Everything posted by Dr. McKay

  1. You can use webLogOn at any time, but if you spam Steam then Valve is not likely to be happy. You shouldn't create an interval inside of an event callback. Create it outside the callback, in the root level of the module (the part that has no indentation). Keep track of the last time you called webLogOn (a timestamp) and don't call it if it was less than say a minute ago.
  2. Use setInterval but outside of any event callback. Also, you need to keep track of the last time you called webLogOn and abandon if it was too soon ago, as sessionExpired can be emitted at any frequency (perhaps several times a second).
  3. You will always get an err in sessionExpired. It's not indicating that there was an error in the session expiring or anything, it's just the Error that made us aware that the session has expired. Also, I'd suggest keeping the login interval as well.
  4. You're correct regarding the behavior of setTimeout and setInterval. The problem is, if you create a new interval every time you get a new web session, then you end up with many auto-repeating timers.
  5. That will create a new interval every time your session expires. Either use setTimeout or create the internal outside of that event callback. Also, you may want to listen for the sessionExpired event.
  6. Presently there's no existing method to accept gifts.
  7. If that works it's a fluke. You should pass an Error to the callback, like this: callback(new Error("File not found"));
  8. Your first code snippet will work if you get rid of the parenthesis. Like this: setTimeout(getGuardCode, 30000); You need to pass setTimeout a function. By adding parenthesis, you're calling the function and passing its return value (undefined) instead of passing it.
  9. Yes, you should set a timeout. The code a couple posts back will just spam Steam with login requests which will get you locked out. That's not how you set a timeout, though. You want this: setTimeout(function() { callback(SteamTotp.generateAuthCode(config.sharedsecret)); }, 30000);
  10. https://github.com/DoctorMcKay/node-steam-user#friendorchatmessage
  11. No. No Steam services support IPv6 at the present time.
  12. Correct! I'm glad you got it sorted out. That tutorial is outdated. Things move pretty quickly in this world. If you have any other questions, feel free to ask.
  13. Okay, well getSteamID64 didn't work because it appears that you're using node-steam's friends handler alongside SteamUser, which is unnecessary. All functionality from node-steam is available in SteamUser directly. The getPersonas method requests data from Steam and calls your provided callback with the personas object once the data is received. You're correct, the properties of personas are objects. In this case, since you requested data for only one user, there is only one property. In cases where you request data for multiple users, there will be more properties defined. Each sub-object contains the data we received from Steam, which is where player_name comes from. The ? and : are the ternary operator, which is more or less an "inline if" statement. In this case, it's checking whether the persona data exists in order to determine whether to pull the player_name from the data or to fallback to a default value. In this case, it was unnecessary, I just didn't feel like checking whether it was possible for getPersonas to not return data for the requested user(s) (it's not).
  14. There is no way to enumerate classids.
  15. Your problem is that getPersonas expects an array as the first argument, and you aren't passing it an array. What you want to do is client.getPersonas([steamID], function(personas) { /* etc */ }); Also in this case, the callback is essentially mandatory for you. getPersonas doesn't return anything. The data is only available inside the callback. In your case, you want something like this: client.getPersonas([steamID], function(personas) { var persona = personas[steamID.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamID.getSteamID64() + "]"); // the player's name is now available as name });
  16. What exactly is the error message you're getting, and where? Also, please show the code that is generating and sending this offer.
  17. Sometimes Steam just doesn't return any data. There's nothing we can do about it. Retry if you get unexpected results.
×
×
  • Create New...