Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.65 KB

File metadata and controls

47 lines (32 loc) · 1.65 KB

Mail System

How in-game mail works: normal letters, COD, auction refunds and system mails (src/game/Mail/Mail.cpp).


Tables

Table (characters DB) Purpose
mail One row per message: sender/receiver guids, subject/body (item_text_id), money, expiry, checked flags.
mail_items Items attached to a message (separate table for performance).
item_instance The physical items themselves.

System-generated mails (auction results, event rewards via game_event_mail, item text copies) use sender = 0 or special message types.


Lifecycle

  1. Send - player mail with items/money or COD charge; rows created in mail + mail_items.
  2. Delivery - mails with items or money are delayed by MailDeliveryDelay (default 1 hour); plain messages arrive instantly. Auction house mails are generated by the AH system.
  3. Read/Return - checked bitmask tracks read/copied/returned state.
  4. Expiry - expired mails are returned to the sender (once) then deleted by the periodic mail expiry task.

COD payments and auction cuts interact with characters.money (see Characters Database); spam limits are configurable via the MailSpam.* settings (mangosd.conf).


Loot-in-Mail

mail_loot_template can roll items directly into mails for special reward flows.


Related Pages