Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions MinecraftClient/McClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ public void Transfer(string newHost, int newPort)

ResetStateForTransfer();

// Snapshot cookies before Dispose clears them
Dictionary<string, byte[]> savedCookies = new Dictionary<string, byte[]>(Cookies);

// Retire the old handler so its updater exits without reporting a stale disconnect.
oldHandler.Dispose();
oldClient.Close();
Expand All @@ -457,6 +460,7 @@ public void Transfer(string newHost, int newPort)

// Reinitialize the protocol handler
handler = Protocol.ProtocolHandler.GetProtocolHandler(client, protocolversion, null, this);
Cookies = savedCookies; // Restore cookies for the new connection before login
Log.Info($"Connected to {resolvedHost}:{resolvedPort}");

// Retry login process
Expand Down