From f8b78aaf89d93cef51e7ec5144f62f91f8dd9943 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sat, 8 Aug 2026 00:46:08 -0700 Subject: [PATCH] docs: say why an auth id is released, accurately The release caps a connection at one live id. It is not "the player went back to the server list" -- choosing a server queues a disconnect that is never cancelled, so a real client cannot get back there. The reachable case is a client pipelining another seed/login/select into the same recv buffer before the queue is drained. Co-Authored-By: Claude Opus 5 (1M context) --- .../UOContent.Tests/Tests/Network/Packets/AuthIdTests.cs | 5 ++--- .../UOContent/Network/Packets/IncomingAccountPackets.cs | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Projects/UOContent.Tests/Tests/Network/Packets/AuthIdTests.cs b/Projects/UOContent.Tests/Tests/Network/Packets/AuthIdTests.cs index 799651beb..aecf8b9ef 100644 --- a/Projects/UOContent.Tests/Tests/Network/Packets/AuthIdTests.cs +++ b/Projects/UOContent.Tests/Tests/Network/Packets/AuthIdTests.cs @@ -196,9 +196,8 @@ public class AuthIdTests : IDisposable } /// - /// Picking a second server on the same connection orphans the first id -- the NetState now - /// holds the new one, so nothing will ever redeem the old. It goes immediately rather than - /// waiting to time out. + /// A connection is capped at one live id. NetState.AuthId only holds the newest, so any id it + /// replaces goes immediately rather than sitting in the window with nothing coming for it. /// [Fact] public void ReleasingAnIdMakesItUnredeemableImmediately() diff --git a/Projects/UOContent/Network/Packets/IncomingAccountPackets.cs b/Projects/UOContent/Network/Packets/IncomingAccountPackets.cs index 2d9cec12b..79fb67b99 100644 --- a/Projects/UOContent/Network/Packets/IncomingAccountPackets.cs +++ b/Projects/UOContent/Network/Packets/IncomingAccountPackets.cs @@ -348,9 +348,10 @@ public static class IncomingAccountPackets private static int GenerateAuthID(this NetState state) { - // Picking a second server on the same connection orphans the first id: state.AuthId now - // holds the new one, so nothing is coming to redeem the old. Drop it now instead of leaving - // it to time out. + // Caps a connection at one live id. Choosing a server queues a disconnect, but the queue is + // drained on the next slice, so a client that pipelines another seed/login/select into the + // same buffer gets here again -- and state.AuthId only holds the newest, so the previous id + // would sit in the window until it timed out with nothing coming to redeem it. ReleaseAuthId(state.AuthId); return RegisterAuthId(state.Account, state.Address, state.Version);