Vixen
c7401864
csharp
public sealed class TradeSession

A two-sided trade with a confirm-lock.

Read the guide page for this →

Remarks

Doc 28 is emphatic and it is right: the confirm-lock is not UI polish. It is the mechanism that makes the classic swap-at-the-last-moment scam impossible — the one where somebody replaces a legendary with a grey the instant before you click accept.

⚠ A confirmation quotes the revision it saw, and that is the part the document does not say. "Any change re-opens both confirmations" is necessary and not sufficient: it loses the race where a change and a confirmation cross in flight, because the confirmation arrives after the change has already cleared the flags and simply sets one again — against goods its sender never saw. Making the client quote a revision turns that race into a Stale, and it is the only form of the rule that holds without assuming an ordering the network does not give.

⚠ Nothing here moves anything. Settle produces one EconomyIntent and the ledger decides; a trade that half-applied is the duplication bug the whole design exists to prevent, and one intent is the only arrangement in which it cannot happen.

Fields and properties (8)

  • public PlayerId Left

    One party.

  • public PlayerId Right

    The other.

  • public string Id

    What names it.

  • public TradeStatus Status

    Where it is.

  • public int Revision

    How many times what is on the table has changed. What a confirmation quotes.

  • public TradeOffer LeftOffer

    What the left is offering.

  • public TradeOffer RightOffer

    What the right is offering.

  • public bool IsLocked

    Whether both have confirmed the current revision.

Events (1)

  • public Action<TradeSession>? Changed

    Raised whenever what is on the table changes, so both clients redraw.

Methods (9)

Used by (1)

  • TradeTestsVixen.Gameplay.Economy.Tests