Scary Santa Claus / get away from me fat man! / traumatized children
6
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Lataa
"// maybe merge this ♥♥♥♥ into the singular listernes blah blah
// its all convulted and will beconfused more if I need to use webSession event to deal with logouts
// it exists to not have a sessionExpired always happen at first time
// could maybe try a later event then I dont need this horrible function
this.user.on('accountLimitations', (limited, communityBanned, locked, canInviteFriends) => {
this.user.setPersona(SteamUser.EPersonaState.LookingToPlay);
this.user.setUIMode(SteamUser.EClientUIMode.BigPicture);
this.user.getSteamLevels([this.user.steamID], (results) => {
this.friends_level = results[this.user.steamID];
this.friends_max = 2000 - ((350 - Math.min(350, this.friends_level)) * 5);
if (login_count == 0 || login_count == accounts.length+1 || communityBanned || locked) {
this.log('SESSION | loggedOn: '+ ("https://steamproxy.net/" + this.profile_url()).yellow
+ " | " + this.friends_level + "^" + this.friends_max + "="
+ (limited + "/" + communityBanned + "/" + locked).replace(
/true/g, '1'.red).replace(/false/g, '0'.green));
}});});
if (this.user.limitations) {
return finish(this);
}
this.user.once('accountLimitations', (limited, communityBanned, locked, canInviteFriends) => {
this.user.limitations = { limited: limited };
// XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX #
} else if (err) {
if (response.statusCode.toString() == '400'
|| response.statusCode.toString() == '302') {// XXX should it really retry all of 302?
// then its on too deciding to prempt logins for bots and/or deal with initial all comments
// if im prempting I can do it here? can then it will get caught on randmomized?
return setTimeout(() => {
this.http_request(endpoint, data, callback, method, json, retries+1);
}, 1000);
}
result = "FAILURE" + " | " + result + ("=" + err.message).yellow;
// XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX # im letting these next ones slide, like rateups
} else if (body && typeof body.success != 'undefined' && body.success != 1) {
var error = (body.error) ? body.error.replace(/ /g, '').substr(0,30) : SteamCommunity.EResult[body.success];
console.log(error);
console.log(body.success);
// ok this is a lighter steam error, and it can sometimes be NotLoggedOn
// I might need to manually webLogOn? but maybe only for some calls?
// if I do that, am I gonna retry?.....no....
result = "FAILURE" + " | " + result + ("=" + error).yellow;
// XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX #
// consider nuking this... or making it not run on endlessly., no I kinda need it to nto waste an opportunity to post
// a: remove it for its own sake: less calls, less 429's ------------------
// b: fix it with a better check other than text area (it still would have to relogin somehow...
// C: fix it in shared somehow? (it wont auto retry because it doesnt error out) if it containes g_steamID = false, need to relogin
} else if (body && body.toString().indexOf("g_steamID = false;") > -1) {
result = "FAILURE" + " | " + result + "=SteamIDIsFalse".yellow;
// XXX relogin, retry? functoinization, let it fail for now
// XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX #"
1 kommenttia
Simon 6.10.2018 klo 8.41 
Dafuq?