Include unsupported fields in separate CEconItem property
See original GitHub issuePer #224 and #194, non game-agnostic properties should not be included in CEconItem, which makes complete sense. However, it might be beneficial to add something like an auxiliary
property which contains everything included in the inventory response that doesn’t fit an existing property. This way, non game-agnostic properties can be included in a game-agnostic way, and used when desired without cluttering the normal CEconItem.
For example, CS:GO adds a cache_expiration
property to items in trade lock, so that would be included in CEconItem like so:
CEconItem {
market_hash_name: "P250 | Sand Dune (Minimal Wear)",
...
auxiliary: {
cache_expiration: "2019-09-28T07:00:00Z"
}
}
In essence, this makes it so that users who require game-specific properties can access them easily without cluttering CEconItem
with game-specific logic or variables.
I’d be more than happy to implement this if desired.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
https://github.com/DoctorMcKay/node-steamcommunity/releases/tag/v3.40.2
If you’re talking about the cache_expiration property available on Steam item objects, that’s not a CS:GO-specific property. It’s a generic Steam property that all games can use. Steam coupons use it for when they expire, for example.
As for your proposal, I think I would rather leave it up to external modules to do stuff like this. For example, you could create a package steam-csgo-item-parser or something that you pass a CEconItem object to and it could return what you’re interested in.