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

Address

Postal address, as they gave it, or null.

public string? Address { get; set; }

Property Value

string

Age

Account holder age. Zero if not provided.

public int Age { get; set; }

Property Value

int

BanReason

What the operator gave as the reason for the ban.

public string? BanReason { get; set; }

Property Value

string

BannedBy

Account of the operator who applied the ban. Not a foreign key, deliberately.

public string? BannedBy { get; set; }

Property Value

string

BannedUntil

When a temporary ban lifts (UTC), or null for a permanent ban or no ban.

public DateTime? BannedUntil { get; set; }

Property Value

DateTime?

Remarks

Meaningful only while AccessLevel is Banned. The login fetch restores Player the first time it reads a banned account whose instant has passed, so a temporary ban needs no scheduler to end — and an account nobody tries to sign in to stays banned on the row, harmlessly, until somebody does.

Country

Country or region, as they gave it, or null.

public string? Country { get; set; }

Property Value

string

DiscordDmAttempts

Sends Discord refused. Waiting for the player to join the server is not counted.

public int DiscordDmAttempts { get; set; }

Property Value

int

DiscordDmClaimedAt

When the bot took the DM to send it, or null. Never reclaimed automatically.

public DateTime? DiscordDmClaimedAt { get; set; }

Property Value

DateTime?

DiscordDmLastError

Why the DM has not gone out yet, as the bot last recorded it, or null.

public string? DiscordDmLastError { get; set; }

Property Value

string

DiscordDmSentAt

When the DM was delivered, or null. Once set, no further DM is sent for this account.

public DateTime? DiscordDmSentAt { get; set; }

Property Value

DateTime?

DiscordDmUserId

The Discord user the DM was delivered to, or null.

public long? DiscordDmUserId { get; set; }

Property Value

long?

DiscordLinkedAt

When DiscordUserId was set, or null.

public DateTime? DiscordLinkedAt { get; set; }

Property Value

DateTime?

DiscordUserId

The Discord user this account is linked to, or null. Unique: one Discord account links one game account.

public long? DiscordUserId { get; set; }

Property Value

long?

Remarks

A snowflake is an unsigned 64-bit number; it is stored signed, which holds every snowflake until 2084.

DiscordUsername

The Discord username the player gave, lowercase, or null: fishfan, or fishfan#1234 for a name that still carries its discriminator. See AccountProfileRules.NormalizeDiscordUsername.

public string? DiscordUsername { get; set; }

Property Value

string

DiscordVerified

Whether the Discord channel has been proven: the DM's code redeemed, or the bot's link made.

public bool DiscordVerified { get; set; }

Property Value

bool

DiscordVerifyCode

The code the one DM carries, or 0 when none has been issued or it has been used.

public int DiscordVerifyCode { get; set; }

Property Value

int

Email

Contact email address. Null if not provided.

public string? Email { get; set; }

Property Value

string

EmailVerified

Whether the email address has been proven by its code.

public bool EmailVerified { get; set; }

Property Value

bool

Remarks

Per channel. Verified remains the one flag sign-in reads, and is true once every channel in VerificationChannels is satisfied.

FailedLoginCount

Failed password proofs in the current window.

public int FailedLoginCount { get; set; }

Property Value

int

FailedLoginSinceUtc

When the current password-failure window began, or null.

public DateTime? FailedLoginSinceUtc { get; set; }

Property Value

DateTime?

FailedTwoFactorCount

Failed authenticator or recovery codes in the current window.

public int FailedTwoFactorCount { get; set; }

Property Value

int

FailedTwoFactorSinceUtc

When the current code-failure window began, or null.

public DateTime? FailedTwoFactorSinceUtc { get; set; }

Property Value

DateTime?

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

LoginLockedUntilUtc

Until when password sign-in is refused, or null.

public DateTime? LoginLockedUntilUtc { get; set; }

Property Value

DateTime?

MuteReason

What the operator gave as the reason for the mute.

public string? MuteReason { get; set; }

Property Value

string

Muted

Whether the account is muted in chat.

public bool Muted { get; set; }

Property Value

bool

Remarks

An account mute silences every character on the account, which is what makes it the answer to a player who simply switches character. MutedUntil null with this set is a mute with no end; a past MutedUntil is an expired one, and nothing has to clear the row for it to stop applying.

MutedBy

Account of the operator who applied the mute. Not a foreign key, deliberately.

public string? MutedBy { get; set; }

Property Value

string

MutedUntil

When the account's mute lifts (UTC), or null for a mute with no end.

public DateTime? MutedUntil { get; set; }

Property Value

DateTime?

Name

Unique account name, and the primary key.

public string Name { get; set; }

Property Value

string

Remarks

Stored lowercase. It used to be documented as preserving the casing the user registered with, and it does not: AccountService.PersistAsync inserts ToLowerInvariant(). Anything that displays this back to a player shows lowercase, and any code written on the belief that the original casing survives is wrong. NameLowercase is a generated column that exists so the unique index is case-insensitive regardless of what is inserted here.

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

PendingTotpSecret

A re-enrolment's new secret, encrypted like TotpSecret, waiting for a code from the new authenticator. Sign-in never reads it: until it is confirmed and promoted, the live secret keeps working, so an abandoned re-enrolment changes nothing. Null when no re-enrolment is in progress.

public string? PendingTotpSecret { get; set; }

Property Value

string

Phone

Phone number in E.164 form (+ and up to 15 digits), or null.

public string? Phone { get; set; }

Property Value

string

PhoneVerified

Whether Phone has been proven by an SMS code. Cleared when the number changes.

public bool PhoneVerified { get; set; }

Property Value

bool

PhoneVerifyCode

The outstanding SMS verification code, or 0 when none is pending.

public int PhoneVerifyCode { get; set; }

Property Value

int

PhoneVerifyCodeExpiresUtc

When PhoneVerifyCode stops being accepted.

public DateTime? PhoneVerifyCodeExpiresUtc { get; set; }

Property Value

DateTime?

RealName

The account holder's real name, as they gave it, or null.

public string? RealName { get; set; }

Property Value

string

ReferralAccount

The account that referred this one, as typed at registration, or null. No foreign key.

public string? ReferralAccount { 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?

TwoFactorLockedUntilUtc

Until when the second step is refused, or null.

public DateTime? TwoFactorLockedUntilUtc { get; set; }

Property Value

DateTime?

VerificationChannels

Which channels the player chose to verify with, as AccountVerificationChannels flags: 1 email, 2 SMS.

public byte VerificationChannels { get; set; }

Property Value

byte

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 is verified: the one flag sign-in reads.

public bool Verified { get; set; }

Property Value

bool

Remarks

Set by the first correct code on any channel the player chose, or by a server that verifies nothing. See AccountVerificationRules.

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?

VerifyFailedCount

Incorrect verification codes since the last correct one. A support ticket is opened when it reaches AccountVerificationRules.FailedCodesBeforeTicket.

public int VerifyFailedCount { get; set; }

Property Value

int

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