GDA
-
Posts
11 -
Joined
-
Last visited
Posts posted by GDA
-
-
Hi all! How do i track 15 days delay to user trade offer? (if because of user current trade will be hold for 15 days)
-
Up theme, can someone help me?
-
Don't reconnect as a result of
disconnected
. As per the documentation (please read it!), it will automatically reconnect as long as you haven't explicitly disabled that feature (and even then, if I remember correctly it should emiterror
instead ofdisconnected
).Why are you waiting 15 seconds to relog after your session expires? You can safely do it immediately.
As previously suggested, you should keep track of when you last tried to relog and throttle it to avoid spamming logins.
Checking
isOurOffer
inside ofnewOffer
is unnecessary; it will only be emitted for new incoming offers.Sorry, i read docs. Thanks. Also i changed my code, you can see it http://pastebin.com/jG62XM8u here. Now i got limiter and still have this issue.
Upd. Maybe u need to know my bot is working under pm2 process manager.
-
Sorry but I'm still having this issues. Full code here http://pastebin.com/t5jNbdUw
-
If there are 3 requests in flight when your session expires and they all fail, then
sessionExpired
could be emitted 3 times, so you'd try to log on 3 times.You don't need to explicitly stop it, no.
Thanks! I'll try it soon, and will write a result:)
-
I dont get it. Why i should rate-limit call to webLogOn if i need to refresh session when it expires?Looks good. You might want to rate-limit calls to webLogOn though, as sessionExpired could be emitted with any frequency.
Also, do i need to stop confirmation checker in case when community gets sessionExpired? or it doesn't matter and i'll not lose any data or callbacks for confirmations?
-
So my final code with solved issues would be looks like:You're already using webSession to call setCookies. That's all you need to do to handle those cookies. Cookies from relogs will also arrive in that event.
The steamcommunity
sessionExpired
event will still work for determining that your cookies have gone bad. Cookies from a SteamUser session will last at most as long as your Steam connection, but Steam has a tendency to kill them whenever it pleases (as with all session cookies).var client = new SteamUser; var steam = new SteamCommunity(); var community = steam; // alias var app = express(); app.listen(app_settings.port, function () { console.log('App is running on ' + app_settings.port); }); var logOnOptions = credentials.getDefault(); client.logOn(logOnOptions); client.on('webSession', function(sessionID, cookies) { community.setCookies(cookies); manager.setCookies(cookies); community.startConfirmationChecker('10000', app_settings.identity_secret); }); client.on('disconnected', function(){ setTimeout(function(){ var logOnOptions = credentials.getDefault(); client.logOn(logOnOptions); }, 10000); }); community.on('sessionExpired', function(err) { community.stopConfirmationChecker(); client.webLogOn(); });
am i right? -
If you need web sessions, SteamUser can do that all for you. If you need fresh cookies, call
user.webLogOn()
.So what my steps?
I need only authenticate SteamUser then put cookies which i'll get from callback to other clients such as steamcommunity?
How can i check that my session/cookies expired?
Are they with the same lifetime?
When i need to stop and start confirmation checker with this conditions?
-
Why are you using SteamUser, but also logging in via SteamCommunity?
Because SteamCommunity starts confirmation checker, and client creates a trade offer. Am i missing something?
-
Hi there. Im developing steam trade-bot but i have one issue during mothes. I need to reboot my server manually because after 1-3 days i got "Error malformed response" or smth like this. I got my code sample, can u say me whats wrong? i'm tired of this
var client = new SteamUser; var steam = new SteamCommunity(); var community = steam; // alias var app = express(); app.listen(app_settings.port, function () { console.log('App is running on ' + app_settings.port); }); var logOnOptions = credentials.getDefault(); client.logOn(logOnOptions); client.on('webSession', function(sessionID, cookies) { community.setCookies(cookies); manager.setCookies(cookies); community.startConfirmationChecker('10000', app_settings.identity_secret); }); client.on('disconnected', function(){ setTimeout(function(){ var logOnOptions = credentials.getDefault(); client.webLogOn(logOnOptions); }, 10000); }); community.on('sessionExpired', function(err) { var logOnOptions = credentials.getDefault(); community.login(logOnOptions, function(err, sessionID, cookies, steamguard){ if (err) { console.log("There was an error logging in! Error details: " + err.message); process.exit(1); //terminates program } else { console.log("Successfully logged in as " + logOnOptions.accountName); steam.chatLogon(); manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); } }); } }); });
15 days tradeoffer delay
in node-steam-tradeoffer-manager
Posted
What attr do i need? As i get, this is not them.escrowDays