Replication
With Replication a server states what has changed about the units a client
can see: for each unit, the groups of values it carries and which values of
each follow. What the values are follows from the unit.
In 3.10–3.15
The groups follow in the order 0, 1, 2, 3, 5 and then 4: group 4 comes last, each behind the length of its run. A sending end MUST write each group’s length as the number of bytes its run takes.
Each value takes one of two shapes, and the table row naming it says which. Nothing on the wire carries a table, a field name, a width or a shape, so an end that does not already hold the table cannot read a run.
A value that counts is a thirty two bit unsigned integer, and a value with a sign travels as the same thirty two bits. It takes seven bits from each byte, lowest seven first, and the top bit of a byte is set while another byte follows. Five bytes therefore carry anything it holds.
A value that measures takes one of three forms: a single byte of 255 meaning zero; a byte of 254 followed by four bytes; or four bytes on their own. The four bytes are the measure itself, a thirty two bit float, lowest byte first. A sending end MUST write the byte of 254 before a measure whose lowest byte is 254 or 255, and MUST NOT write it before any other. A measure written plain therefore never begins with either, so its first byte says which form it takes.
What settles a reading
A run is a sequence of values with nothing between them, in the order the set bits name them, lowest first.
The bit that names a value means different things for different units. Champions, turrets, minions and units belonging to no side, and buildings each answer to a table of their own, so the same bit in the same group is one value on one unit and another on the next. A sending end MUST write the table the unit it names answers to.
Props answer to a table of their own as well.
Which table a unit answers to follows from the message that put it on the field (see Units). A building, which no message creates, answers to the building table.
In 3.01–3.10
The building table is the same on every map.
Which batches a client takes
A client answers a batch with TransientAck where it holds every unit the
batch names, whether or not it took the values. Ordering says
which batches a client takes, and what that requires of a server.
Reading the tables
Each row gives the group and bits that name a value and what the value is.
In 3.10–3.15
Each row also gives the shape a sending end writes the value in.
In 3.10
A champion
Group Bits Value Shape 0 0 Gold in hand measured 0 1 Gold earned in all measured 0 2 to 3 Which of the champion’s slots can be cast from, as a set of bits over two words counted 0 4 Points held for evolving a spell counted 0 5 Which spells have evolved, as a set of bits counted 0 6 to 25 What the spell in one slot costs, slots 0 to 3 first measured 1 0 to 3 What the champion is doing, and whether it is proof against spells, all harm and strikes counted 1 4 Damage it deals by striking measured 1 5 Damage its spells deal before modifiers measured 1 6 How often it turns a blow aside measured 1 7 How often it strikes critically measured 1 8 Armour measured 1 9 Spell resistance measured 1 10 to 11 How fast health and resource return measured 1 12 How far it strikes from measured 1 13 to 16 Flat and percent modifiers on the damage it strikes with, then on its spells’ damage measured 1 17 to 18 Flat and percent reduction of the spell damage it takes measured 1 19 A multiplier on how fast it strikes measured 1 20 A flat addition to how far from the champion an aimed spell’s point is allowed to land measured 1 21 A modifier on its cooldowns measured 1 22 When its passive’s cooldown ends, as a moment on the match clock measured 1 23 How long its passive’s cooldown lasts in all measured 1 24 to 25 How much armour it cuts through, flat then as the share left standing measured 1 26 to 27 How much spell resistance it cuts through, flat then as the share left standing measured 1 28 Life steal measured 1 29 Spell vamp measured 1 30 Crowd-control reduction measured 3 0 to 1 Health and resource as they stand measured 3 2 to 3 Health and resource at their greatest measured 3 4 Experience measured 3 5 to 9 Lifetime, and how far the champion sees measured 3 10 How fast it moves measured 3 11 to 12 Its size, and how wide a path it needs measured 3 13 Level counted 3 14 to 16 Kills taken from no side, and whether anything is allowed to aim at it counted A turret
Group Bits Value Shape 1 0 to 1 Health as it stands, then at its greatest measured 1 2 to 5 What the turret is doing, and whether it is proof against spells, all harm and strikes counted 1 6 Damage it deals by striking measured 1 7 to 8 Armour and spell resistance measured 1 9 A multiplier on how fast it strikes measured 1 10 to 13 Flat and percent modifiers on the damage it strikes with, then on its spells’ damage measured 1 14 How fast health returns measured 3 0 to 1 How far it sees measured 3 2 How fast it moves measured 3 3 Its size measured 5 0 to 1 Whether anything is allowed to aim at it, and which side is counted A minion, and a unit belonging to no side
Both answer to one table.
Group Bits Value Shape 1 0 to 1 Health as it stands, then at its greatest measured 1 2 to 4 How long it lives, as it stands and at its greatest, and the count of that measured 1 5 to 6 Resource at its greatest, then as it stands measured 1 7 to 10 What the unit is doing, and whether it is proof against spells, all harm and strikes counted 1 11 Damage it deals by striking measured 1 12 to 13 Armour and spell resistance measured 1 14 A multiplier on how fast it strikes measured 1 15 to 18 Flat and percent modifiers on the damage it strikes with, then on its spells’ damage measured 1 19 to 20 How fast health and resource return measured 1 21 A value whose meaning is not recorded measured 1 22 to 23 Flat and percent reduction of the spell damage it takes measured 3 0 to 1 How far it sees measured 3 2 How fast it moves measured 3 3 Its size measured 3 4 to 5 Whether anything is allowed to aim at it, and which side is counted For some units the two resource values travel as group 3 bits 0 and 1 instead: the rest of group 1 moves down two bits and the rest of group 3 up two. Which units do is not recorded.
A building
Group Bits Value Shape 1 0 Health as it stands measured 1 1 Whether the building is proof against harm counted 5 0 to 1 Whether anything is allowed to aim at it, and which side is counted A prop
A server need not replicate a prop’s values. Where it does, they follow the table below.
Group Bits Value Shape 1 0 to 1 Health as it stands, then at its greatest measured 1 2 Whether the prop is proof against harm counted 3 0 to 1 How far it sees measured 3 2 How fast it moves measured 3 3 Its size measured 3 4 to 5 Whether anything is allowed to aim at it, and which side is counted
Values stated outside a batch
Besides its batches, a server states some values with messages of their own.
In 3.10–3.15
A server grants experience with
ExperienceGainedand gold withGoldGained.
A server can send the gold a unit earns to another with GoldRedirect. A level
gained is LevelUp, which on its own is enough for a client to show the new
level on its champion’s portrait. A server sets a champion’s tallies for the
scoreboard with ChampionStats. A server can also add to a unit’s shield
(ShieldAdded), change how its health bar or resource bar is shown
(HealthBar, ResourceDisplay), change the sort of resource it has
(ResourceKindChanged), set the highest level a champion reaches
(LevelCap), and count minions killed, scores and deeds (MinionKillCount,
ScoreAdded, StatisticIncremented).
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).
Replication
What a server sends to say what has changed about units a client can see. It is the most frequent thing a server sends. The header names no object: a server writes zero.
In every range of this book
Command 196 on transient, sent by the server, unreliable.
| Field | Type | What it is |
|---|---|---|
| syncId | u32 | Names this batch of changes. Replication says which batches a client takes values from. |
| unitCount | u8 | How many units follow. |
| units | count in unitCount × Replication |
Vectors (3)
TransientAck
What a client sends to say a batch of changes arrived, naming which batch. The header names no object: it carries zero.
In every range of this book
Command 168 on requests, sent by the client, unsequenced.
It is sent for a batch whose values the client dropped as well as for one it took.
| Field | Type | What it is |
|---|---|---|
| syncId | u32 | Which batch is being acknowledged, as the batch named itself. |
Vectors (2)
GoldGained
What a server sends to show a unit gaining gold. The header names the unit whose death earned the gold, as source does.
In every range of this book
Command 34 on events, sent by the server, reliable.
It grants the unit gold.
| Field | Type | What it is |
|---|---|---|
| unit | u32 | The unit granted it. |
| source | u32 | What it came from, or zero where nothing did. |
| amount | f32 | How much. |
ExperienceGained
What a server sends to say a unit gained experience. The header names no object: a server writes zero.
In 3.01–3.14
Command 16 on events, sent by the server, reliable.
Where the unit is the client’s own champion below its highest level, a client also shows the amount on its experience display.
| Field | Type | What it is |
|---|---|---|
| unit | u32 | The unit granted it. |
| amount | f32 | How much. |
Vectors (3)
In 3.15
Command 16 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| unit | u32 | The unit granted it. |
| amount | f32 | How much. |
GoldRedirect
What a server sends to send the gold a unit earns to another. The header names the unit.
In every range of this book
Command 7 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| target | u32 | The unit that receives the gold. |
LevelUp
What a server sends when a unit gains a level. The header names the unit this is about. On its own, with no replication behind it, it is enough for a client to show the new level on the champion’s portrait and offer the unspent points.
In 3.01–3.10
Command 62 on events, sent by the server, reliable.
A client applies it only to a champion, and ignores it for any other unit.
| Field | Type | What it is |
|---|---|---|
| level | u8 | The level now reached. |
| pointsToSpend | u8 | How many spell points are left unspent. |
Vectors (1)
In 3.11–3.15
Command 62 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| level | u8 | The level now reached. |
| pointsToSpend | u8 | How many spell points are left unspent. |
ChampionStats
What a server sends to set a champion’s tallies for the scoreboard. The header names the champion.
In every range of this book
Command 69 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| size | u32 | The whole length of what follows the header, these four bytes included, as a whole 32-bit count. A mismatch has no effect, and does not limit what a client takes. |
| values | bytes, sized by size minus 4 | One value per tally of the match’s mode, the tallies in ascending byte order of their names. An int takes 4 bytes, a float 4, a bool 1, a 64-bit int 8, and text a 16-bit length below 255 then that many bytes. Bytes left over have no effect. A nonzero count of champion kills marks first blood taken. |
ShieldAdded
What a server sends to add to a unit’s shield. The header names the unit.
In every range of this book
Command 101 on events, sent by the server, reliable.
Both physical and magical set adds amount to the shield that takes either kind of damage; one of them, to that kind’s shield; neither, to nothing. A negative amount lowers it, and any shield left below 0.001 becomes zero. noFade clear does not restart a fade already stopped.
| Field | Type | What it is |
|---|---|---|
| flags | 1-byte bits | Which shield. |
| flags.physical | bit 0 | Set where the shield turns aside physical damage. |
| flags.magical | bit 1 | Set where it turns aside magical damage. Both set means either. |
| flags.noFade | bit 2 | Set where the shield does not fade. |
| flags.unused | bit 3 to 7 | Unused; a server writes zero. |
| amount | f32 | How much is added. |
HealthBar
What a server sends about a unit’s health bar. The header names the unit.
In every range of this book
Command 206 on events, sent by the server, reliable.
| Field | Type | Present when | What it is |
|---|---|---|---|
| flags | 1-byte bits | What changes. | |
| flags.show | bit 0 | Set to show the bar, clear to hide it. | |
| flags.changeType | bit 1 | Set where the bar’s type changes; the type and side below apply only then. | |
| flags.unused | bit 2 to 7 | Unused; a server writes zero. | |
| barType | u8 | flags.changeType set | Which sort of bar, applying only where changeType is set and side is the client’s player’s side or zero: 1 a unit’s, 2 a champion’s; any other value only makes sure the unit has a bar. |
| side | i32 | flags.changeType set | The side that sees the change, or 0 for every side. |
Vectors (2)
ResourceDisplay
What a server sends to change how a unit’s resource bar is shown. The header names the unit.
In every range of this book
Command 147 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| unused | u32 | Unused; its bytes carry no meaning. The header names the unit. |
| state | i32 | Which way the resource is shown; a client sets the unit’s resource bar by it, and what each value looks like depends on the unit’s own data. |
Vectors (2)
ResourceKindChanged
What a server sends to change what sort of resource a unit has, which its bar’s colours and art follow. The header names the unit.
In 3.11
Command 275 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| kind | u8 | The kind. A client knows 0 to 10, and takes any higher value as none. Values: 0 mana, 1 energy, 2 none, 3 shield, 4 battleFury, 5 dragonFury, 6 rage, 7 heat. |
Vectors (1)
In 3.12–3.14
Command 275 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| kind | u8 | The kind. Values: 0 mana, 1 energy, 2 none, 3 shield, 4 battleFury, 5 dragonFury, 6 rage, 7 heat, 8 ferocity, 9 bloodWell, 10 other. |
Vectors (1)
In 3.15
Command 275 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| kind | u8 | The kind. A client knows 0 to 11, and takes any higher value as none. Values: 0 mana, 1 energy, 2 none, 3 shield, 4 battleFury, 5 dragonFury, 6 rage, 7 heat, 8 ferocity, 9 bloodWell, 10 wind, 11 other. |
Vectors (1)
LevelCap
What a server sends its player’s champion to set the highest level it can reach. The header names the champion.
In 3.10–3.15
Command 274 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| cap | u8 | The highest level; zero restores the usual 18. |
ScoreAdded
What a server sends to add to a player’s score. The header names no object: a server writes zero.
In every range of this book
Command 217 on events, sent by the server, reliable.
A client ignores the message where player names no champion it holds.
| Field | Type | What it is |
|---|---|---|
| champion | u32 | The champion whose score it is. |
| category | u8 | Which part of the score. Values: 0 offense, 1 defense, 2 combat, 3 objective. |
| event | u8 | What earned it. |
| flags | 1-byte bits | How it is shown. |
| flags.callout | bit 0 | Set where the client announces it. |
| flags.unused | bit 1 to 7 | Unused; a server writes zero. |
| points | f32 | How much is added. |
Vectors (1)
StatisticIncremented
What a server sends to add one to a champion’s count of a deed, as counted for the end of a match. Nothing shows at once. A client ignores it where the id names no champion. The header carries zero.
In every range of this book
Command 218 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| champion | u32 | The champion. |
| statistic | u8 | Which count. A value past those named has no defined effect. Values: 0 pointCaptured, 1 pointNeutralised, 2 killWhileAttackingPoint, 3 teamObjective, 4 defendedPointNeutralised, 5 killWhileDefendingPoint, 6 timeDefendingPoint, 7 lastStand, 8 captureAssist, 9 neutraliseAssist. |
Vectors (2)
GoldEarned
What a server sends about gold a champion earned. The header carries zero.
In every range of this book
Command 228 on events, sent by the server, reliable.
A server sends it to clients watching a match. It credits the champion with the gold.
| Field | Type | What it is |
|---|---|---|
| owner | u32 | The champion credited. |
| amount | f32 | How much gold. 0.95 is what a champion earns for each step it stands still. |
Vectors (2)
GoldSourcesLog
What a server sends to carry a text to a client. It changes nothing a client shows. The header carries zero.
In 3.14–3.15
Command 282 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| length | u32 | How many bytes of text follow. Zero, or a value above 2147483647, carries no text. |
| text | text, sized by length | The text, with no terminating zero. A client looks each word up in its own text and writes the result a line at a time. |
MultikillCount
What a server sends a client watching a match to state a champion’s run of kills. The header carries zero.
In 3.11–3.15
Command 277 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| owner | u32 | The champion. |
| count | u8 | How many kills in the run. |
StatTick
What a server sends to advance every unit’s stats by a span of time. The header carries zero.
In every range of this book
Command 39 on events, sent by the server, reliable.
A client takes it and changes nothing it shows.
| Field | Type | What it is |
|---|---|---|
| seconds | f32 | The span, in seconds. |