OnDisconnect: Call AutoRelog last (#1517)

Call AutoRelog last to leave other bots time to perform cleanup
This commit is contained in:
ORelio 2021-04-18 18:44:02 +02:00
parent 239900451d
commit 663d617ef6

View file

@ -531,7 +531,11 @@ namespace MinecraftClient
throw new InvalidOperationException(Translations.Get("exception.user_logout"));
}
foreach (ChatBot bot in bots.ToArray())
//Process AutoRelog last to make sure other bots can perform their cleanup tasks first (issue #1517)
List<ChatBot> onDisconnectBotList = bots.Where(bot => !(bot is AutoRelog)).ToList();
onDisconnectBotList.AddRange(bots.Where(bot => bot is AutoRelog));
foreach (ChatBot bot in onDisconnectBotList)
{
try
{