Vixen
02b45cc4
csharp
public record class PlayerRecord

One character: who they are, where they were, and the fence on writing them.

Read the guide page for this →

Remarks

⚠ Nothing that is a quantity of an asset belongs in Profile. Inventory and currency are balances, balances are a projection of ILedger, and putting a gold count here as well would be two numbers that mean one thing and drift. The rule that decides: if the support tool would ever be asked where did this come from, it is a ledger asset. If the answer is only ever the player chose it — appearance, keybinds, quest flags, the position they logged out at — it is profile.

Profile is an opaque blob because its schema is doc 28's and the game's, and a column per gameplay concept would make every content change a migration of this assembly. That is the trade named in doc 27 § Persistence's third rule from the other direction: grain state is not gameplay, and gameplay whose shape only the game knows is not this layer's schema.

Fields and properties (8)

  • public PlayerKey Key

    Account and character. The key everything else is joined on.

  • public string Name

    The character's name, as other players see it.

  • public DateTimeOffset Created

    When they were made.

  • public DateTimeOffset LastSeen

    When a realm last held their lease.

  • public string Region

    Their latency zone — doc 27 M-Q5's opaque string.

  • public string HomeMap

    The map address they log in on. Where they were when they left.

  • public long LeaseEpoch

    The epoch of the last write this row accepted. The fence.

  • public ReadOnlyMemory<byte> Profile

    The game's own state. Opaque here, and never queried by this layer.

Methods (4)

  • public PlayerRecord(PlayerKey Key, string Name, DateTimeOffset Created, DateTimeOffset LastSeen, string Region, string HomeMap, long LeaseEpoch, ReadOnlyMemory<byte> Profile)

    One character: who they are, where they were, and the fence on writing them.

  • public bool Equals(PlayerRecord? other)

    Whether two rows say the same thing, profile bytes included.

  • public override int GetHashCode()

    Serves as the default hash function.

  • public override string ToString()

    Returns a string that represents the current object.

Used by (8)

  • ConservationTestsVixen.Live.Persistence.Tests
  • GateServiceVixen.Live.Gate
  • IPlayerRepositoryVixen.Live.Persistence
  • LedgerTestsVixen.Live.Persistence.Tests
  • MemoryPersistenceVixen.Live.Persistence
  • RepositoryTestsVixen.Live.Persistence.Tests
  • SqlPersistenceVixen.Live.Persistence
  • TransferFleetVixen.Live.Realm.Tests