Jessecar96 / SteamBot

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

Trade offer problems after #934 #979

Closed RafalNiewinski closed 8 years ago

RafalNiewinski commented 8 years ago

Hi, I have problem with trade offers after pulling #934 changes.

My trades stopped working and I tried to debug it by adding log messages for each OnTradeOfferUpdated call.

In the results I can see that this method is always called 13 times in my case and always with the same trades. Any new trade does not appear regardless of its status and even after bot restart.

My debug (always the same): debbot

BlueRaja commented 8 years ago

New trade offers don't appear? o_O Are you sure you're using the correct API key (it has to be one tied to the bot's account, not to your account)

RafalNiewinski commented 8 years ago

I am sure, I checked it for 2 accounts 5 minutes ago and my API key's are correct (I checked property Bot.ApiKey at breakpoint in OnTradeOfferUpdated.

All working fine before I pulled latest master from github.

RafalNiewinski commented 8 years ago

I'm trying to investigate the problem and really there is something wrong with this merge or with my environment.

My bot stopped working after I pulled and merged github master into my code. Now I wanted to see if #934 really caused the problem in my case.... and I reversed merge commit with this pull request on my branch to make sure it is here and bot began to work again.

It is something here or something related with this.

RafalNiewinski commented 8 years ago

Success, I found the problem. It is located in this commit in tagged line: https://github.com/Jessecar96/SteamBot/commit/23b579c945195a346ed84ccbd50d92901a83ab05#diff-b5ff258942e09d2bcd91e6b6f6035e2fR56

the fifth parameter is set to true, by calling GetTradeOffers with historicalOnly set to true Steam API returns only completed offers.

After changing this to false bot works properly.

@BlueRaja - it is your commit so please check out Am I right in ?

BlueRaja commented 8 years ago

According to the API documentation, when both active_only and historical_only are set to true, all trade offers are returned.

I'll do some testing to see if the documentation is correct...

RafalNiewinski commented 8 years ago

I tested it today again, and when I called api with both options set to true I received 10 offers in json.

When I changed historical_only to false steam returned me 11 offers with my newly created (5 minutes before) not yet processed offer.

BlueRaja commented 8 years ago

I'm seeing the same thing. Fixed in #981