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.
What a server decides is which of the client’s items a match lets a player buy, and whether the shop has a player to show them to.
A client sets its shop up from its own champion’s CreateChampion (the one
carrying its own client id) and then that champion’s Loadout. Until the
Loadout arrives, its shop opens empty and too big for the screen: no items,
no suggested items, no builds. Given its own champion’s Loadout, it shows
every item and the items it suggests for the champion. A server sends each
champion’s Loadout during the spawn run.
What a match sells is settled by the client’s own data for the map, the mode
and the variants named in VersionSync. The map’s data lists items that
cannot be bought, with further lists for the mode and each variant; a mode
with no list of its own removes nothing. Suggested items are kept per champion, and chosen by map and
mode. Of what a server sends, only these change what can be bought:
VersionSync’s disabled items: none can be bought; a zero place disables nothing.ItemSubstitution: the shop shows a substitute for an item, at the substitute’s price, untilSubstitutionCleared.
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.
Opening the shop sends nothing, except in the tutorial, where it sends
TutorialShopOpened.
A client asks to buy only where the item is one the match sells and priced within the champion’s gold.
A client never asks for an item a player holds only one of and holds already.
A client asks only where the item’s price, after any substitution, is within the champion’s gold, and where a slot is free, unless the item can be used in the shop. For an item built from others, it asks only where the champion holds a free slot or a part of it, everything the item requires, and gold for what remains.
A client asks to buy only where shopping is allowed (ShopEnabled), with the
champion near its side’s shop, dead, or allowed to shop from anywhere.
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).
In 4.1–4.19
ItemAddedplaces the item and removes nothing: a server sends aRemoveItemAnswerfor 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.
In 4.1–4.19
A purchase a server never answers still plays the sound of buying.
In 4.1–4.19
A purchase a server never answers still lists the item among recent purchases.
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.
Any message that locks the shop closes it and turns off its key, whatever else it locks.
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 4.1–4.17
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 41 |
| 4.11–4.17 | 42 |
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. It also says what the champion’s wards look like.
| Field | Type | What it is |
|---|---|---|
| runes | 30 × u32 | The runes set before the match, thirty places in runs of nine, nine, nine and three. A place holds zero where nothing was set. |
| 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, one place each, and how far each was taken. A place stands empty where nothing was chosen. |
| level | u8 | The player’s account level. |
| wardSkin | u8 | What the champion’s wards look like. |
Vectors (2)
In 4.18–4.20
Command 42 on events, sent by the server, reliable.
It also says what the champion’s wards look like.
| Field | Type | What it is |
|---|---|---|
| runes | 30 × u32 | The runes set before the match, thirty places in runs of nine, nine, nine and three. A place holds zero where nothing was set. |
| summoners | 2 × u32 | The spells in the champion’s summoner slots. |
| summonersAgain | 2 × u32 | The same two spells a second time. A server writes them twice, and both runs agree. |
| choices | 80 × Choice | The choices made alongside them, one place each, and how far each was taken. A place stands empty where nothing was chosen. |
| level | u8 | The level the champion starts at. |
| wardSkin | u8 | What the champion’s wards look like. |
Vectors (2)
ItemSubstitution
What a server sends to have one item stand in for another in a champion’s inventory. The header names the champion.
In every range of this book
Command 284 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| original | u32 | The item replaced. |
| substitute | u32 | The item standing in for it. |
Vectors (2)
SubstitutionCleared
What a server sends to undo an ItemSubstitution, so the shop shows the item itself again. The header names the champion.
In every range of this book
Command 285 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| item | u32 | The item whose substitute is undone. Zero does nothing. |
Vectors (2)
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
Carried on requests, sent by the client, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 129 |
| 4.11–4.20 | 130 |
| Field | Type | What it is |
|---|---|---|
| item | u32 | Which item, by the number the client knows it as. |
Vectors (4)
one-item-on-4-10, one-on-4-10, one-on-4-17, one-item-on-4-20
RemoveItem
What a client sends to be rid of an item. The header names the sender’s champion.
In 4.1–4.17
Command 9 on requests, sent by the client, reliable.
| Field | Type | What it is |
|---|---|---|
| which | 1-byte bits | |
| which.slot | bit 0 to 6 | Which slot. |
| which.sell | bit 7 | Set to sell the item, clear to throw it away. A client always sends it set. |
Vectors (1)
In 4.18–4.20
Command 9 on requests, sent by the client, reliable.
A client sends it to sell an item or to throw one away.
| Field | Type | What it is |
|---|---|---|
| slot | u8 | Which slot the item sits in. |
| how | 1-byte bits | |
| how.sell | bit 0 | Set where the item is sold rather than discarded. |
| how.unused | bit 1 to 7 | Unused; a client may leave any value here, and a server ignores it. |
Vectors (1)
SwapItems
What a client sends to move an item from one slot to another. The header names the sender’s champion.
In 4.1–4.17
Command 32 on requests, sent by the client, reliable.
| Field | Type | What it is |
|---|---|---|
| from | u8 | The slot the item leaves, which a 4.17 client sends only from 0 to 9. |
| to | u8 | The slot it goes to, never the one from names; a 4.17 client sends only 0 to 9. |
Vectors (1)
In 4.18–4.20
Command 32 on requests, sent by the client, reliable.
| Field | Type | What it is |
|---|---|---|
| from | u8 | The slot the item leaves, which a 4.20 client sends only from 0 to 5. |
| to | u8 | The slot it goes to, never the one from names; a 4.20 client sends only 0 to 5. |
Vectors (1)
TutorialShopOpened
What a client sends as its player opens the shop. It carries nothing of its own. The header carries zero.
In every range of this book
Carried on requests, sent by the client, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 92 |
| 4.11–4.20 | 93 |
A client sends it only in the tutorial: where the version answer names the mode TUTORIAL and the map’s own data marks it as a tutorial map, as map 12’s does; elsewhere it never sends this.
No body.
Vectors (3)
ShopEnabled
What a server sends to say whether a champion can use the shop. The header names the champion.
In 4.1–4.12
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 239 |
| 4.11–4.12 | 240 |
| Field | Type | What it is |
|---|---|---|
| flags | 1-byte bits | Whether it can be used. |
| flags.enabled | bit 0 | Set where the shop can be used. |
| flags.unused | bit 1 to 7 | Unused; a server writes zero. |
Vectors (2)
In 4.13–4.20
Command 240 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| flags | 1-byte bits | Whether it can be used. |
| flags.enabled | bit 0 | Set where the shop can be used. |
| flags.force | bit 1 | Set where it can be used wherever the champion stands. |
| flags.unused | bit 2 to 7 | Unused; a server writes zero. |
Vectors (2)
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 4.1–4.17
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 110 |
| 4.11–4.17 | 111 |
It answers no request: a client clears the slot named and puts what follows in its place whether or not anything asked for it. A server sends it to units nobody is buying for.
| Field | Type | What it is |
|---|---|---|
| item | u32 | Which item, by the number the client knows it as. |
| slot | u8 | The slot it went to. A client rejects the message from 40 up. |
| inSlot | u8 | How many of it are in that slot now. |
| charges | u8 | How many uses it carries. |
| how | 1-byte bits | |
| how.unused | bit 0 to 5 | Unused; a server writes zero. |
| how.announce | bit 6 | Set to announce the purchase: a client shows it where the unit is on its side (or it plays a replay), the item’s own data allows it, the player’s setting asks for it, and the same item was not bought in the last 5 seconds, a repeat within them restarting the wait. |
| how.unused7 | bit 7 | Unused; a server writes zero. |
Vectors (4)
In 4.18–4.20
Command 111 on events, sent by the server, reliable.
It answers no request: a client clears the slot named and puts what follows in its place whether or not anything asked for it. A server sends it to units nobody is buying for.
| Field | Type | What it is |
|---|---|---|
| item | u32 | Which item, by the number the client knows it as. |
| slot | u8 | The slot it went to. A client ignores a message naming a slot above 38. |
| inSlot | u8 | How many of it are in that slot now. |
| charges | u8 | How many uses it carries. |
| how | 1-byte bits | |
| how.tellTheClient | bit 0 | Set to announce the purchase to allies and those watching, for items that announce, at most once per item in 5 seconds. |
| how.unused | bit 1 to 7 | Unused; a server writes zero. |
Vectors (2)
RemoveItemAnswer
What a server sends to confirm an item left a slot. The header names the unit this is about.
In 4.1–4.17
Command 11 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| which | 1-byte bits | |
| which.slot | bit 0 to 6 | Which slot. A client changes nothing from 40 up. |
| which.notify | bit 7 | Set to have a client tell its screens the inventory changed; clear still updates the slot, quietly. |
| left | u8 | How many are left in the slot; zero empties it, item and charges cleared. Either way a client cancels any spell or action its player had picked. |
Vectors (1)
In 4.18–4.20
Command 11 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| slot | u8 | Which slot. |
| left | u8 | How many of the item remain in it. |
| how | 1-byte bits | |
| how.tellTheClient | bit 0 | Set where the client is to show the change. |
| how.unused | bit 1 to 7 | Unused; a server writes zero. |
Vectors (2)
SwapItemsAnswer
What a server sends to confirm an item moved between slots. The header names the unit this is about.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 61 |
| 4.11–4.20 | 62 |
| Field | Type | What it is |
|---|---|---|
| from | u8 | The slot the item left. |
| to | u8 | The slot it went to. |
Vectors (6)
a-third-on-4-10, another-on-4-10, one-on-4-10, one-on-4-17, another-on-4-20, one-on-4-20
InventorySlot
What a server sends to set one slot of a unit’s inventory. The header names the unit. A client empties the slot, then fills it where count is above zero, and refreshes the shop where the unit is its own champion.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 82 |
| 4.11–4.20 | 83 |
| Field | Type | What it is |
|---|---|---|
| item | u32 | The item. It has no effect where count is zero. |
| slot | u8 | Which slot, 0 to 39. A client ignores the message from 40 up. |
| count | u8 | How many. Zero leaves the slot empty. |
| charges | u8 | Its charges. |
Vectors (3)
InventorySnapshot
What a server sends to state a unit’s whole inventory at once, with each slot’s cooldown. The header names the unit.
In 4.1–4.6
Command 268 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| items | 9 × record | Nine places, one per slot. |
| items[].item | u32 | The item, or zero for an empty slot. |
| items[].slot | u8 | Which slot. |
| items[].inSlot | u8 | How many are in the slot. |
| items[].charges | u8 | How many charges it holds. |
| cooldowns | 9 × f32 | One per slot. A client applies a slot’s wait only where the slot holds an item and the value is not -1. |
In 4.7–4.10
Command 268 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| items | 10 × record | Ten places, one per slot. |
| items[].item | u32 | The item, or zero for an empty slot. |
| items[].slot | u8 | Which slot. |
| items[].inSlot | u8 | How many are in the slot. |
| items[].charges | u8 | How many charges it holds. |
| cooldowns | 10 × f32 | One per slot. A client applies a slot’s wait only where the slot holds an item and the value is not -1. |
Vectors (1)
In 4.11–4.20
Command 268 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| items | 10 × record | Ten places, one per slot. |
| items[].item | u32 | The item, or zero for an empty slot. |
| items[].slot | u8 | Which slot. |
| items[].inSlot | u8 | How many are in the slot. |
| items[].charges | u8 | How many charges it holds. |
| cooldowns | 10 × f32 | One per slot. |
| maxCooldowns | 10 × f32 | One per slot. |
Vectors (2)
ItemCharges
What a server sends to set how many charges an item holds. The header names the unit.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 252 |
| 4.11–4.20 | 253 |
| Field | Type | What it is |
|---|---|---|
| slot | u8 | Which slot. |
| charges | u8 | How many charges. |
Vectors (4)
ItemUsed
What a server sends after an item in a unit’s inventory is used. The header names the unit.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 158 |
| 4.11–4.20 | 159 |
| Field | Type | What it is |
|---|---|---|
| slot | u8 | Which slot. |
| left | u8 | How many are left in it; zero empties the slot. |
| charges | u8 | How many charges it holds. |
Vectors (4)
ShopUndoCount
What a server sends to say how many purchases a champion can still undo. The header names the champion.
In every range of this book
Command 267 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| undo | u8 | How many steps can be undone. |
Vectors (2)
ShopUndo
What a client sends as its player presses the shop’s undo button. The button is there only where the version answer’s features have shopUndo set, and is enabled only while ShopUndoCount has given the champion undos to spend. It carries nothing of its own. Its identifier is wider than a byte, so it travels behind the escape. The header names the sender’s champion.
In every range of this book
Command 266 on requests, sent by the client, reliable.
No body.
Vectors (2)
CloseShop
What a server sends to close a client’s shop. The header carries zero.
In every range of this book
Command 14 on events, sent by the server, reliable.
No body.
Vectors (2)
InventorySnapshotOnMap
What a server sends to state a unit’s whole inventory at once, with each slot’s cooldown, to the clients that can see the unit. The header names the unit.