Class TokenAccountManager<TConnection>
- Namespace
- FishMMO.Auth.Implementation
- Assembly
- FishMMO-ServerAuth.dll
Token-specific account manager for World and Scene server authentication. Extends AccountManager<TConnection> with a simplified connection account creation method that does not require SRP state.
public class TokenAccountManager<TConnection> : AccountManager<TConnection>, ITokenAccountManager<TConnection>, IAccountManager<TConnection>
Type Parameters
TConnectionThe type representing a network connection.
- Inheritance
-
AccountManager<TConnection>TokenAccountManager<TConnection>
- Implements
-
ITokenAccountManager<TConnection>IAccountManager<TConnection>
- Derived
- Inherited Members
Constructors
TokenAccountManager(Func<TConnection, string>, string)
Initializes a new TokenAccountManager.
public TokenAccountManager(Func<TConnection, string> getConnectionId, string logPrefix = "TokenAccountManager")
Parameters
getConnectionIdFunc<TConnection, string>Delegate that returns a diagnostic identifier for a connection (e.g., client ID).
logPrefixstringPrefix used in diagnostic log messages.
Methods
AddConnectionAccount(TConnection, string, AccessLevel)
Registers account name and access level for a token-authenticated connection. Updates the existing AccountData (created at handshake time) with the resolved access level. The connection is not untracked from the unauthenticated timer here — that happens when Authenticated is reached via TryAdvanceAuthState(TConnection, AuthState, AuthState).
public void AddConnectionAccount(TConnection connection, string accountName, AccessLevel accessLevel)
Parameters
connectionTConnectionThe network connection.
accountNamestringThe account name.
accessLevelAccessLevelThe access level for the account.
Exceptions
- InvalidOperationException
Thrown when no AccountData exists for the connection, indicating the handshake path was skipped or the connection was purged.