hello,
after about 24 hours, maybe little more, my session of the steam-tradeoffer-manager always expires. so when a trade should be sent, it shows the error "Not Logged In", afterwards "sessionExpired" (Error: HTTP error 401) gets fired and and new cookies will be set with "webSession". looks fine for me. but when a second trade offer should be sent after a few minutes, its always getting the same error: "Not logged in". and everythign happens again. its basically an endless loop which never ends. what im doing wrong?
var client = new SteamUser({
localAddress: config.ip
})
var community = new SteamCommunity({
localAddress:config.ip
});
var manager = new TradeOfferManager({
"steam": client,
"community": community,
"domain": "localhost",
"language": "en",
"cancelTime": 300000,
"pendingCancelTime": 120000
});
client.logOn({
accountName: config.username,
password: config.password,
twoFactorCode: SteamTotp.generateAuthCode(twoFactorData.shared_secret)
});
client.on('loggedOn', function() {
console.log("Logged into Steam");
client.setPersona(SteamUser.EPersonaState.Online);
client.requestFreeLicense(config.games, function() {
client.gamesPlayed(config.games);
});
});
client.on('webSession', function(sessionID, cookies) {
console.log('New Session');
manager.setCookies(cookies, function(err) {
if (err) {
console.log('webSession: '+err);
throw err;
}
});
community.setCookies(cookies);
});
community.on('sessionExpired', function(err) {
if (err) {
console.log('sessionExpired: '+err);
}
client.webLogOn();
});