Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

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.

In 3.10–3.15

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.

In 3.01–3.10

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.

In 3.01–3.10

A client asks only while the shop is not locked, with the champion dead or near a shop of its side.

A client never asks for an item a player holds only one of and holds already.

In 3.10–3.15

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 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.

A purchase a server never answers still plays the sound of buying.

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 3.01–3.10

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.

Definition.

In every range of this book

Command 41 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. It also says what the champion’s wards look like.

FieldTypeWhat it is
runes30 × u32The runes set before the match, thirty places in runs of nine, nine, nine and three. A place holds zero where nothing was set.
summoners2 × u32The spells in the champion’s summoner slots, by the numbers their names give.
choices80 × ChoiceThe choices made alongside them, one place each, and how far each was taken. A place stands empty where nothing was chosen.
levelu8The player’s account level.
wardSkinu8What the champion’s wards look like.

ItemSubstitution

What a server sends to have one item stand in for another in a champion’s inventory. The header names the champion.

Definition.

In 3.14–3.15

Command 284 on events, sent by the server, reliable.

FieldTypeWhat it is
originalu32The item replaced.
substituteu32The item standing in for it.

SubstitutionCleared

What a server sends to undo an ItemSubstitution, so the shop shows the item itself again. The header names the champion.

Definition.

In 3.14–3.15

Command 285 on events, sent by the server, reliable.

FieldTypeWhat it is
itemu32The item whose substitute is undone. Zero does nothing.

BuyItem

What a client sends to buy an item from the shop. The header names the sender’s champion.

Definition.

In every range of this book

Command 130 on requests, sent by the client, reliable.

FieldTypeWhat it is
itemu32Which item, by the number the client knows it as.
Vectors (2)

one-item-on-3-15, one-on-3-15

RemoveItem

What a client sends to be rid of an item. The header names the sender’s champion.

Definition.

In every range of this book

Command 9 on requests, sent by the client, reliable.

FieldTypeWhat it is
which1-byte bits
which.slotbit 0 to 6Which slot.
which.sellbit 7Set to sell the item, clear to throw it away. A client always sends it set.

SwapItems

What a client sends to move an item from one slot to another. The header names the sender’s champion.

Definition.

In every range of this book

Command 32 on requests, sent by the client, reliable.

FieldTypeWhat it is
fromu8The slot the item leaves, which a 4.17 client sends only from 0 to 9.
tou8The slot it goes to, never the one from names; a 4.17 client sends only 0 to 9.

TutorialShopOpened

What a client sends as its player opens the shop. It carries nothing of its own. The header carries zero.

Definition.

In every range of this book

Command 92 on requests, sent by the client, reliable.

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.

ShopEnabled

What a server sends to say whether a champion can use the shop. The header names the champion.

Definition.

In every range of this book

Command 240 on events, sent by the server, reliable.

FieldTypeWhat it is
flags1-byte bitsWhether it can be used.
flags.enabledbit 0Set where the shop can be used.
flags.unusedbit 1 to 7Unused; a server writes zero.
Vectors (1)

one-on-3-11

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.

Definition.

In 3.01–3.5

Command 110 on events, sent by the server, reliable.

A server sends it to units nobody is buying for.

FieldTypeWhat it is
itemu32Which item, by the number the client knows it as.
slotu8The slot it went to. A client rejects the message from 38 up.
inSlotu8How many of the item the slot holds; zero leaves the slot as it was. The slot’s charges come from the item’s own data.
how1-byte bits
how.unusedbit 0 to 5Unused; a server writes zero.
how.announcebit 6Set 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.unused7bit 7Unused; a server writes zero.
Vectors (1)

one-on-3-01

In 3.6–3.15

Command 110 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.

FieldTypeWhat it is
itemu32Which item, by the number the client knows it as.
slotu8The slot it went to. A client rejects the message from 40 up.
inSlotu8How many of it are in that slot now.
chargesu8How many uses it carries.
how1-byte bits
how.unusedbit 0 to 5Unused; a server writes zero.
how.announcebit 6Set 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.unused7bit 7Unused; a server writes zero.

RemoveItemAnswer

What a server sends to confirm an item left a slot. The header names the unit this is about.

Definition.

In 3.01–3.8

Command 11 on events, sent by the server, reliable.

FieldTypeWhat it is
slotu8Which slot, 0 to 37. For a higher one a client does nothing at all; for 0 to 37 it updates the slot and tells its screens the inventory changed, whatever left is.
leftu8How 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)

one-on-3-8

In 3.9–3.15

Command 11 on events, sent by the server, reliable.

FieldTypeWhat it is
which1-byte bits
which.slotbit 0 to 6Which slot. A client changes nothing from 40 up.
which.notifybit 7Set to have a client tell its screens the inventory changed; clear still updates the slot, quietly.
leftu8How 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.

SwapItemsAnswer

What a server sends to confirm an item moved between slots. The header names the unit this is about.

Definition.

In every range of this book

Command 61 on events, sent by the server, reliable.

FieldTypeWhat it is
fromu8The slot the item left.
tou8The slot it went to.

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.

Definition.

In every range of this book

Command 82 on events, sent by the server, reliable.

FieldTypeWhat it is
itemu32The item. It has no effect where count is zero.
slotu8Which slot, 0 to 39. A client ignores the message from 40 up.
countu8How many. Zero leaves the slot empty.
chargesu8Its charges.

InventorySnapshot

What a server sends to state a unit’s whole inventory at once, with each slot’s cooldown. The header names the unit.

Definition.

In 3.9–3.10

Command 268 on events, sent by the server, reliable.

FieldTypeWhat it is
items8 × recordEight places, one per slot.
items[].itemu32The item, or zero for an empty slot.
items[].slotu8Which slot.
items[].inSlotu8How many are in the slot.
items[].chargesu8How many charges it holds.
Vectors (1)

one-on-3-10

In 3.11–3.13

Command 268 on events, sent by the server, reliable.

FieldTypeWhat it is
items8 × recordEight places, one per slot.
items[].itemu32The item, or zero for an empty slot.
items[].slotu8Which slot.
items[].inSlotu8How many are in the slot.
items[].chargesu8How many charges it holds.
cooldowns8 × f32One per slot. A client applies a slot’s wait only where the slot holds an item and the value is not -1.
Vectors (1)

one-on-3-11

In 3.14–3.15

Command 268 on events, sent by the server, reliable.

FieldTypeWhat it is
items9 × recordNine places, one per slot.
items[].itemu32The item, or zero for an empty slot.
items[].slotu8Which slot.
items[].inSlotu8How many are in the slot.
items[].chargesu8How many charges it holds.
cooldowns9 × f32One per slot. A client applies a slot’s wait only where the slot holds an item and the value is not -1.
Vectors (1)

one-on-3-14

ItemCharges

What a server sends to set how many charges an item holds. The header names the unit.

Definition.

In 3.6–3.15

Command 253 on events, sent by the server, reliable.

FieldTypeWhat it is
slotu8Which slot.
chargesu8How many charges.
Vectors (2)

another-on-3-15, one-on-3-15

ItemUsed

What a server sends after an item in a unit’s inventory is used. The header names the unit.

Definition.

In every range of this book

Command 159 on events, sent by the server, reliable.

FieldTypeWhat it is
slotu8Which slot.
leftu8How many are left in it; zero empties the slot.
chargesu8How many charges it holds.
Vectors (2)

another-on-3-15, one-on-3-15

ShopUndoCount

What a server sends to say how many purchases a champion can still undo. The header names the champion.

Definition.

In 3.9–3.15

Command 267 on events, sent by the server, reliable.

FieldTypeWhat it is
undou8How many steps can be undone.

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.

Definition.

In 3.9–3.15

Command 266 on requests, sent by the client, reliable.

No body.

CloseShop

What a server sends to close a client’s shop. The header carries zero.

Definition.

In every range of this book

Command 14 on events, sent by the server, reliable.

No body.