Public Functions
OpenVendorFMerchantSnapshot containing config, stock, and buy list
QuotePurchase
Player: Player controller requesting quoteItemData: Item to purchaseQtyRequested: Desired quantity
FPurchaseQuote with pricing, validation, and nonce
Validation:
- ✓ Player proximity
- ✓ Item exists in stock
- ✓ Stock availability (if finite)
- ✓ Player has sufficient funds
- ✓ Player inventory has space
Server_ConfirmPurchase
Player: Player executing purchaseItemData: Item being purchasedQty: Quantity to purchaseClientQuotedPrice: Total from quote (for validation)Nonce: Unique nonce from quote (for idempotency)
- Deduct currency from player
- Add items to player inventory
- Reduce stock (if finite)
- Log transaction
- Mark nonce as processed
- Broadcast events
QuoteSell
FSellQuote with pricing and validation
Validation:
- ✓ Player proximity
- ✓ Merchant accepts item type
- ✓ Player owns sufficient quantity
Server_ConfirmSell
- Remove items from player inventory
- Add currency to player
- Apply replenishment logic (if configured)
- Log transaction
- Mark nonce as processed
- Broadcast events
RestockNow
FRestockResult with success status and item count
Behavior:
- Sets all
CurrentStock = MaxStock - No-op if
bHasStock = false - Can be called by admin/scripts/cron
- Logs restock event
- Broadcasts events
Utility Functions
FindStockItemGetCurrentStock
WillBuyItem
GetItemSellPrice
GetItemBuyPrice