Jump to content
McKay Development

Dr. McKay

Administrator
  • Posts

    3392
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Dr. McKay reacted to Verize in Keeping track of items - Get new AssetIDs   
    Got it. The getExchangeDetails Method of the trade offer object is the way to go.
  2. Like
    Dr. McKay reacted to Verize in PollFailure ETIMEDOUT   
    If you haven't figured it out by now: The confirmation checker is probably getting you rate-limited. That happens if you are sending many requests in a relatively short period of time. That's why the confirmation checker is deprecated - because it does exactly this. Accept all incoming and outgoing offers manually with the method 
    acceptConfirmationForObject()
  3. Like
    Dr. McKay got a reaction from Robert Lutece in Trading and Escrow -- Mobile Trade Confirmations   
    As of December 2015, all users who are losing items in a trade must have the Steam Guard Mobile Authenticator enabled, or else the trade will be held for three fifteen days. It's also no longer possible to opt-out of trade confirmations.
     
    This means that effectively, all trading bots need a mobile authenticator and need to accept mobile trade confirmations. You don't need an actual physical phone to act as your mobile authenticator, however. Through the efforts of myself and others, you can emulate a mobile authenticator right from node.js, and also accept trade confirmations.
     
    Enabling a Mobile Authenticator
     
    The Steam Guard Mobile Authenticator provides two-factor authentication security (hereinafter "2FA") for your account, which is more secure than standard email-based Steam Guard. This is done using a "shared secret" which is known to both the Steam servers and to your authenticator. Both sides run this secret through an algorithm along with the current time, which produces a 5-character alphanumeric code. This code is only valid for 30 seconds, and can only be used once. Attempts to reuse a 2FA code (either through the Steam Client or by logging in on steamcommunity.com) will treat the code as incorrect and reject it. For this reason, you can't login more frequently than once in a 30-second period.
     
    Enabling 2FA is a three-step process.
    Link and verify a phone number with your Steam account. You can do this manually from your account page, or programmatically using node-steamstore. Call enableTwoFactor using either node-steam-user or node-steamcommunity. If successful, this will return an object containing a bunch of properties. You should save this entire object. You can call JSON.stringify on it safely to turn it into a string. You'll need the revocation_code in the future if you ever want to disable 2FA. At this stage, 2FA isn't enabled yet. Steam will send you an SMS containing a code which you'll need in step 3. Call finalizeTwoFactor using either node-steam-user or node-steamcommunity. You will need the value of the shared_secret property from the object returned in step 2, and the numeric activation code from your SMS. If successful, your Steam account now has 2FA. Logging in With a Mobile Authenticator
     
    If you have 2FA enabled, then for every login you will need to provide a twoFactorCode (unless you're logging in with node-steam-user using a loginKey). You can generate this code using node-steam-totp and your shared_secret which you obtained (and should have saved) when you enabled 2FA.
     
    Mobile-Confirming Trades
     
    You are now required to confirm all trades in which you lose items. If you don't have 2FA enabled, then these confirmations will go to your email and the trades will be held for fifteen days. If you do have 2FA enabled, then the confirmations must be accepted through Steam's mobile confirmation interface. You can also accept mobile confirmations through node.js.
     
    node-steam-tradeoffer-manager doesn't have anything built-in to accept mobile confirmations. This is because mobile confirmations encompass more than just trades -- market listings also require confirmation, and potentially other things in the future.
     
    node-steamcommunity can accept your confirmations for you. In order to accept mobile confirmations, you will need the identity_secret (not the shared_secret used for login) from when you enabled 2FA. The best way to do this is to call acceptConfirmationForObject right after each trade offer you send/accept or market listing you create.
  4. Like
    Dr. McKay got a reaction from SkullerHD in Start in steam unknown game   
    https://github.com/DoctorMcKay/node-steam-user#gamesplayedapps-force
  5. Like
    Dr. McKay got a reaction from SENPAY98K in Trading and Escrow -- Mobile Trade Confirmations   
    As of December 2015, all users who are losing items in a trade must have the Steam Guard Mobile Authenticator enabled, or else the trade will be held for three fifteen days. It's also no longer possible to opt-out of trade confirmations.
     
    This means that effectively, all trading bots need a mobile authenticator and need to accept mobile trade confirmations. You don't need an actual physical phone to act as your mobile authenticator, however. Through the efforts of myself and others, you can emulate a mobile authenticator right from node.js, and also accept trade confirmations.
     
    Enabling a Mobile Authenticator
     
    The Steam Guard Mobile Authenticator provides two-factor authentication security (hereinafter "2FA") for your account, which is more secure than standard email-based Steam Guard. This is done using a "shared secret" which is known to both the Steam servers and to your authenticator. Both sides run this secret through an algorithm along with the current time, which produces a 5-character alphanumeric code. This code is only valid for 30 seconds, and can only be used once. Attempts to reuse a 2FA code (either through the Steam Client or by logging in on steamcommunity.com) will treat the code as incorrect and reject it. For this reason, you can't login more frequently than once in a 30-second period.
     
    Enabling 2FA is a three-step process.
    Link and verify a phone number with your Steam account. You can do this manually from your account page, or programmatically using node-steamstore. Call enableTwoFactor using either node-steam-user or node-steamcommunity. If successful, this will return an object containing a bunch of properties. You should save this entire object. You can call JSON.stringify on it safely to turn it into a string. You'll need the revocation_code in the future if you ever want to disable 2FA. At this stage, 2FA isn't enabled yet. Steam will send you an SMS containing a code which you'll need in step 3. Call finalizeTwoFactor using either node-steam-user or node-steamcommunity. You will need the value of the shared_secret property from the object returned in step 2, and the numeric activation code from your SMS. If successful, your Steam account now has 2FA. Logging in With a Mobile Authenticator
     
    If you have 2FA enabled, then for every login you will need to provide a twoFactorCode (unless you're logging in with node-steam-user using a loginKey). You can generate this code using node-steam-totp and your shared_secret which you obtained (and should have saved) when you enabled 2FA.
     
    Mobile-Confirming Trades
     
    You are now required to confirm all trades in which you lose items. If you don't have 2FA enabled, then these confirmations will go to your email and the trades will be held for fifteen days. If you do have 2FA enabled, then the confirmations must be accepted through Steam's mobile confirmation interface. You can also accept mobile confirmations through node.js.
     
    node-steam-tradeoffer-manager doesn't have anything built-in to accept mobile confirmations. This is because mobile confirmations encompass more than just trades -- market listings also require confirmation, and potentially other things in the future.
     
    node-steamcommunity can accept your confirmations for you. In order to accept mobile confirmations, you will need the identity_secret (not the shared_secret used for login) from when you enabled 2FA. The best way to do this is to call acceptConfirmationForObject right after each trade offer you send/accept or market listing you create.
  6. Like
    Dr. McKay got a reaction from Robert Lutece in Identifying Steam Items   
    Sometimes it can be a little confusing to identify a specific item in the Steam economy. There are several different types of IDs present in one particular item, and a lot of vague terminology. This guide aims to clear all that up for you.

    For starters, the "official" term for a Steam item is an asset. When I say a "Steam item", I mean a particular copy of an item. I'm not referring to the item's definition, name, image, or anything. I'm referring to a specific, unique copy of the item.

    In a general sense, every item on Steam must be owned by an app. An "app" is a game, software, or whatever on Steam. Every app has its own unique AppID. You can find a particular game's AppID by going to its store page or community hub and looking at the URL. For example, TF2's AppID is 440 so TF2's store page can be found at http://store.steampowered.com/app/440. CS:GO's is 730, Dota 2's is 570, and so on. Note that Steam Community items, Steam gifts, and other "Steam" items are owned by the "Steam" app, which has AppID 753. To identify an item, you'll need the AppID of the game which owns it.

    Of course, the AppID alone isn't enough. You also need two other IDs. Have you ever noticed how some games have multiple inventories, which appear in a drop-down list? An example is the Steam inventory, which has sub-inventories for "Community", "Gifts", "Coupons", etc. These "sub-inventories" are called contexts, and each context has its own context ID. If a game doesn't have a drop-down menu to select a context, that doesn't mean that it's without contexts. That only means that it has one single visible context. That single context still has an ID. For all current Valve games, the context ID for the publicly-visible context is 2.

    Context IDs can be a bit tricky. It's entirely up to the game's developer to determine how they work. For example, Valve games take the "single shared inventory" model in which there's one context ID which is shared by everyone. Under this model, an item belongs to one particular context and never leaves that context. Consequently, the item's context ID never changes. It is, however, possible for game developers to create contexts in any way they choose. For example, Spiral Knights uses the "per-character inventory" model in which everyone who plays the game has their own context IDs for their characters. Creating a new character creates a new context ID. This means that when an item is traded between users, its context ID will change as it moved out of a particular character's inventory.

    Those are the two different types of "containers" in the Steam economy. Apps own contexts, and contexts own assets. Every asset on Steam has, in addition to its AppID and context ID, an asset ID which is guaranteed to be unique inside of a given AppID+ContextID combination. Notice that this means that asset IDs are not unique across all of Steam. They aren't even unique across a particular app. They are only unique inside of a given context. For example, there could be two items with asset ID 1 in the same game, as long as they have different context IDs. An item's asset ID may be referred to as "assetid" or just plain "id".

    Context IDs and asset IDs are assigned by the game developer and can follow any pattern. They can change when traded or not. They may both be up to 64 bits in size. Consequently, Steam returns them (like all other 64-bit values) in JSON as strings.

    Still following? All of what we've learned so far leads us to this conclusion: in order to uniquely identify an item, you need its AppID, its context ID, and its asset ID. Once you have these three things, only then can you uniquely identify it. In fact, this is how you link to a particular item in a user's inventory: steamcommunity.com/profiles/steamid/inventory#appid_contextid_assetid. Here's an example: https://steamcommunity.com/id/DoctorMcKay/inventory#440_2_134161610

    What are these "classid" and "instanceid" values though?
    The observant reader may have noticed that there are two more IDs attached to a particular item which I haven't mentioned. These are the "classid" and "instanceid". These IDs are used to map an asset to its description.

    What's a description? A description is what you need in order to actually display an item. An item's description contains its name, image, color, market_name, whether it's tradable or not, whether it's marketable or not, and more. There are many endpoints on Steam which return JSON objects representing assets that only contain the asset's AppID, context ID, asset ID, classid, instanceid, and amount. An item's amount is how big of a stack it is. Unstackable items always have an amount of 1. Stackable items (such as Steam gems) may have a larger amount. Stacked items always have the same asset ID.

    What's the difference between a classid and an instanceid? In a nutshell, a classid "owns" an instanceid. The classid is all you need to get a general overview of an item. For example, items with the same classid will pretty much always have the same name and image. The instanceid allows you to get finer details such as how many kills are on a strange/StatTrak weapon, or custom names/descriptions.

    You can turn a classid/instanceid pair into a description using the GetAssetClassInfo WebAPI method. Notice that the instanceid is actually optional: if you only have a classid that's fine, you just won't get finer details for the item.

    Name? Market Name? Market Hash Name?
    Every asset on Steam has a name. Without a name, there's nothing to show in your inventory. The item's name is the name property of its description. The item's name may be localized if the game's developer has set it up to be.

    Every marketable item also has a "market name". This name may be the same as—or different from—the item's regular name. The item's market name is the market_name property of its description. This is the name that's displayed in the Steam Community Market when the item is up for sale. Why the distinction? There are some items which have value-affecting data that isn't in their name; for example, CS:GO skins have 5 different tiers of "wear", which isn't in their names. The wear tier is appended to each skin's market name however, so that the different tiers of wear are separated in the market. The market name may be localized or not, and may not exist at all if the item isn't marketable. It's up to the game's developer.

    Finally, every marketable item also has a "market hash name", available under the market_hash_name property. This name is supposed to be the English version of the item's market name, but in practice it may vary. For example, Steam Community items prepend the AppID of the originating app to each item's market hash name, but not to the market name. The market hash name is never localized, and may not exist if the item isn't marketable. Again, it's up to the game's developer. You can view the Community Market listings for any marketable item using this URL formula: steamcommunity.com/market/listings/appid/market_hash_name. Here's an example: https://steamcommunity.com/market/listings/440/Mann%20Co.%20Supply%20Crate%20Key

    Note that the Community Market has no concept of contexts. Consequently, market [hash] names are unique for a particular "class" of items per-app (and by extension per-context). This means that for marketable items, two items with identical market hash names will be worth roughly the same (with some exceptions, like unusual TF2 items).

    Questions?
    Ask below. I'm happy to help!
  7. Like
    Dr. McKay got a reaction from loch in getEncryptedAppTicket user data   
    You'd have to reverse engineer it yourself.
  8. Like
    Dr. McKay got a reaction from Frohser in Already logged on, cannot log on again   
    That should work, but for robustness you should listen for the disconnected event then re-login after that gets emitted (but make sure you only call logOn in response to disconnected if you manually initiated the logoff; disconnected can also be emitted if Steam goes down, in which case it will automatically reconnect).
  9. Like
    Dr. McKay got a reaction from Frohser in Already logged on, cannot log on again   
    Sleeping won't work. You need to use setTimeout to delay asynchronously. Delaying synchronously breaks pretty much everything, always.
  10. Like
    Dr. McKay got a reaction from Ferriar_幽助 in How can i get the contextID   
    Depending on what library you're using, there might be a method to get contexts.
     
    That said, it's likely any items you're interested in have a static, global context ID. For example, all current Valve games (TF2, CS:GO, etc) have a single context ID of 2. Steam Community items (emoticons, backgrounds, etc.) have a context ID of 6.
  11. Like
    Dr. McKay got a reaction from Silentz0r in Client.users after the bot fully connected?   
    Notice in the documentation that the users property isn't updated until after the user event finishes? The process.nextTick call waits until the next tick of the Node.js event loop, after the users property has been updated.
  12. Like
    Dr. McKay got a reaction from MaSTeR in How to bypass inviteToGroup restriction [2k17]   
    Well yeah, that's how you "bypass" needing to be friends with someone to invite them to your group.... you become friends with them.
     
    That's not a bypass, that's doing it how you're supposed to do it.
  13. Like
    Dr. McKay got a reaction from TheGoldenPotato in Send/receive messages to/from non-friends   
    You should be able to send messages to non-friends if you're in a group chat with them, but that's about it I think.
  14. Like
    Dr. McKay got a reaction from Kim in Send/receive messages to/from non-friends   
    Yeah, that should work.
  15. Like
    Dr. McKay got a reaction from Kim in Send/receive messages to/from non-friends   
    You should be able to send messages to non-friends if you're in a group chat with them, but that's about it I think.
  16. Like
    Dr. McKay got a reaction from Unsigno in I need to handle some concurrency ?   
    There's no concurrency concern with sending offers, but if you send offers too frequently (or you send too many offers) then Steam will start limiting you. You're limited to 30 total active outgoing offers, and 5 active outgoing offers to the same recipient. There are also request rate-limits.
  17. Like
    Dr. McKay got a reaction from xLeeJYx in How to get inventory contents of a steamuser   
  18. Like
    Dr. McKay got a reaction from Mad_F12 in how to get message from my trade offer   
    Just offer.message.
  19. Like
    Dr. McKay reacted to xLeeJYx in TypeError: Cannot read property 'type' of null when relog()   
    So i should login again with client.logOn but not client.relogin
  20. Like
    Dr. McKay got a reaction from Nwton in How to test user trade link?   
    You can create an offer and use getUserDetails. If the token is bad, it will error.
  21. Like
    Dr. McKay got a reaction from Markcreator in Identifying Steam Items   
    Yep!
  22. Like
    Dr. McKay got a reaction from Markcreator in Identifying Steam Items   
    There is no guarantee that if an assetid changes, it won't change to an assetid that has been previously assigned to an item. They are only guaranteed unique at one point in time. That said, for Valve games, when an assetid changes it will only increase and will never be an ID previously assigned.
  23. Like
    Dr. McKay got a reaction from Demby in Steam Guard still prompts despite totp sometimes   
    You can provide a custom time offset to steam-totp when generating the code. Current time + 30 should work.
  24. Like
    Dr. McKay got a reaction from Nacho in getExchangeDetails error   
    Argument 3 is tradeInitTime
  25. Like
    Dr. McKay got a reaction from Demby in Steam Guard still prompts despite totp sometimes   
    You're trying to reuse a code, which doesn't work.
×
×
  • Create New...