Jessecar96/SteamBot — pull request #574 by waylaidwanderer (2014-04-25 03:16:47+00:00)
Title: SteamBot Rewrite

Here's the SteamBot rewrite I've been working on. Any further changes are pending your feedback and testing.

The following is a list of what was changed (done to the best of my ability):
* Creating a new instance of GenericInventory automatically fetches the appropriate inventory
* Removed AdminUserHandler.cs and SimpleUserHandler.cs since those were more TF2-oriented. If someone would like to create a generic version of AdminUserHandler and send it as a pull-request, that would be great.
* Renamed SteamTradeDemoHandler.cs to SimpleUserHandler.cs
* In the Trade session, the `amount` variable was hard-set to 1, but some games (such as Spiral Knights) require it. `amount` was also added to the POST data sent in a trade, but this is untested.
* Friends-only inventories are no longer a problem. A cookie is sent when fetching generic inventories. Unfortunately this doesn't work for the `GetPlayerItems` api.
* `GenericInventory.Inventory.Item` is passed into `OnTradeAddItem` (and etc) instead of `Schema.Item` and `Inventory.Item`.
* Created folders for Inventories and Schemas
* Renamed Inventory.cs and Schema.cs to TF2Inventory.cs and TF2Schema.cs. Fetching schemas is now done on demand in `OnLoginCompleted` by creating a new instance of the class (e.g. `new TF2Schema(Bot.apiKey)`).
* Also added Dota2Inventory.cs and Dota2Schema.cs
* Trades now initialize instantly, no longer waiting for all inventories to be fetched first. This avoids the user seeing "Bot is loading..." all the time.
* `Trade.MyInventory` and `Trade.OtherInventory` is now public.
* Trade events are now queued. This prevents exceptions from being thrown such as sending a trade message after the trade has expired, along with ensuring that events are handled in order.

For a full list of changes, you should look through [the commits](https://github.com/waylaidwanderer/SteamBot/commits/GenericRewrite).