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
AccountNameMinLength
Minimum length for account usernames.
public const int AccountNameMinLength = 3
Field Value
AccountPasswordMaxLength
Maximum length for account passwords.
public const int AccountPasswordMaxLength = 32
Field Value
AccountPasswordMinLength
Minimum length for account passwords.
public const int AccountPasswordMinLength = 8
Field Value
CharacterNameMaxLength
Maximum length for character names.
public const int CharacterNameMaxLength = 24
Field Value
CharacterNameMinLength
Minimum length for character names.
public const int CharacterNameMinLength = 3
Field Value
GuildNameMaxLength
Maximum length for guild names.
public const int GuildNameMaxLength = 32
Field Value
GuildNameMinLength
Minimum length for guild names.
public const int GuildNameMinLength = 3
Field Value
InvalidCharacterNameError
Error message for invalid character names.
public static readonly string InvalidCharacterNameError
Field Value
InvalidGuildNameError
Error message for invalid guild names.
public static readonly string InvalidGuildNameError
Field Value
InvalidPasswordError
Error message for invalid passwords.
public static readonly string InvalidPasswordError
Field Value
InvalidUsernameError
Error message for invalid usernames.
public static readonly string InvalidUsernameError
Field Value
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
addressstring
Returns
IsAllowedCharacterName(string)
Validates a character name against length constraints and the letters-and-single-spaces regex pattern.
public static bool IsAllowedCharacterName(string characterName)
Parameters
characterNamestring
Returns
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
emailstring
Returns
IsAllowedGuildName(string)
Validates a guild name against length constraints and the alphanumeric-with-spaces regex pattern.
public static bool IsAllowedGuildName(string guildName)
Parameters
guildNamestring
Returns
IsAllowedPassword(string)
Validates an account password against length constraints and the allowed-special-characters regex pattern.
public static bool IsAllowedPassword(string accountPassword)
Parameters
accountPasswordstring
Returns
IsAllowedUsername(string)
Validates an account username against length constraints and the alphanumeric+underscore regex pattern.
public static bool IsAllowedUsername(string accountName)
Parameters
accountNamestring
Returns
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
accountNamestring