Jump to content
McKay Development

Getting the eresult.


Recommended Posts

Hello, so lets say if when sending an offer I get a steam error. Is it stored in eresult?
If yes, would this be a correct way to retrieve it?
 

Quote

offer.send((err, status) => {
                      if(err)
                        {

                           if(err.eresult != null)

                             {
                           console.log(err.eresult);

                             }
                        }

Will it only return the number? (like 15 for access denied & etc)

Edited by Op1x3r
cleaning up the code.
Link to comment
Share on other sites

On 6/8/2020 at 5:51 AM, Dr. McKay said:

err.eresult is just the number, yes.

I got 1 more question:
Is that the correct way to use isGlitched()?:

offer.accept((err, status) => {
   if(err)
   {
      console.log(err);
      console.log(err.eresult);
      if(err.eresult == 15)
        {
            do somthing
        }

      if(offer.isGlitched())
      {
         offer.decline();
      }
  }

 

Or should I check it before trying to accept it?

Link to comment
Share on other sites

14 minutes ago, Op1x3r said:

Is that the correct way to use isGlitched()?

No, you should check when you process the offer. It should be among the first things you check in the offer. 
You can't act on an offer (e.g. decline the offer) after you've accepted it which you are doing in the above code.  

Link to comment
Share on other sites

On 6/9/2020 at 6:52 PM, vrtgn said:

No, you should check when you process the offer. It should be among the first things you check in the offer. 
You can't act on an offer (e.g. decline the offer) after you've accepted it which you are doing in the above code.  

Thanks for the answer!
I'm still having problems with eResult tho, the example that I showed in my post, doesn't seem to work. It says "TypeError: Cannot read property 'eresult' of null"

 

But then also there's this:
image.png.8efc9fc1616828ef574cf5e86a20a3b5.png

Edited by Op1x3r
Link to comment
Share on other sites

2 hours ago, Dr. McKay said:

This means that err is null, meaning there was no error.

                        offer.send((err,status) =>
                        {
                            if(err)
                            {
                                console.log(err);
                                if(err.eresult != undefined && err.eresult != null) {
                                    if (err.eresult == 15) {
                                        *redisrem*
                                        *some math*
                                        refundPlayer(offerToSend.steamid64, balance);
                                        return false;
                                    }
                                }

                                *socket stuff*
                                if(err.eresult != undefined && err.eresult != null)
                                {
                                    *redisrem*
                                        setOfferStatus(offerToSend.id, 0, 'Steam error ' + err.eresult); //<--- This is the line where it always crashes.
                                }
                                else
                                {
                                    *redisrem*
                                }
                                *some math*
                                refundPlayer(offerToSend.steamid64,balance);
                            }


How can err be null in here?

 

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