The shop
What fills the shop, what a client asks for, and what a server answers.
What fills it
A client’s catalogue of items is its own: no message sends or changes it. A client sets its shop up for its own champion, and what a match sells is settled by the client’s own data. A client filters nothing out of the shop by the champion’s level.
Loadout does nothing to the shop: a client fills its shop from its own data,
and takes the items it suggests from its champion’s own data.
In 0.8.13.26–0.9.22.13
An item’s own data says whether it can be bought.
Buying and selling
A client asks to buy with BuyItem, to sell or throw away an item with
RemoveItem, and to swap two slots of its inventory with SwapItems. Closing
the shop sends nothing.
A client never asks to swap two slots: it has no SwapItems.
In 0.8.13.26–0.9.22.13
Opening the shop sends nothing either.
In 0.9.25.24–1.0.0.24
Opening the shop sends
TutorialShopOpened, in any match, except while the shop is locked.
A client asks to buy only where the item is one the match sells and priced within the champion’s gold.
A client asks for an item not built from others only where a slot is free or holds the same item below its stack limit.
A client asks for an item a player holds only one of even where the player holds it already, and an item that can be used in the shop needs a slot as any other does.
In 0.8.13.26–0.9.22.13
For an item built from others, a client asks only where a slot is free or holds one of its parts, and where the champion’s gold covers what remains after the parts it holds.
In 0.9.25.24–1.0.0.24
A client asks only while the shop is not locked, with the champion dead or near a shop of its side.
A client never places an item itself. It shows a purchase only when a server
answers with ItemAdded, a sale or loss with RemoveItemAnswer, and a swap
with SwapItemsAnswer. A server can also set a slot (InventorySlot), set the
whole inventory (InventorySnapshot), change an item’s charges
(ItemCharges), or report an item used (ItemUsed).
ItemAdded places the item and removes nothing: a server sends a
RemoveItemAnswer for each part an item built from others takes up. Gold
falls only as replication states the champion’s gold, and a purchase a server
never answers places nothing and spends nothing.
Undo
Where VersionSync’s features set shopUndo, the shop has an undo button, which
is enabled while ShopUndoCount gives the champion undos to spend. Pressing it
sends ShopUndo, whatever the count.
Closing and locking
CloseShop closes the shop where it is open. A message that locks the shop
alone, InputLock or InputLockToggled, closes it and turns off its key.
In 0.9.25.24–1.0.0.24
A message that locks other input along with the shop stops the shop opening, but leaves an open shop open and its key on.
Messages
Each message of this system in this book, with each layout it has across the book’s patches and every note its definition carries. A layout is the message’s body, after the header its channel’s family puts in front (see Messages).
Loadout
What a server sends to lay out everything a champion brought to the match: the runes set before it began, its summoner slots and the choices made alongside them. The header names the unit this is about.
In 0.8.13.26–0.9.22.13
Command 86 on events, sent by the server, reliable.
A client shows the champion’s icon and sets its two summoner slots from summoners.
| Field | Type | What it is |
|---|---|---|
| runes | 8 × u32 | The runes set before the match. |
| summoners | 2 × u32 | The spells in the champion’s summoner slots, by the numbers their names give. |
| choices | 80 × Choice | The choices made alongside them, 400 bytes that a client keeps as one block. |
| level | u8 | The player’s account level. |
Vectors (1)
In 0.9.22.14–1.0.0.24
Command 83 on events, sent by the server, reliable.
A client’s shop is set up by the Loadout of its own champion: until that arrives the shop opens empty, with no items, no suggested items and no builds, and is drawn at a size that does not fit the screen. A server sends one for every champion at spawning, between SpawnStart and SpawnEnd.
| Field | Type | What it is |
|---|---|---|
| runes | 30 × u32 | The runes set before the match, thirty places. |
| summoners | 2 × u32 | The spells in the champion’s summoner slots, by the numbers their names give. |
| choices | 80 × Choice | The choices made alongside them, 400 bytes that a client keeps as one block. |
| level | u8 | The player’s account level. |
Vectors (1)
BuyItem
What a client sends to buy an item from the shop. The header names the sender’s champion.
In every range of this book
Command 41 on requests, sent by the client, reliable.
| Field | Type | What it is |
|---|---|---|
| item | u32 | Which item, by the number the client knows it as. |
RemoveItem
What a client sends to be rid of an item. The header names the sender’s champion.
In every range of this book
Command 43 on requests, sent by the client, reliable.
| Field | Type | What it is |
|---|---|---|
| slot | u8 | Which slot. |
| sell | u8 | A client sends 1. |
TutorialShopOpened
What a client sends as its player opens the shop. It carries nothing of its own. The header carries zero.
In 0.9.22.16–0.9.25.35
Command 150 on requests, sent by the client, reliable.
A client sends it each time the shop opens, on any map and in any mode. While input lock 16 holds, the shop does not open and it sends nothing.
No body.
Vectors (1)
In 0.9.25.36–1.0.0.24
Command 148 on requests, sent by the client, reliable.
A client sends it every time its player opens the shop, in any game. Where a script of the client’s has locked the shop, the shop does not open and nothing is sent.
No body.
ItemAdded
What a server sends to set what sits in one of a unit’s item slots. The header names the unit this is about.
In 0.8.13.26–0.9.22.13
Command 42 on events, sent by the server, reliable.
There is no charges field: a client takes an item’s charges from the item’s own data. A server sends it to units nobody is buying for.
| Field | Type | What it is |
|---|---|---|
| slot | u8 | The slot it went to, 0 to 14. A larger value than 14 has no defined effect. |
| item | u32 | Which item, by the number the client knows it as. For an item it does not know, a client empties the slot and still takes inSlot. |
| inSlot | u8 | How many of the item the slot holds now; a client applies zero as well. The slot’s charges come from the item’s own data. |
Vectors (1)
In 0.9.22.14–1.0.0.24
Command 42 on events, sent by the server, reliable.
There is no charges field: a client takes an item’s charges from the item’s own data. A client applies it only to a champion’s item slots.
| Field | Type | What it is |
|---|---|---|
| slot | u8 | The slot it went to, 0 to 36. A larger value than 36 has no defined effect. |
| item | u32 | Which item, by the number the client knows it as. For an item it does not know, a client empties the slot and still takes inSlot. |
| inSlot | u8 | How many of the item the slot holds now; a client applies zero as well. The slot’s charges come from the item’s own data. |
RemoveItemAnswer
What a server sends to confirm an item left a slot. The header names the unit this is about.
In 0.8.13.26–0.9.22.13
Command 44 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| slot | u8 | Which slot, 0 to 14. A larger value than 14 has no defined effect. |
| left | u8 | How many are left in the slot; zero empties it, item and charges cleared. |
Vectors (1)
In 0.9.22.14–1.0.0.24
Command 44 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| slot | u8 | Which slot, 0 to 36. A larger value than 36 has no defined effect. |
| left | u8 | How many are left in the slot; zero empties it, item and charges cleared. |
SwapItemsAnswer
What a server sends to confirm an item moved between slots. The header names the unit this is about.
In 0.8.13.26–0.9.22.13
Command 46 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| from | u8 | The slot the item left, 0 to 14. A client swaps the two slots named whatever their values, so a server keeps both within range. |
| to | u8 | The slot it went to, 0 to 14. A client swaps the two slots named whatever their values, so a server keeps both within range. |
Vectors (1)
In 0.9.22.14–1.0.0.24
Command 46 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| from | u8 | The slot the item left, 0 to 36. A client swaps the two slots named whatever their values, so a server keeps both within range. |
| to | u8 | The slot it went to, 0 to 36. A client swaps the two slots named whatever their values, so a server keeps both within range. |
CloseShop
What a server sends to close a client’s shop. The header carries zero.
In 0.9.22.14–1.0.0.24
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 0.9.22.14–0.9.25.35 | 147 |
| 0.9.25.36–1.0.0.24 | 146 |
No body.