SteamBot icon indicating copy to clipboard operation
SteamBot copied to clipboard

Handling trade offer accept responses

Open scholtzm opened this issue 11 years ago • 5 comments

You might have seen this already. You accept a trade offer, you get an error (i.e. code 42), but the items are traded and the trade offer goes through.

Current trade offer branch by @StormReaper returns bool when accepting (+ tradeid via out), but almost every single large trade offer fails with some sort of cryptic error code.

Accept method should provide these error messages, so we know what to do, e.g.:

  • code 42 - retry accept
  • code 11 - retry accept
  • code 24 - cookies are broken, don't bother retrying ...
  • etc.

scholtzm avatar Oct 12 '14 15:10 scholtzm

Or perhaps it should just retry on its own, and return a failure if it doesn't work after a few attempts?

Regardless, though this is a big issue, I still think we should merge what we have, given how many people are already using it, and how big of a change it is (it's preventing me from starting another big project).

BlueRaja avatar Oct 12 '14 15:10 BlueRaja

Well that is an option too, but how do we decide how many attemps? I would rather let the programmer choose what to do.

Large trade offers will always fail though. Good thing is, @StormReaper already implemented check for this.

scholtzm avatar Oct 12 '14 15:10 scholtzm

Regarding retries in general, what do you think about retrying after 1 second, then 2, then 4, then 8, etc., instead of a fixed delay? (i.e. 2^0,1,2,3...)

I've noticed sometimes when a bot has issues logging in, it retries every 2 seconds many times before it is successful, which seems excessive.

glen-84 avatar Oct 12 '14 15:10 glen-84

If accepting failed we can just check offer status after 10 sec. If it still active - accept again, if it accepted - all good, if it canceled or have invalid items - do nothing.

doktokto avatar Jan 17 '15 14:01 doktokto

My record - 38 attempts to accept. Offer accepted successfully only after 38 attempts.

doktokto avatar Jan 17 '15 19:01 doktokto