Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.onLogin = function () {
if (exports.isReady()) {
// We have relogged, set game and online
this.gamesPlayed(package.name);
this.setPersona(SteamUser.EPersonaState.Online);
}
};
steam.on("loggedOn", () => {
steam.setPersona(Steam.EPersonaState.Online);
console.log("Logged on to Steam.");
ensureCommunityLoggedIn(() => {});
});
.then(() => {
this.client.setPersona(SteamUser.EPersonaState.Offline)
this.client.gamesPlayed(this.games !== null ? this.games : [10, 730])
return console.log(`${this.logheader()} Starting to boost games!`)
})
.catch(err => console.error(`${this.logheader()} ${err}`))
client.on('loggedOn', function(details) {
console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());
client.setPersona(SteamUser.EPersonaState.Invisible);
});
.then(() => {
this.client.setPersona(SteamUser.EPersonaState.Offline)
this.client.gamesPlayed(this.games !== null ? this.games : [10, 730])
return console.log(`${this.logheader()} Starting to boost games!`)
})
.catch(err => console.error(`${this.logheader()} ${err}`))
client.on("loggedOn", function(response) {
console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());
client.setPersona(SteamUser.EPersonaState.Online);
});
client.on("error", function(error) {
friends.forEach((v) => {
var id = friends.shift()
try {
nicks.push(emojiStrip(steam.users[id].player_name));
} catch(e) {
nicks.push(id);
}
steamids.push(id);
if( steam.myFriends[id] == Steam.EFriendRelationship.Friend ){
if( steam.users[id].persona_state == Steam.EPersonaState.Offline ) states.push("Offline");
else if( steam.users[id].persona_state == Steam.EPersonaState.Online ) states.push("Online");
else if( steam.users[id].persona_state == Steam.EPersonaState.Busy ) states.push("Busy");
else if( steam.users[id].persona_state == Steam.EPersonaState.Away ) states.push("Away");
else if( steam.users[id].persona_state == Steam.EPersonaState.Snooze ) states.push("Snooze");
else if( steam.users[id].persona_state == Steam.EPersonaState.LookingToPlay ) states.push("Looking to Play");
else if( steam.users[id].persona_state == Steam.EPersonaState.LookingToTrade ) states.push("Looking to Trade");
else states.push("Offline");
} else {
if( steam.myFriends[id] == Steam.EFriendRelationship.RequestRecipient ) states.push("Added you as a friend");
else if ( steam.myFriends[id] == Steam.EFriendRelationship.Ignored ) states.push("Blocked");
else states.push("??");
}
});
client.on('loggedOn', function () {
log.info('Logged onto Steam!');
if (started) {
client.gamesPlayed([require('../package.json').name, 440]);
client.setPersona(SteamUser.EPersonaState.Online);
}
});
}
module.exports = function (err, done) {
client.setPersona(SteamUser.EPersonaState.Snooze);
listingManager.actions.create = [];
if (listingManager.ready !== true || (listingManager.listings.length === 0 && listingManager._processingActions !== true)) {
checkFiles();
return;
}
listingManager.listings.forEach((listing) => listing.remove());
listingManager.on('actions', onActions);
function onActions (actions) {
if (actions.remove.length === 0) {
log.debug('Done removing listings');
listingManager.removeListener('actions', onActions);
try {
nicks.push(emojiStrip(steam.users[id].player_name));
} catch(e) {
nicks.push(id);
}
steamids.push(id);
if( steam.myFriends[id] == Steam.EFriendRelationship.Friend ){
if( steam.users[id].persona_state == Steam.EPersonaState.Offline ) states.push("Offline");
else if( steam.users[id].persona_state == Steam.EPersonaState.Online ) states.push("Online");
else if( steam.users[id].persona_state == Steam.EPersonaState.Busy ) states.push("Busy");
else if( steam.users[id].persona_state == Steam.EPersonaState.Away ) states.push("Away");
else if( steam.users[id].persona_state == Steam.EPersonaState.Snooze ) states.push("Snooze");
else if( steam.users[id].persona_state == Steam.EPersonaState.LookingToPlay ) states.push("Looking to Play");
else if( steam.users[id].persona_state == Steam.EPersonaState.LookingToTrade ) states.push("Looking to Trade");
else states.push("Offline");
} else {
if( steam.myFriends[id] == Steam.EFriendRelationship.RequestRecipient ) states.push("Added you as a friend");
else if ( steam.myFriends[id] == Steam.EFriendRelationship.Ignored ) states.push("Blocked");
else states.push("??");
}
});