Vixen
02b45cc4
csharp
public interface IPlayerGrain

One character's durable state, and the lease that says who may write it. ADR-021.

Read the guide page for this →

Remarks

⚠ This grain being single-threaded is the reason item duplication is not expressible. Not a performance property — a correctness one. Two realms cannot both hold epoch n because acquiring is a grain turn, and a grain takes one turn at a time.

Keyed by ForPlayer, which is account and character: two characters on one account are two sets of inventory, and a lease keyed by account would make playing the second one a duplication bug rather than a Tuesday.

Methods (5)

  • Task<PlayerLease> AcquireLease(ShardId shard)

    Takes the lease for a shard, superseding whoever held it.

  • Task<PlayerLease> RenewLease(ShardId shard, long epoch)

    Says the holder is still alive.

  • Task ReleaseLease(ShardId shard, long epoch)

    Gives it back.

  • Task<PlayerLease> Lease()

    Who holds it, without taking it.

  • Task<ShardId> Where()

    Which shard this character is on, as far as the cluster knows.

Used by (7)

  • ClusterFleetDirectoryVixen.Live.Gate
  • ClusterGrainsVixen.Live.Realm.Cluster
  • FakeClusterVixen.Live.Realm.Cluster.Tests
  • FakePlayerVixen.Live.Realm.Cluster.Tests
  • IRealmGrainsVixen.Live.Realm.Cluster
  • PlayerGrainVixen.Live.Orchestrator
  • RealmClusterVixen.Live.Realm.Cluster