Jessecar96 / SteamBot

Automated bot software for interacting with Steam Trade
http://scrap.tf
MIT License
1.33k stars 910 forks source link

Optimize Trading by Commiting Changes to Offered Items in Poll #54

Closed teliosdev closed 11 years ago

teliosdev commented 12 years ago

Make AddItem and RemoveItem only modify the local copy, and when Poll gets called, update steam with the local copy of data. Can we do it?

Philipp15b commented 12 years ago

Yes We Can! :smirk:

Philipp15b commented 12 years ago

So after a bit of thinking I came to the conclusion that it just doesn't make that much sense. If we delay those calls,

  1. We would create lots of boilerplate code where we duplicate method parameters in classes etc. to store them
  2. Every single item will be added just as slow as before, because bulk adding does not exist
  3. We can even slow calls down by 800ms because they are only called later

I think that you maybe search for a solution to send a chat message while adding an item to the trade? This is much easier with C#'s async. This gives us the event loop that we need. Now that this is available in Mono we can also use it in SteamBot.

teliosdev commented 12 years ago

Bulk adding does not exist.

you need say no more. Making the request async seems to be the best choice, and if it needs to be sync, we can add the function for that.