I occasionally get this error after my program runs for 12-24 hours.
I only have 3 different calls to the logOn method and they are all in this format:
client.logOff();
setTimeout(function() {
if(client.steamID)
return;
client.logOn({
accountName: 'username',
password: 'password',
twoFactorCode: SteamTotp.generateAuthCode(sharedSecret),
logonID: parseInt(111111111 * Math.random())
})
}, 5000)
I read on other posts regarding this error that the logOn should be delayed after the logOff is called and that if client.steamID exists, it means it should already be logged in so I return when the steamID property exists. This hasn't solved my error and I still receive this which exits the process.
E:\projects\steambot\node_modules\steam-user\components\logon.js:23
throw new Error("Already logged on, cannot log on again");
^
Error: Already logged on, cannot log on again
at E:\projects\steambot\node_modules\steam-user\components\logon.js:23:10
at processTicksAndRejections (node:internal/process/task_queues:77:11)
What would be my best solution to fix this error? I don't think wrapping the logOn calls in a try-catch block would be sufficient but I could be wrong.