Ben Posted November 27, 2020 Report Posted November 27, 2020 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",(eresult, msg)=>{ 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? Quote
Dr. McKay Posted November 28, 2020 Report Posted November 28, 2020 Yes, but: You shouldn't relog your client connection if your web session expires. Just call webLogOn() 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) steamID is never going to be null in the disconnected event listener Quote
Ben Posted November 29, 2020 Author Report Posted November 29, 2020 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 Quote
Recommended Posts
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.