Struct MerchantPurchaseBroadcast
Broadcast for purchasing an item from a merchant. Contains the interactable object's ID, item ID, index, and tab type.
public struct MerchantPurchaseBroadcast : IBroadcast
- Implements
-
IBroadcast
- Inherited Members
Fields
Index
Index of the item in the merchant's inventory.
public int Index
Field Value
InteractableID
ID of the merchant object.
public long InteractableID
Field Value
Remarks
The merchant template id is not sent. The server resolves the interactable from
this id and reads the template off the merchant it finds — which it did already, only to
compare the answer against a number the client had supplied. That comparison guarded
nothing: a client that named a different template was refused by the comparison, and a
client that named the right one was still held to the resolved merchant. What actually
guards a purchase is InteractableResolver.Resolve picking the merchant out of an
object that may carry several interactables, and CanInteract — which is where the
range and corpse gates live. Both are untouched.
Quantity
How many of the item to buy. Clamped server-side; only ever a quantity, never a price.
public int Quantity
Field Value
Remarks
The unit price is looked up from the merchant's own template on the server and the total is multiplied there. Nothing about cost travels on this message — a client that asks for a thousand of something simply gets its request clamped to what the stack and its purse allow.
Type
Type of merchant tab (e.g., buy, sell).
public MerchantTabType Type