fix a bug in recovery

This commit is contained in:
Madpeter 2025-06-25 10:23:10 +01:00
parent 5c69da371a
commit 28ad4d1fde

View file

@ -75,7 +75,11 @@ namespace SecondBotEvents.Services
LogFormater.Info("Client service [Stopping]"); LogFormater.Info("Client service [Stopping]");
} }
running = false; running = false;
if (AutoRestartLoginTimer != null)
{
AutoRestartLoginTimer.Stop(); AutoRestartLoginTimer.Stop();
AutoRestartLoginTimer = null;
}
ResetClient(); ResetClient();
} }
@ -86,8 +90,12 @@ namespace SecondBotEvents.Services
} }
protected void BotSimConnected(object o, SimConnectedEventArgs e) protected void BotSimConnected(object o, SimConnectedEventArgs e)
{
if (AutoRestartLoginTimer != null)
{ {
AutoRestartLoginTimer.Stop(); AutoRestartLoginTimer.Stop();
AutoRestartLoginTimer = null;
}
goodticks = 0; goodticks = 0;
LogFormater.Info("Client service ~ Connected to sim: "+e.Simulator.Name); LogFormater.Info("Client service ~ Connected to sim: "+e.Simulator.Name);
} }