Jump to content
McKay Development

Dr. McKay

Administrator
  • Posts

    3591
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Dr. McKay got a reaction from TomYoki in Card Sets   
    The easiest way to determine which game a community item belongs to is to check its market_hash_name. All cards/emoticons/backgrounds have their market_hash_names prefixed with the game's appid and a hyphen (e.g. "440-SCOUT").
  2. Like
    Dr. McKay got a reaction from tbo0 in getInventoryContexts returns malformed response   
    Are you logged in?
  3. Like
    Dr. McKay got a reaction from T1MOXA in Cannot read property 'player_name' of undefined   
    You're overwriting the value of steamID in your outer loop, which changes the context of the closure. This is confusing, I know. Just do this and it should work:
    bot.on('friendsList', function() { Object.keys(bot.myFriends).forEach(function(steamID) { if(bot.myFriends[steamID] === 2) { bot.getPersonas([steamID], function(getName) { var friendName = getName[steamID].player_name; //Some code }); } }); });
  4. Like
    Dr. McKay got a reaction from d4c0 in Help me find method   
    https://github.com/DoctorMcKay/node-steamcommunity/blob/master/components/users.js#L345
  5. Like
    Dr. McKay got a reaction from mrxbell in There was an error sending your trade offer. Please try again later. (26)   
    https://steamerrors.com/26
  6. Like
    Dr. McKay got a reaction from mrxbell in webSession not fire when i call webLogOn() ?   
    I've been investigating this for the past hour and a half or so, and it appears that Valve did indeed break something with client-based web logons last night. The API is giving quite a lot of 403s with the same error message that you get if you use a bad nonce. Therefore, my suspicion is that there's some kind of miscommunication between the CM (the server which most likely generates the nonce and issues it to you), and whichever server consumes those nonces to turn them into cookies. I've tried adding some delays just in case the communication between those servers is slow, but that doesn't appear to have helped anything.
     
    Re-logging your client seems to solve the problem, at least temporarily. You may want to try doing that if you don't get a web session within a reasonable amount of time after requesting one.
     
    I've alerted Valve, but there's no telling if or when they'll take action.
  7. Like
    Dr. McKay got a reaction from mrxbell in webSession not fire when i call webLogOn() ?   
    Best I can tell, web logons became finnicky ever since the Steam maintenance last night.
  8. Like
    Dr. McKay got a reaction from Yoki in [Question] How do you receive market_hash_name in trade.   
    https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#properties
     
    itemsToReceive
  9. Like
    Dr. McKay got a reaction from mrxbell in How convert steamID64 to steamID3   
    https://www.npmjs.com/package/steamid
    var SteamID = require('steamid'); var steamid3 = (new SteamID(steamid64)).steam3(); If you want the accountID and not the Steam3 rendered format as your title implies ([u:1:46143802]) then you just want to do:
    var SteamID = require('steamid'); var accountID = (new SteamID(steamid64)).accountid;
  10. Like
    Dr. McKay got a reaction from pipskas in how to get assetid after accept offer   
    https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#getreceiveditemsgetactions-callback
  11. Like
    Dr. McKay reacted to MrKirby in How to get your own name in console (and other users (optional))   
    After some time having trouble with it (as I am new), I got it to work! Thanks so much dude! for everyone else wondering.. I used this:
    client.on('friendMessage', function(steamID, message) { friendID = [steamID]; client.getPersonas(friendID, function(getName) { var x = getName[friendID]; var friendName = x.player_name; console.log("[FriendlyMessage] " + friendName + ": " + message); } }); Brackets could be wrong because my code didn't stop there and I am correcting it within the text editor
     
    I do have another question and I don't know if I should ask it here?
    But, what are the numbers for friendrelationships??
    I know 2 is friend request send to me. But where can I find it.. because I am having trouble finding everything...   
     
    EDIT: After actually turning my brain on.. I checked within the files of your node and found a file with the numbers.... Shit I'm stupid... Thanks anyway!! GREAT SHIT DUDE!!!
  12. Thanks
    Dr. McKay got a reaction from wxz123 in ClientMicroTxnAuthRequest (5504)   
    Don't do it that way, that's a very bad idea. Write the entire 64-bit number to the buffer.
  13. Like
    Dr. McKay got a reaction from headshot1k in ClientMicroTxnAuthRequest (5504)   
    Okay, here's the flow of how this works:
    CS:GO client sends a GCStorePurchaseInit to the GC with the items you want to buy You get back a GCStorePurchaseInitResponse containing a result (1 = OK) and a transaction ID (64-bit, even though it can currently fit into 32 bits) Concurrently, you get a ClientMicroTxnAuthRequest message via Steam. Discard the first byte of the payload (seems to be 1 in the dump you sent, not sure if that's always the case or what the significance of it is), then decode the remainder of the payload as Binary KeyValues (require('binarykvparser').parse(payload.toBuffer().slice(1))). The interesting stuff in there is the total/BillingTotal and transID (orderid is there if you want to make sure it matches what the GC sent back). Grab the transID and send it back in ClientMicroTxnAuthorize (little-endian encoded, as always) and append a 32-bit value of 2 (unsure what the significance of this is, or if it ever changes from 2. Could perhaps be an authorization result, where 1 is deny or something). You'll get back ClientMicroTxnAuthorizeResponse with a payload containing a 32-bit eresult value (1 = OK), and a 1-byte unknown value of 0. If successful, If successful, send GCStorePurchaseFinalize to the GC containing the transaction ID you from the GC before (not transID) to get your items.
  14. Like
    Dr. McKay got a reaction from mrxbell in sessionExpired will be emitted continuously until you log back in ?   
    Remove listeners if you're done with it. But it being emitted is an indicator that something is still trying to do something even when you've logged off.
  15. Like
    Dr. McKay got a reaction from evirtual_dev in How to Get All Item From CS GO   
    There is no way to do this. You can parse the CS:GO item schema that ships with the game, but I don't believe it'll get you what you want.
  16. Like
    Dr. McKay got a reaction from Statyw in Change IP on steamcommunity   
    On your local PC it should be your private IP, but not 127.0.0.1.
  17. Like
    Dr. McKay got a reaction from Vin4er in error on sending offer   
    It usually helps to print out values of variables when debugging. In this case, I suspect one of appid, contextid, or assetid is undefined or not the value you are expecting.
  18. Like
    Dr. McKay got a reaction from Vin4er in error on sending offer   
    Data types shouldn't matter. The module should convert everything internally for you. Are you absolutely sure you're using asset IDs which are owned by the account you're logged into? Maybe you mixed up some accounts?
  19. Like
    Dr. McKay got a reaction from Vin4er in error on sending offer   
    Your asset ID is still wrong.
  20. Like
    Dr. McKay got a reaction from Vin4er in error on sending offer   
    Yes, the assetid is the "id" property there.
  21. Like
    Dr. McKay got a reaction from EthanBOT in 'Could not act on confirmation' while trying to respond to any confirmation   
    You can use this to accept all outstanding confirmations at once, but the entire request will fail if any one confirmation fails to be confirmed.
  22. Like
    Dr. McKay got a reaction from EthanBOT in Bot running 24/7 - Quick question   
    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.
  23. 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!
  24. Like
    Dr. McKay got a reaction from Coyeks in How to only accept CSGO keys in 'newOffer'   
    offer.itemsToReceive contains an array of the items you'd receive if you accepted this offer. For each item in this array, check appid to make sure it's CS:GO and name to make sure it's a key. For example:
    var allItemsAreGood = offer.itemsToReceive.every(function(item) { return item.appid == 730 && item.name == "CS:GO Case Key"; });
  25. Like
    Dr. McKay got a reaction from jazz in Custom Storage Engine   
    If that works it's a fluke. You should pass an Error to the callback, like this:
    callback(new Error("File not found"));
×
×
  • Create New...