Jump to content
McKay Development

Recommended Posts

Posted

Hello, sometimes when my sent offer is accepted, I am calling getReceivedItems method and array in "items" argument is empty.

This offer is accepted and items are on bot.

Why this is happening sometimes?

I think that there is only way to fix this is create recalling of this method if array is empty with something like ~5 iterations.

Posted

Thank you.

One more question: when I am doing offer.send method and there is status "sent" I am receiving offer.id so I can create offer link for user.

But there is delay like 0-5 seconds for this link after status is "sent".

In this delay user is receiving: "An error was encountered while processing your request:".

So if he will refresh this page in ~5 seconds everything will be ok.

Is there any ways to check this delay or only way to fix this is manual timeout?

Posted

Thank you.

One more question: when I am doing offer.send method and there is status "sent" I am receiving offer.id so I can create offer link for user.

But there is delay like 0-5 seconds for this link after status is "sent".

In this delay user is receiving: "An error was encountered while processing your request:".

So if he will refresh this page in ~5 seconds everything will be ok.

Is there any ways to check this delay or only way to fix this is manual timeout?

 

it's because of steam, you can use:

setTimeout(function(){displayOfferUrl();}, 7000);

on the client side, replace displayOfferUrl() with your own function(s) that will display the trade url, it will show the url after 7 seconds.

Posted

This is interesting. I've never experienced any kind of delay for offers which don't need confirmation.

 

Are you 100% sure that the offer is "sent" and not pending confirmation (which is being auto-confirmed or something)?

Posted

This is interesting. I've never experienced any kind of delay for offers which don't need confirmation.

 

Are you 100% sure that the offer is "sent" and not pending confirmation (which is being auto-confirmed or something)?

It is on event "sentOfferChanged" where "offer.state" is "Accepted" and only offer.itemsToReceive.

Now it is working well but sometimes there is delay. Steam so slow sometimes.

Posted (edited)

I have another question...

Sometimes when sent offer is accepted and it is a withdraw offer (only items to partner), I am receiving deposit (only items from partner) notification.

Is it bug of steam again or how to control it more better?

This is how I am checking state of offers:

// ETradeOfferState.Accepted:
if (offer.itemsToGive.length !== 0) {
// withdraw
}
else {
// deposit
}
Edited by Felix
Posted

I don't understand what you're saying.

 

I have only 2 types of sent offers:

1) only items from partner (offer.itemsToReceive only) - deposit type.

2) only items to partner (offer.itemsToGive only) - withdraw type.

On "sentOfferChanged" event where "offer.state" is "Accepted" I need to understand what type of this offer.

I am checking this with the code that I wrote above.

But there is problem sometimes, when I am sending offer with withdraw type and this offer is accepted, bot is telling me that this offer is deposit (but there is offer.itemsToGive.length !== 0).

Are there any solutions how to check type of offer in this event except global variables?

Posted

Is itemsToGive for sure bigger than 0? Also are you up to date?

 

Mhm, I have 1.21.1. Will update now.

This offer was sent (with only items from bot) and accepted so logically itemsToGive was bigger than 0.

I will create full debug log for this.

Posted

I ask if you're up to date because Steam can sometimes return data that implies that the offer is completely empty (no items on either side). A recent update made the getOffers request fail instead of returning that bad data.

Posted

I ask if you're up to date because Steam can sometimes return data that implies that the offer is completely empty (no items on either side). A recent update made the getOffers request fail instead of returning that bad data.

 

So there is no way to understand what type of this offer by checking it only in offer object?

Will check it in DB then.

itemsToGive: [],
itemsToReceive: [],

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...