Jessecar96/SteamBot — pull request #384 by cwhelchel (2013-07-13 23:39:45+00:00)
Title: Big trading fix.

Hopefully this is an acceptable implementation of Fiskie's #383 as well as a possible solution for the private backpack issue as well. I believe this also lays some ground work for trading non-tf2 items as well (but that's far off).

This is a **big freaking change** so it's probably hard to digest the diffs here's the skinny. `Trade.cs` got refactored quite a bit. `ForeignInventory.cs ` got added to do the private backpack stuff. `TradeSession.cs` is no longer a partial class and it carries state about version and more importantly it can accept a appid instead of being hard coded to tf2. `StatusObj` got refactored out into `TradeStatus` and it should take care of getting the user's assets for a new trade version (critical for handling items in the trade). I've tested out as best I could but obviously others need to test this as well.

This doesn't need saying but, this *hopefully* fixes a very high importance issue where bots are getting scammed out of items by people who are able to exploit the issue. **Everyone has a stake in downloading this branch and testing it out**. So please do download, test, and report back here.

- - -

Condensed commit log:

>Also removes some private inventory checking and adds an additional check for web errors when trading.
Fetching is working and now must implement using the foriegn inventory.

>Adds ForeignInventory class.

>To help with the JSON returns from the trade api call of the same name. Also use it correctly in Trade

>Implement the removal of items with foreign inventories.

>Start logic for using version number rolloverst to get trade assets. WIP.

>Move TradeSession.cs into a webapi folder. About to refactor this out also.

>Refactored out tradestatus api result into its own class.

>Also make TradeSession a class and pass in needed state (also extend to use appId instead of hardcoded to 440)

>Use new TradeSession for the trade web api interaction.

>Also fix validation for new way of getting offered and steamMyOffered items

>Remove apikey from Trade ctor and refactor and rename some methods.
>Add comments to/cleanup TradeSession and Init it on construction.