sometimes i drink wine / other times i drink light ale / i am drunk right now
6
   
Award
Favorite
Favorited
Unfavorite
Download
"this.user.setOption("dataDirectory", null);

this.user.on('sentry', (sentry) => {
fs.writeFileSync('share/' + this.name + '/ssfn', sentry)
});
this.user.on('loginKey', (key) => {
fs.writeFileSync('share/' + this.name + '/key', key, 'utf8')
});

// use ssfn/key files if present then start login
login(callback = null) {
if (this.logOn == 2) {
return (callback != null ? callback() : null);
}
if (this.logOn == 0) {
this.logOn = 1;
delete this.limitations;
var logon_settings = { rememberPassword: true, accountName: this.name }
, ssfn = (fs.existsSync('share/' + this.name + '/ssfn') ? 'share/' + this.name + '/ssfn' : 'share/ssfn');
if (fs.existsSync('share/' + this.name + '/key')) {
logon_settings.loginKey = fs.readFileSync('share/' + this.name + '/key', 'utf8');
} else {
logon_settings.password = this.pass;
}
if (fs.existsSync(ssfn)) {
this.user.setSentry(Crypto.createHash('sha1').update(fs.readFileSync(ssfn)).digest());
}
this.user.logOn(logon_settings);
}

// set persona state/mode, get level data, and check invites
function finish(account) {
account.user.setPersona(SteamUser.EPersonaState.LookingToPlay);
account.user.setUIMode(SteamUser.EClientUIMode.BigPicture);
account.user.getSteamLevels([account.user.steamID], (err, results) => {
if (typeof results == 'undefined') {
results = err;
}
account.friends_level = results[account.user.steamID];
account.friends_max = 2000 - ((350 - Math.min(350, account.friends_level)) * 5);
if (verbose || !account.accept_friend || account.user.limitations.communityBanned || account.user.limitations.locked) {
account.log('SESSION | loggedOn: '+ ("https://steamproxy.net/" + account.profile_url()).yellow
+ " | " + account.friends_level + "^" + account.friends_max + "="
+ (account.user.limitations.limited + "/" + account.user.limitations.communityBanned + "/" + account.user.limitations.locked).replace(
/true/g, '1'.red).replace(/false/g, '0'.green));
}
account.logOn = 2;
if (account.accept_friend) {
Object.keys(account.user.myFriends).forEach((friend) => {
if (account.user.myFriends[friend] == 2 && account.accept_friend) {
account.user.addFriend(friend);
}
});
}
if (callback != null) {
callback();
}
});
}
if (this.logOn == 1) {
this.logOn = 3;
this.user.once('webSession', () => {
if (this.user.limitations) {
return finish(this);
}
this.user.once('accountLimitations', (limited, communityBanned, locked, canInviteFriends) => {
this.user.limitations = { limited: limited, communityBanned: communityBanned, locked: locked};
finish(this);
});
});
}
}
"
2 Comments
Sai 23 Jul, 2019 @ 2:31pm 
:cure::catpaw:
arid 18 Jul, 2018 @ 7:37pm 
interesting . . .