|
|
|
@ -67,6 +67,8 @@ function calculate(offer) { |
|
|
|
return seconds > 0; |
|
|
|
} |
|
|
|
|
|
|
|
let exit_counter = 0; |
|
|
|
|
|
|
|
function setupClient() { |
|
|
|
const config = require("./auth_data/auth.json") |
|
|
|
/////////////////////////////////////////////////////////////////
|
|
|
|
@ -115,8 +117,15 @@ function setupClient() { |
|
|
|
|
|
|
|
///////////watchdog/////////////
|
|
|
|
setInterval(() => { |
|
|
|
if (!client.steamID) {} |
|
|
|
if (!client.steamID) { |
|
|
|
exit_counter++; |
|
|
|
if (exit_counter >= 5) { |
|
|
|
console.log(consoleTime(), "Connect is dead"); |
|
|
|
process.exit(2); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
exit_counter = 0; |
|
|
|
if (process.env.ALIVE_PUSH) { |
|
|
|
const inst = axios.create({httpsAgent: new https.Agent({rejectUnauthorized: false})}) |
|
|
|
inst.get(process.env.ALIVE_PUSH).then(() => {}).catch(() => {}) |
|
|
|
|