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]");
}
running = false;
AutoRestartLoginTimer.Stop();
if (AutoRestartLoginTimer != null)
{
AutoRestartLoginTimer.Stop();
AutoRestartLoginTimer = null;
}
ResetClient();
}
@ -87,7 +91,11 @@ namespace SecondBotEvents.Services
protected void BotSimConnected(object o, SimConnectedEventArgs e)
{
AutoRestartLoginTimer.Stop();
if (AutoRestartLoginTimer != null)
{
AutoRestartLoginTimer.Stop();
AutoRestartLoginTimer = null;
}
goodticks = 0;
LogFormater.Info("Client service ~ Connected to sim: "+e.Simulator.Name);
}