Op1x3r Posted June 7, 2020 Report Posted June 7, 2020 (edited) 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 June 7, 2020 by Op1x3r cleaning up the code. Quote
Dr. McKay Posted June 8, 2020 Report Posted June 8, 2020 err.eresult is just the number, yes. Op1x3r 1 Quote
Op1x3r Posted June 9, 2020 Author Report Posted June 9, 2020 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? Quote
vrtgn Posted June 9, 2020 Report Posted June 9, 2020 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. Dr. McKay 1 Quote
Op1x3r Posted June 10, 2020 Author Report Posted June 10, 2020 (edited) 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: Edited June 10, 2020 by Op1x3r Quote
Dr. McKay Posted June 11, 2020 Report Posted June 11, 2020 Quote TypeError: Cannot read property 'eresult' of null This means that err is null, meaning there was no error. Quote
Op1x3r Posted June 11, 2020 Author Report Posted June 11, 2020 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? Quote
Dr. McKay Posted June 11, 2020 Report Posted June 11, 2020 It couldn't be, that error is coming from somewhere else. But that error is definitely indicating that you're trying to reference eresult on something that's null. 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.