Table of Contents

Class Authentication

Namespace
FishMMO.Shared
Assembly
FishMMO-SharedUtility.dll

Centralized authentication and naming rules shared across all projects.

public static class Authentication
Inheritance
Authentication
Inherited Members

Fields

AccountNameMaxLength

Maximum length for account usernames.

public const int AccountNameMaxLength = 32

Field Value

int

AccountNameMinLength

Minimum length for account usernames.

public const int AccountNameMinLength = 3

Field Value

int

AccountPasswordMaxLength

Maximum length for account passwords.

public const int AccountPasswordMaxLength = 32

Field Value

int

AccountPasswordMinLength

Minimum length for account passwords.

public const int AccountPasswordMinLength = 8

Field Value

int

CharacterNameMaxLength

Maximum length for character names.

public const int CharacterNameMaxLength = 24

Field Value

int

CharacterNameMinLength

Minimum length for character names.

public const int CharacterNameMinLength = 3

Field Value

int

GuildNameMaxLength

Maximum length for guild names.

public const int GuildNameMaxLength = 32

Field Value

int

GuildNameMinLength

Minimum length for guild names.

public const int GuildNameMinLength = 3

Field Value

int

InvalidCharacterNameError

Error message for invalid character names.

public static readonly string InvalidCharacterNameError

Field Value

string

InvalidGuildNameError

Error message for invalid guild names.

public static readonly string InvalidGuildNameError

Field Value

string

InvalidPasswordError

Error message for invalid passwords.

public static readonly string InvalidPasswordError

Field Value

string

InvalidUsernameError

Error message for invalid usernames.

public static readonly string InvalidUsernameError

Field Value

string

Methods

IsAddressValid(string)

Validates an IP Address, Hostname, or URI. Handles port stripping (e.g. 127.0.0.1:7770) before validation.

public static bool IsAddressValid(string address)

Parameters

address string

Returns

bool

IsAllowedCharacterName(string)

Validates a character name against length constraints and the letters-and-single-spaces regex pattern.

public static bool IsAllowedCharacterName(string characterName)

Parameters

characterName string

Returns

bool

IsAllowedEmailUsername(string)

Validates an email address against the email regex pattern. Returns false for null/empty/whitespace input.

public static bool IsAllowedEmailUsername(string email)

Parameters

email string

Returns

bool

IsAllowedGuildName(string)

Validates a guild name against length constraints and the alphanumeric-with-spaces regex pattern.

public static bool IsAllowedGuildName(string guildName)

Parameters

guildName string

Returns

bool

IsAllowedPassword(string)

Validates an account password against length constraints and the allowed-special-characters regex pattern.

public static bool IsAllowedPassword(string accountPassword)

Parameters

accountPassword string

Returns

bool

IsAllowedUsername(string)

Validates an account username against length constraints and the alphanumeric+underscore regex pattern.

public static bool IsAllowedUsername(string accountName)

Parameters

accountName string

Returns

bool

NormalizeAccountLookup(string)

Produces the canonical lookup form of an account name for case-insensitive comparisons against the persisted name_lowercase column and any in-memory rate-limit / lockout dictionaries keyed by username. Trims leading/trailing whitespace, applies Unicode NFKC normalisation so visually-equivalent confusables collapse, and lower-cases under the invariant culture so e.g. a Turkish locale cannot bypass a lockout via I vs i mapping. Returns the empty string for null input so callers do not need null-guards.

public static string NormalizeAccountLookup(string accountName)

Parameters

accountName string

Returns

string