Jessecar96 / SteamBot

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

Bot Times out On Steam Trade #45

Closed teliosdev closed 12 years ago

teliosdev commented 12 years ago

I've received reports that the SteamBot times out when traded (everything up until then works perfectly fine). When you trade it, it gives the OnAfterInit message, but after that (no matter what you do as a client), it times out. I think it might have to do with it not polling correctly, but I haven't been able to test that.

This issue is in the source code up until c5bd85b3f1af16c, and I'm sure after that commit, as well.

Philipp15b commented 12 years ago

And you waited with adding items until the inventories are loaded? If no, see #8.

teliosdev commented 12 years ago

This is a gist of the logs of one of the people that told me, there's not really much there...

Philipp15b commented 12 years ago

We should add debug messages in the trade class for inventory loading.

teliosdev commented 12 years ago

@Philipp15b I traded their bot myself, and I did nothing; I waited before doing anything, and it still timed out. The message printed into the trade chat by OnAfterInit showed, but nothing else did. I never added an item when trading them.

Philipp15b commented 12 years ago

Oh, after trying it myself, I can confirm this too.

teliosdev commented 12 years ago

I've tracked it down to Bot.cs line 82. CurrentTrade in the thread is never set to the actual trade, and is always null.

teliosdev commented 12 years ago

When the bot accepts a trade request, it runs into this bug; when the bot sends the request first, it doesn't.

mtfurlan commented 12 years ago

If the bot uses the function to send a new request(As opposed to the function to accept a request) when it receives a request, it still fails in the same manner as if it had just accepted a request.

cwhelchel commented 12 years ago

Commenting out line 248 of Bot.cs fixed this for me. Looked like random Trade cancellations were being handled in the TradeRequestCallback handler in Bot.cs(and setting CurrentTrade = null).

I don't know why it was acting like I was cancelling the trade.

teliosdev commented 12 years ago

I'm debating updating the version of SteamKit2 that SteamBot uses (see my SteamBot/steamre-merge branch). It should add additional features as well.

teliosdev commented 12 years ago

Sorry, what?

teliosdev commented 12 years ago

I fixed that, sorry.

Philipp15b commented 12 years ago

This should be fixed by 6fb22a5.