STEAM GROUP
St​eamRE St​eamRE
STEAM GROUP
St​eamRE St​eamRE
22
IN-GAME
74
ONLINE
Founded
April 23, 2015
Language
English
All Discussions > node-steam-user > Topic Details
Beto Dec 23, 2015 @ 12:30am
Sentry file
I'm trying to save sentry file:
client.on('sentry', function(sentryHash) { fs.writeFile('sentry',sentryHash,function(err) { if(err) { console.log(err); } else { console.log('Saved sentry file hash as "sentryfile"'); } }); });

but my case does not work even if I try:

client.on('sentry', function(sentryHash) { console.log('Hi!'); });

also I can't use the ssfn file.

How to save and login on the ssfn file?
< >
Showing 1-15 of 27 comments
Mole Dec 23, 2015 @ 11:06am 
sentry event is only emitted if you use classic SteamGuard, 2FA requires using new code everytime you want to log in.
Beto Dec 23, 2015 @ 11:11am 
Originally posted by Mole:
sentry event is only emitted if you use classic SteamGuard, 2FA requires using new code everytime you want to log in.

How client works on a PC? It does not require authorization every time.
Beto Dec 23, 2015 @ 11:22am 
or this module does not yet support this feature, but it will appear in the future?
Mole Dec 23, 2015 @ 11:35am 
Here you can see what happens to sentry[github.com]

It seems like the event is not fired up if you use mobile token. While using standard classic (mail) SteamGuard the module handles by saving it to the file (which is reused in future).
McKay Dec 23, 2015 @ 11:48am 
The "sentry" event is still emitted even if you have 2FA. I just tested and it definitely works.
Mole Dec 23, 2015 @ 12:02pm 
Sorry, assuming it's because of 2FA was stupid. Deleted existing sentry files so module couldn't use them and event was fired up correctly. I guess it's also the case for OP.
McKay Dec 23, 2015 @ 12:10pm 
Yes, you won't get a sentry event if the module already has one saved. On Windows, they're saved in %localappdata%\doctormckay\node-steamuser.
Beto Dec 23, 2015 @ 1:40pm 
Originally posted by FP Dr. McKay:
Yes, you won't get a sentry event if the module already has one saved. On Windows, they're saved in %localappdata%\doctormckay\node-steamuser.

This is my code:
var SteamTotp = require('steam-totp'); var twoFactorCode = SteamTotp.generateAuthCode(''); var SteamUser = require('steam-user'); var client = new SteamUser(); client.logOn({ 'accountName': '', 'password': '', 'authCode' : '', 'twoFactorCode' : twoFactorCode }); client.on('loggedOn', function(details) { console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID()); client.setPersona(SteamUser.Steam.EPersonaState.Online); client.gamesPlayed(570); }); client.on('sentry', function(sentryHash) { fs.writeFile('sentry',sentryHash,function(err) { if(err) { console.log(err); } else { console.log('Saved sentry file hash as "sentryfile"'); } }); });
please tell me what am I doing wrong

McKay Dec 23, 2015 @ 2:13pm 
Why are you even saving the sentry? node-steam-user does it for you.
Beto Dec 23, 2015 @ 2:26pm 
Originally posted by FP Dr. McKay:
Why are you even saving the sentry? node-steam-user does it for you.

Where? Mac OS
Beto Dec 23, 2015 @ 2:27pm 
Originally posted by FP Dr. McKay:
Why are you even saving the sentry? node-steam-user does it for you.

and how to use? setSentry(sentry)?
McKay Dec 23, 2015 @ 3:10pm 
You don't need to do anything at all with sentries if you don't want to. node-steam-user saves and uses them 100% automatically.

On Mac, they're saved to ~/Library/Application Support/node-steamuser

Please read the documentation[www.npmjs.com]; it has all these answers.
Beto Dec 23, 2015 @ 3:23pm 
Ok. I understand. But why can't I call the event?

client.on('sentry', function(sentryHash) { console.log('Hi!'); });
Mole Dec 23, 2015 @ 3:30pm 
Because "you won't get a sentry event if the module already has one saved". It was called once when you logged in for the first time - if you want the event to be fired up again, delete account's sentry files.

As you may see here[www.npmjs.com], the module handles sentry files automatically, so you don't have to worry about it.

By default, SteamUser will automatically save and reuse this sentry file for subsequent logins
Beto Dec 23, 2015 @ 3:44pm 
Thank you very much! 1 more question: How to use setSentry()[www.npmjs.com]?

var sentry = getSHA1(fs.readFileSync('sentry.bin')); client.setSentry(sentry);

This code does not work.
< >
Showing 1-15 of 27 comments
Per page: 1530 50

All Discussions > node-steam-user > Topic Details