Jump to content
McKay Development

Recommended Posts

Hello again! :)

On my challenge to avoid SteamApp now I'm trying to implement my own way to send and receive offers. Send offers now works fine now, but now I'm developing the incoming ones.

I see the event "newOffer", which returns an object, "offer". Offers contains some interesting data, like trade's id, it's state, if scrow is enable.... but I have some questions :blink:

1- I see an "account id" field. I guess it's a steam3id. Is there a way to return a classic id for check the user profile?

2- I see a state field. Is an integer. Which are the possible status?

3- What is the difference between "id" and "tradeID"? I see id has the trade ID, but I don't know why tradeID is null...

4- How can I accept an offer by it's ID?

5- How can I check all incoming offers?

 

Thanks for reading me and have a nice gaming! :D :D

Link to comment
Share on other sites

All TradeOffer objects created by TradeOfferManager have a partner field, which is a SteamID object. You can retrieve the account ID (aka partner ID) using id.accountid, or you can convert it to any of the 3 basic formats using id.getSteam2RenderedID(), id.getSteam3RenderedID(), and id.getSteamID64(). getSteamID64 will give you the 76561.... 64-bit ID.

 

You can access the state enum using TradeOfferManager.ETradeOfferState (assuming TradeOfferManager is the result of require('steam-tradeoffer-manager'). You can see it here.

 

An offer's ID is its trade offer ID. Trade offers and trades are distinct things. Not all trade offers result in a trade. A trade is the actual physical exchange of items. A trade offer is.. an offer to trade. Trade offers can be declined, canceled, expired, etc which will result in no trade taking place. If an exchange happens, a trade is created and its 64-bit ID is associated with the trade offer.

 

With TradeOfferManager, you will need to get a TradeOffer object before you can accept it. You can use manager.getOffer to get a TradeOffer.

 

You can use manager.getOffers to see all available offers on your account, or you can just use the newOffer event.

Link to comment
Share on other sites

Thanks for your complete answer! :)

Now that my questions are resolved I'll continue developing!

 

Thanks again and happy gaming :)

 

Sorry for re-opening the question,but I see when the offer is sent I see that the object has a field called icon_url. But it's not an URL... os there a way to convert that string in a URL?

Also, I can convert the sender ID for check their profile(Horray! Was easy looking for what you said on your previous Answer). But I was wondering... is there a way to get they info profile from your steamcomunnity API? Or should I use Steam API for that?

Link to comment
Share on other sites

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