Open demipixel opened 7 years ago
Good idea, but might be very inefficient to load all offers on startup. This should probably be an optional feature.
How does steam handle this? Like when you open your inventory you have the in trade flag. How does steam flag this to the user ?
@Vankxr Is there an in-trade flag? Is that new? I think (thought) Steam doesn't support this, it's just especially useful for bots.
Nope, no official Steam in-trade flag AFAIK, though I think 3rd party extensions such as Steam Inventory Helper provide one.
Steam doesn't do anything special to prevent you from putting the same item in multiple trades.
Oh, stupid me. I forgot i was using steam inventory helper :(
Anyways I still agree majority of users of this module will need it.
Just make yourself an array, and push the assetid whenever you put an item up for trade. If you get an error while the trade is being sent, just remove the assetid from the array. That's how I did it. Works pretty well.
I'd like to know which items are already in offers when loading my inventory. It's possible to do manually (either by loading all offers when attempting to load your inventory or loading once at the beginning and keeping track via events which items are in offers and which are no longer in any offers).
So the suggestion is:
1) Load all offers on startup, save each item from the user in a dictionary 2) Offer changed events detects if an offer was changed (remove items from dictionary whether accepted or declined—not in an offer anymore) 3) When loading the user's inventory, modify the
EconItem
to include aninOffer
booleanYes, it's possible to do yourself by watching
newOffer
,sentOfferChanged
, andreceivedOfferChanged
, but I would imagine almost any bot (except receive-only bots) want to ensure users get different instances of the same item so trade offers for the same type of item don't clash.