mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
Backup bots before unloading on transfer initiation
Added logic to backup current bots before unloading during transfer.
This commit is contained in:
parent
6a5b28b0bd
commit
92ee61b3ce
1 changed files with 6 additions and 0 deletions
|
|
@ -436,6 +436,12 @@ namespace MinecraftClient
|
|||
ResolveTransferAddress(ref resolvedHost, ref resolvedPort);
|
||||
Log.Info($"Initiating a transfer to: {resolvedHost}:{resolvedPort}");
|
||||
|
||||
// Backup current bots before unloading, so they can be restored after successful transfer.
|
||||
if (botsOnHold.Count == 0 && bots.Count > 0)
|
||||
{
|
||||
botsOnHold.AddRange(bots.Where(bot => bot.ScriptOwnerKey is null)); // 保持一致过滤
|
||||
}
|
||||
|
||||
// Unload bots
|
||||
UnloadAllBots();
|
||||
bots.Clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue