Table of Contents

Class AccountEntity

Namespace
FishMMO.Database.Npgsql.Entities
Assembly
FishMMO-DB.dll

Database entity representing a player account.

public class AccountEntity
Inheritance
AccountEntity
Inherited Members

Properties

AccessLevel

Account access level.

public byte AccessLevel { get; set; }

Property Value

byte

Age

Account holder age. Zero if not provided.

public int Age { get; set; }

Property Value

int

DiscordLinkCode

Temporary code used to link a Discord account. Null when no link is pending. The Discord bot generates this code and the user verifies in-game.

public string? DiscordLinkCode { get; set; }

Property Value

string

Email

Contact email address. Null if not provided.

public string? Email { get; set; }

Property Value

string

LastLogin

Last successful login timestamp (UTC).

public DateTime LastLogin { get; set; }

Property Value

DateTime

LastTotpWindow

The last TOTP time-step window that was successfully used, for replay attack prevention. Zero when no TOTP code has been verified yet.

public long LastTotpWindow { get; set; }

Property Value

long

Name

Unique account name (primary key) — preserves the casing the user registered with.

public string Name { get; set; }

Property Value

string

NameLowercase

Case-insensitive lookup column for Name. Computed as LOWER(name) in the database and bound by a UNIQUE index so that two accounts cannot differ only in case. Application code must filter on this column (lowercased input) for all account-name lookups.

public string NameLowercase { get; set; }

Property Value

string

Salt

SRP password salt.

public string Salt { get; set; }

Property Value

string

TimeCreated

Account creation timestamp (UTC).

public DateTime TimeCreated { get; set; }

Property Value

DateTime

TotpEnabled

Whether TOTP two-factor authentication is enabled for this account.

public bool TotpEnabled { get; set; }

Property Value

bool

TotpSecret

Base32-encoded TOTP secret key, encrypted at rest by the server layer. Null when TOTP has not been set up.

public string? TotpSecret { get; set; }

Property Value

string

TotpVerifiedAt

Timestamp (UTC) of the first successful TOTP verification, confirming setup completion. Null when TOTP setup has not been confirmed.

public DateTime? TotpVerifiedAt { get; set; }

Property Value

DateTime?

VerificationEmailSentAt

UTC timestamp when the verification email was successfully sent via SMTP. Null while the email is still pending in the outbound queue. When non-null and Verified is false, login is blocked until the user verifies.

public DateTime? VerificationEmailSentAt { get; set; }

Property Value

DateTime?

Verified

Whether the account email has been verified via the registration verification link. Defaults to false until the user clicks the verification URL sent to their email.

public bool Verified { get; set; }

Property Value

bool

Verifier

SRP password verifier.

public string Verifier { get; set; }

Property Value

string

VerifyCode

Random verification code sent to the account email during registration. The user must provide this code to toggle Verified to true. Zero when no verification is pending.

public int VerifyCode { get; set; }

Property Value

int

VerifyCodeExpiresUtc

UTC expiry timestamp for VerifyCode. Once exceeded, the code is considered invalid and must be regenerated. Null while no verification is pending.

public DateTime? VerifyCodeExpiresUtc { get; set; }

Property Value

DateTime?

Version

PostgreSQL xmin system column exposed as an EF Core concurrency token to detect concurrent modifications. Updated automatically by the database on every row change.

public uint Version { get; set; }

Property Value

uint