seishun / node-steam

Interface directly with Steam servers from Node.js
MIT License
1k stars 180 forks source link

stops #435

Closed bitstuckhere closed 6 years ago

bitstuckhere commented 6 years ago

Hi

I run two bots, one with email authentication and one with mobile authentication.

Over the last 3 days, around 5 times now my bots have gone offline with error 20 which I assume is steam updates. But when I look at bots other people have made, they don't stop and I think it's because they aren't using this API but a newer one.

Does this API not support reconnecting after steam updates? If so, how should I implement this for both of my bots? Thanks

seishun commented 6 years ago

20 is ServiceUnavailable, which is normal. Just keep reconnecting.

bitstuckhere commented 6 years ago

Thanks for the fast reply. When you say, just keep reconnecting, I have been doing that (Manually) but it's really frustrating when I wake up and they're offline (And have been for 10+ hours) and I have to get my auth code out again and restart it. Is there a way to keep it running automatically after error 20?

seishun commented 6 years ago

If you're using Steam Guard, you can specify sha_sentryfile when logging in to avoid having to specify auth_code, see https://github.com/seishun/node-steam/wiki/Protobufs#cmsgclientlogon. No clue about two-factor auth, I don't use it in my bots.

bitstuckhere commented 6 years ago

Yes that is what I have been doing with my email bot, it's the mobile bot that is the problem because it loses its login session and dies on error 20 and then has no way to reconnect automatically because it requires the mobile two-factor auth code to re-log in. Other bots aren't affected by this though - they don't even go offline so they must use a different API that handles the event differently(?) Either that or I need to do something different which is where I wasn't sure

seishun commented 6 years ago

If the Steam server goes offline, the bot will go offline and will need to reconnect (manually or automatically), there's no way around it.

There's https://github.com/DoctorMcKay/node-steam-totp but I haven't used it. You might want to ask in https://github.com/steam-forward/node-steam-forum

scholtzm commented 6 years ago

If your bot uses 2FA, then you should definitely generate those authentication codes on the fly. The library linked in the comment above is simple to use and can help you automate the process.