Jump to content
McKay Development

Recommended Posts

Posted

I have a problem restoring cookies after a Bot looses its webSession.

I call SteamUser.webLogOn but don't get an webSession callback at all.
Currently I have 3 Bots running parallel on the same host. After about 1-2 days (sometimes even 7 days!) one of the three won't get a webSession ever again. The other 2 still run great and webSession fires normally for them.
I setup a cronJob which refreshes the Login and calls webLogOn every hour and I also call it on sessionExpired.

I logged the client error output but it won't throw any error.

 

Code: https://pastebin.com/jYaDE45x

 

Log

26-07-2017 21:23:05: STEAMBOT Steam session expired: xx - Error: Not Logged In
26-07-2017 21:23:05: STEAMBOT Refreshing Bot Login - xxxx - xx last try: 1385.8219997882843s ago
26-07-2017 21:23:05: STEAMBOT calling webLogOn - xxxx - xx isLoggedIn=false
27-07-2017 00:00:00: STEAMBOT Refreshing Bot Login - xxxx - xx last try: 9414.178000211716s ago
27-07-2017 00:00:00: STEAMBOT calling webLogOn - xxxx - xx isLoggedIn=false
27-07-2017 03:00:00: STEAMBOT Refreshing Bot Login - xxxx - xx last try: 10799.992999792099s ago
27-07-2017 03:00:00: STEAMBOT calling webLogOn - xxxx - xx isLoggedIn=false
27-07-2017 06:00:00: STEAMBOT Refreshing Bot Login - xxxx - xx last try: 10800.00100016594s ago
27-07-2017 06:00:00: STEAMBOT calling webLogOn - xxxx - xx isLoggedIn=false
Posted

I think you wrong this : 

if (this._client.steamID !== null) { ...}

i'm not sure but i think you can try with 

this._community.on("sessionExpired", function(err) { 
  this._client.webLogOn();
}
Posted

 

I think you wrong this : 

if (this._client.steamID !== null) { ...}

i'm not sure but i think you can try with 

this._community.on("sessionExpired", function(err) { 
  this._client.webLogOn();
}

That's what I'm doing in refreshLogin()...

 

I check if steamUser is still connected and calling webLogOn.. I just don't get a Session after that...

    if (this._client.steamID !== null) {
      console.log('STEAMBOT calling webLogOn - ' + this._steamid + ' - ' + this._user + ' isLoggedIn=' + this._isLoggedIn);
      this._client.webLogOn();
    }
  • 3 months later...
Posted

I still have that issue.. I need to restart my Script after a while because the bots stop to relog after a day or two...

I get Steam session expired - Error: Not Logged In, then I'm calling webLogOn but don't get a webSession...

Posted (edited)

 

I check if steamUser is still connected and calling webLogOn.. I just don't get a Session after that...

    if (this._client.steamID !== null) {
      console.log('STEAMBOT calling webLogOn - ' + this._steamid + ' - ' + this._user + ' isLoggedIn=' + this._isLoggedIn);
      this._client.webLogOn();
    }

 

use this?

if (err) {
   console.log('STEAMBOT calling webLogOn - ' + this._steamid + ' - ' + this._user + ' isLoggedIn=' + this._isLoggedIn);
   this._client.webLogOn();
}
Edited by Vanilla

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...