Jessecar96 / SteamBot

Automated bot software for interacting with Steam Trade
http://scrap.tf
MIT License
1.33k stars 911 forks source link

Bots stop trying to reconnect #580

Open glen-84 opened 10 years ago

glen-84 commented 10 years ago

See: http://www.reddit.com/r/SteamBot/comments/24xopp/the_bot_will_stop_trying_to_reconnect/ See: http://www.reddit.com/r/SteamBot/comments/26oiq6/how_to_handle_the_case_when_bots_go_offline/

Is there any way to fix this?

BlueRaja commented 10 years ago

Husky (the other user) is hosting his bot on Linux, so can't help debug this issue.

Are you hosting it on Windows? If so, the next time this happens, please attach a debugger (Visual Studio --> Debug --> Attach debugger), hit 'pause', and see what the bot is currently doing.

glen-84 commented 10 years ago

We are on Linux as well.

VaporFan commented 10 years ago

This could help me too because I have the same issue, on Linux, bot doesn't seems to wake up sometimes

Bottswana commented 10 years ago

My bot does this on Linux also. (Mono JIT compiler version 3.8.1 (master/c106cdc Tue Aug 26 13:02:30 BST 2014)

When this happens, the log file spams with 'TryAnotherCM' It looks like the SteamClient is getting stuck authenticating to a steam server that is offline?

scholtzm commented 10 years ago

@Bottswana I was browsing SteamKit repo the other day when I noticed this issue (more of a suggestion actually): SteamRE/SteamKit#69.

In my case (and @glen-84's), there were no messages in the console, it was completely silence. So I'm not sure if it's related or not.

Bottswana commented 10 years ago

Ah that's interesting. I was going to investigate this and implement a way to change CM when this happens. I definitely get bot logouts and have to reboot my bot to fix it, but the TryAnotherCM log entry may just be coincidental. So far is this looking like just a mono/Linux issue? On 8 Sep 2014 17:45, "Michael Scholtz" notifications@github.com wrote:

@Bottswana https://github.com/Bottswana I was browsing SteamKit repo the other day when I noticed this issue (more of a suggestion actually): SteamRE/SteamKit#69 https://github.com/SteamRE/SteamKit/issues/69.

In my case (and @glen-84 https://github.com/glen-84's), there were no messages in the console, it was completely silence. So I'm not sure if it's related or not.

— Reply to this email directly or view it on GitHub https://github.com/Jessecar96/SteamBot/issues/580#issuecomment-54849713.

sy1989 commented 10 years ago

add this in msg.Handle SteamUser.LoggedOnCallback if (callback.Result == SteamKit2.EResult.TryAnotherCM) { Thread.Sleep(5000); SteamClient.Connect(); } i think it will work

Bottswana commented 10 years ago

Dosent really resolve the issue since there's a chance SteamKit will just use the same CM again. I made a patch to SteamKit last night but need to test it On 9 Sep 2014 02:04, "sy1989" notifications@github.com wrote:

add this in msg.Handle if (callback.Result == SteamKit2.EResult.TryAnotherCM) { Thread.Sleep(5000); SteamClient.Connect(); }

— Reply to this email directly or view it on GitHub https://github.com/Jessecar96/SteamBot/issues/580#issuecomment-54910340.

sy1989 commented 10 years ago

@Bottswana just a chance,and when it happen,it reconnect again

Bottswana commented 10 years ago

Looking like my issue was SteamKit related and not the same as yours; I compiled SteamBot against my fork of SteamKit with a patch for blacklisting CM servers and it worked. https://github.com/Bottswana/SteamKit/tree/TestCMUpdate

Bear in mind the new version of SteamKit has breaking changes: https://github.com/Bottswana/SteamBot/commit/f1d93f87f805985fbe749096d61c8de398141e25

I've also noticed that the bot will stop trying to reconnect if anything logs into the Steam account from somewhere else, for example, another user in the steam client, or an instance of the bot elsewhere. Most often when I start the bot locally (accidentally) with the credentials of the bot, the running bot is logged out and does not attempt to reconnect.

Obilux commented 9 years ago

I have this error.http://pastebin.com/UGwrWszZ . http://pastebin.com/VCf3wTnr @BlueRaja @scholtzm @Bottswana Bot goes offline and doesn't try connect i'm running under mono. Who have any idea?

scholtzm commented 9 years ago

I haven't had this issue in a very long time.

Regarding the second pastebin file, perhaps try updating the SteamKit2 dependency in your project. It might be outdated.

Obilux commented 9 years ago

@scholtzm My SteamKit2 is 1.6.2 this is last version a lot of people have this error. http://www.reddit.com/r/SteamBot/comments/2x2x5x/mybot_stop_automatic_reconnect/

FrozenHaxor commented 9 years ago

It works perfectly fine for me. And I run on both mono and windows.

StoneWolf commented 9 years ago

I'm having this issue too, happens nearly every day if not every day. If one of my bots gets a TryAnotherCM error, it won't reconnect until I exit and launch SteamBot again, making me having to restart my bots from time to time, which is not ideal in a production environment. I have everything up-to-date, SteamKit2 at 1.6.2, etc. I'll try to investigate this and will let you know if I find a fix.

Tim572 commented 9 years ago

Having this issue.

up. Trying now with new SteamKit2_1.6.4. Will see if this fixed

Obilux commented 9 years ago

I updated my steamkit.I'll write results in 2 day. Edit I dont get any reconnect problem in 6