Jump to content
McKay Development

Steamuser.LogOff


Recommended Posts

when i call steamuser.logOff() will the disconnected event trigger? So if i wanna relog when steam user is on error or session expired i can just logoff and than write in the discconnected callback login?

like this:

    this.client.on('error',(err=>{
      console.log("Client emitted Error: "+err,colors.FgRed,this.bot_number)
      this.client.logOff()
    })
 
    this.community.on("sessionExpired", ()=>{
      console.log("Session Expired",colors.FgRed,this.bot_number)
      if (this.client.steamID == null) {
          client.logOn(logOptions);
      } else {
        this.client.logOff()
    }
  })
 
    this.client.on("disconnected",(eresultmsg)=>{
      console.log("Client emitted disconnected: " + eresult +" msg: "+msg ,colors.FgWhite,this.bot_number)
      if (this.client.steamID == null) {
          client.logOn(logOptions);
      } else { 
        this.client.logOff()
        }

 

So that if the bots loggs of it immediately loggs back in?

 

 

Link to post
Share on other sites

Yes, but:

  1. You shouldn't relog your client connection if your web session expires. Just call webLogOn()
  2. Calling logOff() in the error event listener is going to cause an error; if error gets emitted you're already disconnected (same applies to the disconnected listener)
  3. steamID is never going to be null in the disconnected event listener
Link to post
Share on other sites

Okay thanks for your help. But the your first point, i have read this post 

and i had the feeling that i had the same issues, because when websession ist emitted it should log "New cookies" or somethink like that but it never happened it logged "session expired" when session expired was emitted but never got the new cookies but i will take a look and try it again. Thank you so much for your help 

Link to post
Share on other sites

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...