Skip to content

Commit

Permalink
Disable auto-start after a stop command is issued
Browse files Browse the repository at this point in the history
  • Loading branch information
Citrinate committed Mar 30, 2024
1 parent ccd056b commit d6061d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CS2Interface/Handlers/ClientHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ internal static void AddHandler(Bot bot, CallbackManager callbackManager) {
}

internal string Stop() {
// The user has decided to stop the interface

if (!Bot.IsConnectedAndLoggedOn) {
return ArchiSteamFarm.Localization.Strings.BotNotConnected;
}
Expand All @@ -80,13 +82,16 @@ internal string Stop() {
}

Client.Stop();
CS2Interface.AutoStart[Bot.BotName] = false;
Bot.Actions.Resume();
Bot.ArchiLogger.LogGenericInfo(Strings.InterfaceStopped);

return Strings.InterfaceStoppedSuccessfully;
}

internal void ForceStop() {
// The interface has decided to stop itself

EClientStatus status = Client.Status();
bool connected = ((status & EClientStatus.Connected) == EClientStatus.Connected);
if (connected) {
Expand Down

0 comments on commit d6061d1

Please sign in to comment.