Vixen
c7401864
csharp
public sealed class PostOffice

Everybody's mailboxes, and the only thing that moves an attachment.

Read the guide page for this →

Remarks

Doc 28 builds the auction on this and says so: mail is "the delivery mechanism for auction settlement, so it must exist before the auction does". Currency and goods are the same shape here, which is what lets an auction pay a seller who is offline.

⚠ An attachment leaves the sender when the letter is sent, not when it is claimed. The obvious arrangement — record what was attached and move it on claim — lets a sender attach a sword, post the letter, sell the sword, and have the recipient claim a second one. So sending escrows into Mail and every later step moves it out of there. This is the same rule the auction's listing follows, for the same reason.

⚠ Claiming is all-or-nothing and includes the cash on delivery. Taking the goods in one operation and paying in another is a scam with two halves; one intent has neither.

⚠ An expired letter goes back to the sender rather than being destroyed — the same "never silently drop" rule Container.Add and Fit follow, and the one that stops a full mailbox eating a raid drop.

Fields and properties (2)

  • public int Capacity

    How many letters one mailbox holds.

  • public int Count

    How many letters are in the system.

Methods (8)

  • public PostOffice(IEconomyLedger ledger, int capacity = 100)

    Makes one over a ledger.

  • public IReadOnlyList<MailMessage> Of(PlayerId player)

    What is in somebody's mailbox, newest first.

  • public MailMessage? Find(MailId id)

    One letter.

  • public MailRefusal Send(PlayerId from, PlayerId to, string subject, IReadOnlyList<MailAttachment> attachments, float now, string operation, out MailMessage? mail, string body = "", long cod = 0, DefId codCurrency = default(DefId), float days = 30)

    Sends a letter, escrowing whatever is attached to it.

  • public MailMessage Deliver(PlayerId to, string subject, IReadOnlyList<MailAttachment> attachments, float now, float days = 30)

    Puts a letter in a box for goods that are already in the mail account.

  • public MailRefusal Claim(PlayerId player, MailId id, string operation)

    Takes everything off a letter, paying whatever is owed on it.

  • public MailRefusal Delete(PlayerId player, MailId id)

    Throws a letter away. Refused while anything is still attached to it.

  • public int Expire(float now)

    Sends back whatever has been sitting too long.

Used by (3)

  • AuctionHouseVixen.Gameplay.Economy
  • AuctionTestsVixen.Gameplay.Economy.Tests
  • MailTestsVixen.Gameplay.Economy.Tests