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) <noreply@anthropic.com>
This commit is contained in:
parent
6a5f67d3d4
commit
f8b78aaf89
2 changed files with 6 additions and 6 deletions
|
|
@ -196,9 +196,8 @@ public class AuthIdTests : IDisposable
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ReleasingAnIdMakesItUnredeemableImmediately()
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue