Table of Contents

Interface ISrpAccountManager<TConnection>

Namespace
FishMMO.Auth.Core
Assembly
FishMMO-ServerAuth.dll

Extended account manager interface for SRP-based authentication on the LoginServer. Adds SRP-specific connection account creation with SRP data, and periodic sweep of stale unauthenticated connections. Auth state machine methods (TryAdvanceAuthState, HasAuthState) live on the base IAccountManager<TConnection> interface.

public interface ISrpAccountManager<TConnection> : IAccountManager<TConnection>

Type Parameters

TConnection

The type representing a network connection.

Inherited Members

Methods

AddConnectionAccount(TConnection, string, string, string, string, AccessLevel, bool)

Populates SRP authentication data on an existing connection's AccountData. The connection must already have AccountData in VerifyPending state (created at handshake time). On success, advances the state to WaitingForProof.

bool AddConnectionAccount(TConnection connection, string accountName, string publicClientEphemeral, string salt, string verifier, AccessLevel accessLevel, bool isUnverified = false)

Parameters

connection TConnection

The network connection.

accountName string

The account name.

publicClientEphemeral string

The public ephemeral value from the client.

salt string

The salt for SRP.

verifier string

The verifier for SRP.

accessLevel AccessLevel

The access level for the account.

isUnverified bool

Returns

bool

true if SRP data was set and state advanced; false if the connection was not in the expected state.

ClearSrpState(TConnection)

Clears SRP state for a connection while preserving account mappings and access level. Calls ServerSrpData.Clear to null sensitive string references, then nulls the SrpData reference itself. Use this after SRP success to remove sensitive SRP material from memory.

void ClearSrpState(TConnection connection)

Parameters

connection TConnection

The connection whose SRP state will be cleared.

SweepUnauthenticatedConnections(TimeSpan, Func<TConnection, bool>, int, int)

Sweeps and removes stale unauthenticated connection state to bound SRP/encryption memory growth. Authenticated connections are only untracked from the unauthenticated timer map.

int SweepUnauthenticatedConnections(TimeSpan maxUnauthenticatedAge, Func<TConnection, bool> isAuthenticated, int maxScan, int maxRemovals)

Parameters

maxUnauthenticatedAge TimeSpan

Maximum allowed age for unauthenticated state.

isAuthenticated Func<TConnection, bool>

Connection authentication predicate.

maxScan int

Maximum tracked entries to evaluate this sweep.

maxRemovals int

Maximum stale entries to purge this sweep.

Returns

int

Number of stale unauthenticated entries purged.