darkwar123 Posted April 11, 2016 Report Posted April 11, 2016 When accept TradeOffer, error occurs "Unknown state 2"Log from my bot: darkwar1234: Logged On darkwar1234: new trade offer from 76561198052220848 darkwar1234: Unknown state 2 darkwar1234: cookies are updated! darkwar1234: trade offer â„–1150955479, status: 3 darkwar1234: trade offer are accepted!Code: offer.accept(function(err){ if(err){ // here console.log(err.message) "darkwar1234: Unknown state 2" self.relogin(err, function(){ self.checkOffer(offer, function(offer){ if(offer.state == 3){ self.acceptOffer(trade, callback); }else if(offer.state == 2){ self.handleOffer(trade, callback); } }); }); return; } self.acceptOffer(offer, callback); });And when I use method TradeOffer.update() it receive undefined if I make offer now or if TradeOffer has status 3 it show error Offer no longer valid. I want to use this method instead getOffer in this part of code: SteamBotManager.prototype.checkOffer = function (offer, callback) { var self = this; self.manager.getOffer(offer.id, function(err, offer){ if(err){ self.relogin(err, function(){ self.checkOffer(offer, callback); }); return; } if(offer.state == 2 || offer.state == 3){ self.log("trade offer â„–"+ offer.id +", status: "+ offer.state); if (typeof(callback) === 'function') { callback(offer); } }else{ self.log("trade offer â„–"+ offer.id +" is no longer valid, status: "+ offer.state +"!"); } }); }; Quote
Dr. McKay Posted April 11, 2016 Report Posted April 11, 2016 Looks like Steam isn't updating the WebAPI data quickly enough now. Are you getting that error every time, or just sometimes? Quote
darkwar123 Posted April 11, 2016 Author Report Posted April 11, 2016 Looks like Steam isn't updating the WebAPI data quickly enough now. Are you getting that error every time, or just sometimes?Every time when accept Quote
speedy Posted April 13, 2016 Report Posted April 13, 2016 (edited) Every time when accept For me the same, but not really a problem the trades are still quite quickly accepted on "receivedOfferChanged" event.But i have related to this another question for other error codes from steam. accept([autoRetry][, callback]) Which error codes do not accept the trade temporary ? So that the autoRetry function has to accept again (autoRetry after a minute, found in documentation)?Background is, some trades need a very long time (> 1 minute) to be accepted (usually when steam is under heavy load..) For me with a bet site its better this trades will be declined when that happens.So my idea if error code = x message user or try to accept faster again or try to decline...I found the following error codes 16 and 28, can this be right? Edited April 13, 2016 by speedy Quote
Dr. McKay Posted April 13, 2016 Report Posted April 13, 2016 16 is the only one I've seen that means that the offer is being accepted but is taking a while. As far as I know, once you try to accept it and you get that code, you can't decline it. FYI, autoRetry will be going away in v2. I'm also working on fixing accept error. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.