Jump to content
McKay Development

Recommended Posts

Posted

Hi evereone!

 

I'm stuck on this, please, help me out.

manager.on('newOffer', function(offer) {
     ...
     acceptOffer(offer, userid, function(err, result) {
          if(err){
               //Steam return error
          } else {
              //All fine
          }
     });
     ...
});

If Steam return errors like #11 or #16 etc, that means it's unable to accept the offer at the moment, but it's alright after several seconds.

This creates a lot of junk records in my database, since i have to write into it to keep track of the errors and re-accept trades..

Can I delete that offer from polldata to call 'newOffer' again or what else can I use to recall newOffer for not acceptable trades?

Posted

It's not really recommended to manipulate poll data. TradeOfferManager's job is to emit newOffer once per incoming offer. Errors can be frustrating but it's your responsibility to make sure that they're dealt with properly.

 

You could use offerList to check for offers that should have already been accepted (probably want to keep a list of offers you've attempted to accept and the timestamp so you don't try to accept an offer too frequently).

Posted

It's not really recommended to manipulate poll data. TradeOfferManager's job is to emit newOffer once per incoming offer. Errors can be frustrating but it's your responsibility to make sure that they're dealt with properly.

 

You could use offerList to check for offers that should have already been accepted (probably want to keep a list of offers you've attempted to accept and the timestamp so you don't try to accept an offer too frequently).

Thanks for an answer!
Also I have a question - offers don't update by polls sometimes.
When new offer exists but event newOffer hasn't been running - what should I do in this case?
Is it OK and I just need to check new offers by another method or there's my mistake?
Sorry for my English.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...