Table of Contents

Class AccountAdminData

Namespace
FishMMO.Database.Data
Assembly
FishMMO-DB.dll

An account as an operator needs to see it.

public sealed class AccountAdminData
Inheritance
AccountAdminData
Inherited Members

Remarks

This type must never carry Salt, Verifier, TotpSecret, VerifyCode or DiscordLinkCode. AccountData carries all of them because the login path is the one caller that needs them: SRP cannot verify a password without the salt and the verifier, and the TOTP check cannot run without the secret. An operator view that carried the same fields would put every account's password material — and every account's second factor — behind nothing but an access-level check, on a surface that is read by a panel, serialized to JSON, and logged. The whole point of SRP is that the verifier never leaves the authentication path; a stolen verifier is an offline dictionary attack against that account with no further access needed, and a stolen TOTP secret makes the second factor forgeable forever.

That is precisely why this is a separate type and not a projection, a subset view, or a nullable-ed copy of AccountData. A projection is one careless MapEntityToDto edit away from leaking, and the leak would be invisible at the call site. A type that has no such field cannot leak it, and a future field added to AccountData does not silently appear here.

TotpEnabled and TotpVerifiedAt are safe and are deliberately kept: an operator answering "why can this person not sign in" needs to know whether a second factor is in the way, and neither field helps forge a code.

Properties

AccessLevel

Account access level. Zero is AccessLevel.Banned, so this doubles as the ban flag — there is no separate banned column.

public byte AccessLevel { get; set; }

Property Value

byte

Address

Postal address, as they gave it.

public string? Address { get; set; }

Property Value

string

Remarks

Personal data, like RealName.

Age

Account holder age, or zero when never supplied.

public int Age { get; set; }

Property Value

int

BanReason

The reason recorded with the ban.

public string? BanReason { get; set; }

Property Value

string

BannedBy

Operator account that applied the ban, when recorded.

public string? BannedBy { get; set; }

Property Value

string

BannedUntil

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

public DateTime? BannedUntil { get; set; }

Property Value

DateTime?

CharacterCount

How many non-deleted characters the account owns.

public int CharacterCount { get; set; }

Property Value

int

Remarks

Soft-deleted characters are excluded because the count exists to answer "is this a real, played account", and a row an operator already deleted is not evidence of that.

Country

Country or region, as they gave it.

public string? Country { get; set; }

Property Value

string

Created

When the account was created (UTC).

public DateTime Created { get; set; }

Property Value

DateTime

DiscordDmClaimedAt

When the bot took the DM to send it, or null. Set with no sent time means it never confirmed.

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 one verification DM was delivered, or null.

public DateTime? DiscordDmSentAt { get; set; }

Property Value

DateTime?

DiscordUserId

The Discord user the account is linked to, or null.

public long? DiscordUserId { get; set; }

Property Value

long?

DiscordUsername

The Discord username the player gave, lowercase, or null.

public string? DiscordUsername { get; set; }

Property Value

string

DiscordVerified

Whether the Discord channel has been proven.

public bool DiscordVerified { get; set; }

Property Value

bool

Email

Contact email, or null when the account has none.

public string? Email { get; set; }

Property Value

string

EmailVerified

Whether the email address has been proven.

public bool EmailVerified { get; set; }

Property Value

bool

LastLogin

When the account last logged in (UTC).

public DateTime LastLogin { get; set; }

Property Value

DateTime

LoginLockedUntilUtc

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

public DateTime? LoginLockedUntilUtc { get; set; }

Property Value

DateTime?

MuteReason

The reason recorded with the mute.

public string? MuteReason { get; set; }

Property Value

string

Muted

Whether an account-wide chat mute is set. See MutedUntil for whether it still applies.

public bool Muted { get; set; }

Property Value

bool

MutedBy

Operator account that applied the mute.

public string? MutedBy { get; set; }

Property Value

string

MutedUntil

When the account mute lifts (UTC), or null for no end.

public DateTime? MutedUntil { get; set; }

Property Value

DateTime?

Name

Account name, as the row stores it. This is the account's primary key.

public string Name { get; set; }

Property Value

string

Phone

Phone number in E.164 form, or null.

public string? Phone { get; set; }

Property Value

string

PhoneVerified

Whether the phone number has been proven by SMS.

public bool PhoneVerified { get; set; }

Property Value

bool

RealName

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

public string? RealName { get; set; }

Property Value

string

Remarks

Personal data. Shown to staff for establishing ownership; every staff read is audited.

ReferralAccount

The referring account, as typed at registration.

public string? ReferralAccount { get; set; }

Property Value

string

TotpEnabled

Whether TOTP two-factor authentication is enabled.

public bool TotpEnabled { get; set; }

Property Value

bool

TotpVerifiedAt

When TOTP setup was first confirmed, or null when it never was.

public DateTime? TotpVerifiedAt { get; set; }

Property Value

DateTime?

Remarks

Null with TotpEnabled true means setup was started and never finished, which is the state an operator is usually looking at when a player reports being locked out.

TwoFactorLockedUntilUtc

Until when the authenticator step is refused, or null.

public DateTime? TwoFactorLockedUntilUtc { get; set; }

Property Value

DateTime?

VerificationChannels

The verification channels the player chose, as AccountVerificationChannels flags.

public byte VerificationChannels { get; set; }

Property Value

byte

VerificationEmailSentAt

When a verification email or text was last delivered, or null.

public DateTime? VerificationEmailSentAt { get; set; }

Property Value

DateTime?

Verified

Whether the contact email has been verified.

public bool Verified { get; set; }

Property Value

bool

VerifyFailedCount

Incorrect verification codes entered since the last correct one.

public int VerifyFailedCount { get; set; }

Property Value

int