Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sessionReplaceCount++;
if (sessionReplaceCount > 0) {
log.warn('Detected login session replace loop, stopping bot...');
handlerManager.getHandler().shutdown(err, true);
return;
}
log.warn('Login session replaced, relogging...');
require('app/login')(null, function (err) {
if (err) {
throw err;
}
});
} else if (err.eresult === SteamUser.EResult.LoggedInElsewhere) {
log.warn('Signed in elsewhere, stopping the bot...');
handlerManager.getHandler().shutdown(err, true);
} else {
throw err;
}
}
steam.joinChat(mc[1], (res) => {
if( res != Steam.EResult.OK ) return webhook.send("Could not join that chat room: " + resolveCode(Steam.EResult, res));
});
} catch(e){
function errorEvent (err) {
if (err.eresult === SteamUser.EResult.LogonSessionReplaced) {
sessionReplaceCount++;
if (sessionReplaceCount > 0) {
log.warn('Detected login session replace loop, stopping bot...');
handlerManager.getHandler().shutdown(err, true);
return;
}
log.warn('Login session replaced, relogging...');
require('app/login')(null, function (err) {
if (err) {
throw err;
}
});
} else if (err.eresult === SteamUser.EResult.LoggedInElsewhere) {