TheMaster Posted August 8 Report Posted August 8 Is there any flag that shows that there is an ongoing attempt to logon by steam user if the auto relogin is set to true? Any flag or property Quote
Dr. McKay Posted August 9 Report Posted August 9 There isn't, but you could fairly easily keep track of it yourself. When you call logOn or disconnected is emitted, it's attempting to reconnect. Quote
TheMaster Posted August 9 Author Report Posted August 9 oooo i made a flag my self when i called log on i set the "loggingon" flag to true and when the the loggon emitted i set the flag to false but didnt used the disconnected event handler to set a flag also i have some improvements to the logon function if u will consider them , what i did is i emitted and error in case of dupe logon request and returned the function this will prevent a fatal error and a crash ifu have thoughts about it lmk 7 hours ago, Dr. McKay said: There isn't, but you could fairly easily keep track of it yourself. When you call logOn or disconnected is emitted, it's attempting to reconnect. logOn(details) { // Delay the actual logon by one tick, so if users call logOn from the error event they won't get a crash because // they appear to be already logged on (the steamID property is set to null only *after* the error event is emitted). // Go ahead and create the Error now, so that we'll have a useful stack trace if we need to throw it. let alreadyLoggedOnError = new Error('Already logged on, cannot log on again'); let alreadyConnectingError = new Error('Already attempting to log on, cannot log on again'); process.nextTick(async () => { if (this.steamID) { console.log('Error: Already logged on'); this.emit('error', alreadyLoggedOnError); return; } if (this._connecting) { console.log('Error: Already attempting to log on'); this.emit('error', alreadyConnectingError); return; } this.steamID = null; this._cancelReconnectTimers(); this._initProperties(); this._connecting = true; this._loggingOff = false; Quote
Dr. McKay Posted August 10 Report Posted August 10 That's not a valid solution because consumer code that (correctly) calls logOn in response to an error event will enter an infinite loop. Quote
TheMaster Posted September 1 Author Report Posted September 1 (edited) fixed for now i guess Edited September 1 by TheMaster 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.