Vixen
02b45cc4
csharp
public sealed class SourceTransfer

One player's transfer, from the realm that still owns them.

Read the guide page for this →

Remarks

Doc 27 § The overlap as a state machine a test constructs and drives — the same shape ShardLifecycle, PlayerLeaseState and GateService took, and for the same reason: § Testing asks for every abort path, injected, and nobody injects a source realm dying at t5 against three live processes.

⚠ Nothing here talks to anything. It is fed events — the orchestrator answered, the client arrived, the target acked — and asked what to do next. The realm supplies the I/O and RealmDirectory supplies the grain calls, which is what keeps ADR-016's rule a property of where this is driven from rather than a promise made inside it.

⚠ The player is authoritative here until Phase reaches Committed. Every abort leaves them playing, and there is no state in which two realms both believe they own them — the lease epoch is the boundary and LeaseTaken is the only edge that crosses it.

Fields and properties (15)

  • public PlayerKey Player

    Who is moving.

  • public string Destination

    Which map they asked for.

  • public string Reason

    Why — a portal, a party join, a drain.

  • public DateTimeOffset Started

    When it began.

  • public TransferPhase Phase

    Where it has got to.

  • public TransferAbort Abort

    Why it did not happen, once it has not.

  • public ShardId Target

    Which shard, once the orchestrator has said.

  • public long LeaseEpoch

    The epoch the target will take.

  • public TransferPrepare? Prepare

    What the client was told, once it has been.

  • public long CommitTick

    The tick the player stops existing here, once chosen.

  • public DateTimeOffset? Finished

    When it finished, either way.

  • public bool Done

    Whether it is over.

  • public bool StillOurs

    Whether the player is still this realm's to simulate.

  • public TimeSpan Overlap

    How long the overlap lasted — doc 27 § Tick rebasing's OverlapDuration.

  • public TimeSpan CommitLatency

    How long the commit took, once it has.

Methods (10)

  • public SourceTransfer(PlayerKey player, string destination, DateTimeOffset now, TransferDeadlines? deadlines = null, string reason = "")

    Starts one.

  • public bool Placed(ShardId shard, TransferPrepare prepare, long epoch, DateTimeOffset now)

    The orchestrator named a shard. t1.

  • public bool TargetReady(DateTimeOffset now)

    The target pre-reserved a slot and is expecting them. t2.

  • public bool ClientReady(DateTimeOffset now, long atTick)

    The client has the map, the session and the first snapshot. t4.

  • public bool LeaseTaken(long epoch, DateTimeOffset now)

    The lease moved to the target. The atomic moment. t4.

  • public bool HandoffAcknowledged(DateTimeOffset now)

    The target applied the payload and said so. t5 → t6.

  • public bool Stop(TransferAbort reason, DateTimeOffset now)

    Gives up.

  • public bool Step(DateTimeOffset now)

    One turn of the clock. Gives up on whatever has run out of time.

  • public TransferCommit? Commit()

    What to send the client at t5, once there is something to send.

  • public override string ToString()

    Returns a string that represents the current object.

Used by (7)

  • RealmHostVixen.Live.Realm
  • RealmTransfersVixen.Live.Realm
  • SourceTransferTestsVixen.Live.Transfer.Tests
  • TransferFleetVixen.Live.Realm.Tests
  • TransferMetricsVixen.Live.Transfer
  • TransferMetricsTestsVixen.Live.Transfer.Tests
  • TransferOracleTestsVixen.Live.Realm.Tests