mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Merge pull request #3187 from MCCTeam/fix/configuration-disconnect-reason
fix: preserve queued disconnect reason
This commit is contained in:
commit
92212d2b95
1 changed files with 4 additions and 1 deletions
|
|
@ -304,7 +304,10 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
{
|
{
|
||||||
Stopwatch stopWatch = Stopwatch.StartNew();
|
Stopwatch stopWatch = Stopwatch.StartNew();
|
||||||
long nextUpdateDue = 0;
|
long nextUpdateDue = 0;
|
||||||
while (!packetQueue.IsAddingCompleted)
|
// Continue until the reader has finished and every queued packet has been handled.
|
||||||
|
// A server can close immediately after a Disconnect packet, completing the queue
|
||||||
|
// while that final packet is still waiting to be processed.
|
||||||
|
while (!packetQueue.IsCompleted)
|
||||||
{
|
{
|
||||||
cancelToken.ThrowIfCancellationRequested();
|
cancelToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue