mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
fix: Add cookie snapshotting for connection transfer
Add cookie snapshotting for connection transfer
This commit is contained in:
commit
bff5ee769c
1 changed files with 4 additions and 0 deletions
|
|
@ -442,6 +442,9 @@ namespace MinecraftClient
|
|||
|
||||
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();
|
||||
|
|
@ -457,6 +460,7 @@ namespace MinecraftClient
|
|||
|
||||
// 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue