Buy Inventory
About
This packet is sent by the client to the server requesting an item be added to their inventory. In response, the server can either deny the client the item because it doesn't exist, the client doesn't have enough coins, the client is not a member and the item they requested was for members only, or the item requested is patched.
The requested item's id will always be the second-to-last section of the packet, and the item's cost will be the last. In the following example(s), the item's id is 413, and costs 0 coins.
If the client meets all the requirements to purchase the item, the server will send back the 'buy inventory' packet, this time it has the item's cost, and still contains the item's id. The item's id is sent back to the client to let them know which item they have successfully purchased, so they can look up information (i.e name, sprite file) of the item via crumbs. The item's cost is sent back so the client will know how many coins to deduct from the interface.
Examples
Client-side | %xt%s%i#ai%1%413% |
Server-side | %xt%ai%1%413%0% |
Structure
Item ID | Cost |
---|---|
413 | 0 |
Possible Errors
ID | Description |
---|---|
402 | Item not available |
400 | Already purchased |
401 | Not enough coins |
<seealso> Get Inventory </seealso>