Closed FlyingDelorian closed 11 years ago
In Trade.FetchInventories
, If it fails to get the backpack of either user from either API, it logs it and lets the user know.
Sorry, let me try that question again: Does the bot have to have access to the other user's backpack or can it trade successfully with a user with a private backpack?
I'm not really sure. I have to investigate what the trading API delivers. I think there were some missing things like a defindex
or something.
So I did a bit of research and I found out that when fetching an inventory via trading most of the relevant data is there. Except one very important: defindex
is not available. We could work around this by fetching the TF2 Schema from the Steam Web API and then getting the defindex from the schema where the names match. Some things like the item level or the quality are much harder to parse than from the Steam Web API, but they would be available.
@Philipp15b
I did some more testing, and this is the error I get when I attempt to look at an item while trading with the bot with a private profile:
[Man in a Yellow Hat 06/11/2012 14:37:48] ERROR: Error Polling Trade: System.NullReferenceException: Object reference not set to an instance of an object.
at SteamTrade.Inventory.GetItem(UInt64 id) in C:\Users\George\SteamBot\SteamTrade\Inventory.cs:line 58
at SteamTrade.Trade.Poll() in C:\Users\George\SteamBot\SteamTrade\Trade.cs:line 522
at SteamBot.Bot.<.ctor>b__1() in C:\Users\George\SteamBot\SteamBot\Bot.cs:line 133
If I have a public profile but a private inventory, it throws an exception. I think this is the behavior that was mentioned above.
TradeException "I'm having a problem getting one of our backpacks. The Steam Community might be down. Ensure your backpack isn't private."
Closing this since it's not possible.
Jesse, this still isn't fixed; it crashes on trading with a person with a private backpack, so it's still a bug, although the fix may not be what the opener wanted.
I see that the bot does a check to see if the user it is trading with has a private backpack. Is this needed? Can my custom class skip that step? I'm curious why it needs to see it when the items are presented to it in the trade.