|
|
|
@ -7,6 +7,9 @@ var trade_checker = new trade_checker_imp(); |
|
|
|
const VERSION = require("./version"); |
|
|
|
var SteamTradeOfferManager = require('steam-tradeoffer-manager'); |
|
|
|
|
|
|
|
const axios = require("axios"); |
|
|
|
const https = require('https'); |
|
|
|
|
|
|
|
const consoleTime = () => { |
|
|
|
return (new Date()).toLocaleString(); |
|
|
|
} |
|
|
|
@ -106,7 +109,20 @@ function setupClient() { |
|
|
|
|
|
|
|
console.log(consoleTime(), 'connection error\n'); |
|
|
|
console.log(consoleTime(), error); |
|
|
|
//client.relog();
|
|
|
|
}); |
|
|
|
|
|
|
|
///////////watchdog/////////////
|
|
|
|
setInterval(() => { |
|
|
|
if (!client.steamID) {} |
|
|
|
else { |
|
|
|
if (process.env.ALIVE_PUSH) { |
|
|
|
const inst = axios.create({httpsAgent: new https.Agent({rejectUnauthorized: false})}) |
|
|
|
inst.get(process.env.ALIVE_PUSH).then(() => {}).catch(() => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, 60 * 1000); |
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
manager.on('newOffer', function(offer) { |
|
|
|
console.log(consoleTime(), `[${offer.id}] Incoming trade from ${offer.partner.getSteamID64()}`); |
|
|
|
|