Joining a match
What passes between a client and a server from connection until play begins, in order.
Starting a client
A client learns where to connect from its command line. It takes three arguments it needs nothing in, which can be empty, and then a fourth holding four words separated by single spaces: the server’s IPv4 address, its UDP port, the key (see Transport), and the player id the client registers as. The client connects to that address and port, registers as that player, and enciphers its proof under that key.
A client finds each argument between a pair of double quotes, and reads nothing outside them.
In 0.8.13.26–0.9.22.13
A client whose command line holds no double quote ends.
In 0.9.25.24–1.0.0.24
Any whitespace separates the words of the fourth argument. A client whose command line holds no double quote takes the command line it saved on an earlier run instead, and one holding
.repanywhere plays a replay rather than connecting.
Registering
A client’s first payload is Register, on the registration channel. The note
on Registered says what a server answers with: one answer for every seat.
A client knows the answer meant for it by the player id it registered as, not by the client id, and takes the client id that answer carries as its own. Every other answer tells it which client id stands for which player.
In 0.8.13.26–0.9.22.13
A client waits for the answer naming its own player id as long as it takes, and offers its player no choice.
In 0.9.25.24–1.0.0.24
A client waits 30 seconds for the answer naming its own player id. Then it offers its player to wait another 30 seconds or to give up, and leaves on giving up.
Asking whether a server is ready
A client then sends QueryStatus over and over. A server MUST answer each one
with QueryStatusAnswer, at least until it has answered that it is ready.
While the answers say the server is not ready, a client stays on a black screen
and keeps asking. A server that needs time before a match can begin answers
that it is not ready until it is.
A client stops asking once an answer says the server is ready, and a query it sends after that answer needs none.
Stating a build
Once an answer says the server is ready, a client sends ClientVersion once. A
server answers with VersionSync, and a client loads only where its
agreement says the builds agree.
In 0.8.13.26–0.9.22.13
VersionSyncnames neither the map nor anyone at the match: a client loads the map its own configuration names (see The client’s data).
In 0.9.25.24–1.0.0.24
VersionSyncnames the map to load and everyone at the match.
Taking a seat
Straight after VersionSync, a client sends JoinSide on the roster channel.
A server answers with one Roster, then a SeatName and a SeatChampion for
each seat a player holds.
Loading
A client reports how far loading has got with LoadingProgress, repeatedly
through loading. A server answers each report with SeatLoadProgress on the
transient channel, carrying the report’s figures under the seat that reported.
A client goes on reporting after its progress reaches 100, until play begins.
A client waits on no other seat. SpawnStart, SpawnEnd and StartGame are
what move a client on, and StartGame alone ends its loading. A server that
means its players to begin together sends StartGame to none of them until
every client has sent ClientReady.
In 0.9.25.24–1.0.0.24
A client writes zero where its player id goes in
LoadingProgress.
In 0.9.25.24–0.9.25.35
A server MUST put the seat’s player id in
SeatLoadProgress: the loading screen shows a seat’s card from theVersionSyncseat with that id.
The spawn run
Once a character is settled, a client sends CharacterSelected, once.
A client drops nothing for arriving before CharacterSelected.
A server answers with SpawnStart, states everything on the field as play
opens, and closes the run with SpawnEnd. A run carries:
- for each seat,
CreateChampionfollowed byLoadout; - for each turret, a
CreateTurretand aReplicationbatch of its values; - for each inhibitor and nexus, an
EnterSight, and aReplicationbatch on a map whose buildings replicate (see Replication); - a
RegionAddedfor each region, and aMapPropfor each prop; - at a server’s choice, an
EnterLocalSightfor any of those units.
A client takes these in any order within the run.
A run MUST carry at least SpawnStart, the CreateChampion carrying the
client’s own client id, and SpawnEnd. Given only those, a client still enters play,
showing its champion’s portrait, health, resource and spells. It draws the
champion on the map only once an EnterSight places it there, with its name
and health bar over it.
A client answers each Replication batch with a TransientAck naming that
batch’s syncId. It sends one answer for each batch, in the order the batches
came, including a batch that repeats the syncId of the batch before it.
In 0.9.25.24–1.0.0.24
A client answers a batch as soon as it arrives, within the run or not, and never answers one naming a unit it does not hold.
Starting play
A client sends ClientReady after SpawnEnd and after its answers to the
run’s batches, while it is still reporting its loading. A server MUST answer
with StartGame, and later sends MatchStarted, with other messages free to
come between them; MatchStarted carries 0 (see Time).
A client sends ClientReady as soon as SpawnEnd arrives, and StartGame
alone moves it into play.
In 0.9.25.24–1.0.0.24
A client whose connection drops before play begins ends rather than connecting again.
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).
Register
What a client sends first. It arrives before the connection has a cipher state, so the payload travels in the clear apart from the proof.
In every range of this book
Command 0 on registration, sent by the client, reliable.
| Field | Type | What it is |
|---|---|---|
| leading | bytes, 3 | Arbitrary; it carries no meaning. |
| clientId | u32 | A client writes zero here. |
| playerId | i64 | Who the sender claims to be, as its launch line names the player. The proof is what settles the claim. |
| proof | i64 | The player id enciphered with the 16-byte key both ends already hold; a plain copy where the client has no key. |
Registered
What a server answers a registration with, naming a player in the match and the seat they occupy. It shares its command value with the request it answers, which travels the other way, and it is one fixed size.
In every range of this book
Command 0 on registration, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| leading | bytes, 3 | Unused; a server writes zero. |
| clientId | u32 | The client id playerId holds. Where playerId is the client’s own, the client takes this client id as its own and goes on. |
| playerId | i64 | Who occupies that seat. A client keeps the pair of clientId and playerId from every answer, and takes the answer as its own only where this is its own player id; it reads nothing after it. |
QueryStatus
What a client sends to ask a server for its state. It carries nothing of its own. The header names no object: it carries zero.
QueryStatusAnswer
What a server returns when asked whether it is ready. The header names no object: a server writes zero.
In every range of this book
Command 4 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| ready | u8 | Whether the server is ready; any value but zero ends the client’s wait. While answers say it is not, a client keeps asking and goes no further, which Joining a match sets out. Values: 0 no, 1 yes. |
ClientVersion
What a client sends to state which build it is. The header names no object: it carries zero.
In every range of this book
Carried on requests, sent by the client, reliable, under these commands:
| Builds | Command |
|---|---|
| 0.8.13.26–0.9.22.13 | 71 |
| 0.9.22.14–1.0.0.24 | 67 |
| Field | Type | What it is |
|---|---|---|
| clock | f32 | The client’s own clock as it sends this, in seconds. |
| clientId | u32 | The client id the sender holds: that of the client reporting. |
| text | text, 256 bytes | The build the client runs, as text ending at a zero byte; the bytes after that zero carry nothing. |
Vectors (1)
VersionSync
What a server sends once a client has said which build it runs, saying whether the two agree. The header names no object: it carries zero.
In 0.8.13.26–0.9.22.13
Command 72 on events, sent by the server, reliable.
It carries only agreement and build.
| Field | Type | What it is |
|---|---|---|
| agreement | u8 | 1 lets the client go on into the game. For 0 a client shows both versions and leaves; for any other value it leaves, showing nothing. |
| build | text, ended by a zero byte | The server’s version, ended by a zero byte; the two take at most 512 bytes, and a client fails on a longer one. |
Vectors (1)
In 0.9.22.14–1.0.0.24
Command 68 on events, sent by the server, reliable.
It also says which map to load, who is at the match, and everything else settled before play.
| Field | Type | What it is |
|---|---|---|
| agreement | u8 | Nonzero where the builds agree, letting the client go on into the game. For 0 a client shows both versions, reports a build mismatch and leaves. |
| map | i32 | Which map to load. Space keys the path origins by the same maps. |
| seats | 12 × Seat | Every place at the match, held or empty. |
| build | text, 256 bytes | Which build the server serves, shown and not checked. Written out in full and padded with zero bytes to the width above; a client reads it up to the first zero byte. |
JoinSide
What a client sends to ask for a seat on one of the two sides while the match is being put together.
In 0.9.22.14–1.0.0.24
Command 100 on roster, sent by the client, reliable.
| Field | Type | What it is |
|---|---|---|
| padding | bytes, 3 | Arbitrary; it carries no meaning. |
| clientId | u32 | The client id the sender holds, that is, the id of the client asking. |
| side | u32 | The side it asks for; a client asks for 100. |
Roster
What a server sends to lay out both sides and who is on them, while the match is being put together.
In 0.9.22.14–1.0.0.24
Command 103 on roster, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| padding | bytes, 3 | Unused; a client reads nothing here. |
| sideRoom | u32 | How many seats side 100 has room for. |
| otherSideRoom | u32 | How many side 200 has room for. |
| gap | bytes, 4 | Unused; a client reads nothing here. |
| side | 24 × i64 | The players on side 100, twenty four places of a player identifier’s width; the client copies as many as sideRoom says, so a server keeps sideRoom at 24 or less; a larger one has no defined effect. sideTaken says how many of the leading places carry a player, and the rest hold zero. |
| otherSide | 24 × i64 | The players on side 200, read the same way under otherSideRoom and otherSideTaken, with otherSideRoom kept at 24 or less. |
| sideTaken | u32 | How many of side 100’s places carry a player. |
| otherSideTaken | u32 | How many on side 200. |
SeatName
What a server sends to say what a seat is called, while the match is being put together.
In 0.9.22.14–1.0.0.24
Command 102 on roster, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| padding | bytes, 7 | Unused; a client reads nothing here. |
| player | i64 | Whose name this is. It has a player identifier’s width. |
| skin | i32 | Which look the seat’s champion wears. A client reads nothing here. |
| nameLength | u32 | How many bytes the name below occupies, counting the byte that ends it. A client reads nothing here, and takes the name up to its first zero byte. |
| name | text, sized by nameLength minus 1 | What the seat is called. It is not padded. |
| terminator | bytes, 1 | A zero byte closing the text, which the length above counts. |
SeatChampion
What a server sends to say which champion a seat is playing, while the match is being put together.
In 0.9.22.14–1.0.0.24
Command 101 on roster, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| padding | bytes, 7 | Unused; a client reads nothing here. |
| player | i64 | Whose champion this is. It has a player identifier’s width. |
| skin | i32 | Which look the champion wears. |
| assetLength | u32 | How many bytes the name below occupies, counting the byte that ends it. A client reads nothing here, and takes the name up to its first zero byte. |
| asset | text, sized by assetLength minus 1 | The champion the seat plays, as the name the client loads the champion’s data under. It ends with a zero byte and is not padded. |
| terminator | bytes, 1 | A zero byte closing the text, which the length above counts. |
LoadingProgress
What a client sends while a match loads, saying how far it has got. The header names no object: it carries zero.
In 0.9.22.14–1.0.0.24
Command 113 on requests, sent by the client, unreliable.
| Field | Type | What it is |
|---|---|---|
| clientId | u32 | The client id the sender holds, that is, the id of the client reporting. |
| playerId | i64 | Zero. |
| percent | f32 | How far loading has got, from zero to one hundred. |
| eta | f32 | How many seconds the client expects loading still to take. |
| status | 4-byte bits | |
| status.count | bit 0 to 15 | It rises with each report, not always by one, until it wraps. |
| status.ping | bit 16 to 30 | The round trip time the client measures, in milliseconds. |
| status.unused | bit 31 | Never written by a client; it carries nothing. |
| done | 1-byte bits | |
| done.loaded | bit 0 | Set once loading is done. |
| done.unused | bit 1 to 7 | Carries nothing; a client never writes these bits. |
| text | text, ended by a zero byte | A text the client also keeps, at most 63 characters, ended by a zero byte. What it says is not recorded; a server ignores it. |
SeatLoadProgress
What a server sends to tell everyone how far one seat has got through loading, and how it is holding up. A later report supersedes an earlier one, so losing one costs nothing. The header names no object: a server writes zero.
In 0.9.22.14–1.0.0.24
Command 114 on transient, sent by the server, unreliable.
| Field | Type | What it is |
|---|---|---|
| clientId | u32 | The client id this is about. |
| player | i64 | Who occupies it. |
| progress | f32 | How far through loading it is, from zero to one hundred. |
| secondsLeft | f32 | How much longer it is expected to take, in seconds. |
| status | 4-byte bits | Only ping is read. |
| status.unusedLow | bit 0 to 15 | Unused; a server writes zero. |
| status.ping | bit 16 to 30 | Drawn as the seat’s ping indicator. |
| status.unusedHigh | bit 31 | Unused; a server writes zero. |
| done | 1-byte bits | |
| done.loaded | bit 0 | Where set, a client shows secondsLeft as zero. |
| done.unused | bit 1 to 7 | Unused; a server writes zero. |
| statusText | text, 64 bytes | Read once done.loaded is set and the bar is nearly full: a client compares it, ignoring case, with a fixed phrase saying champions are being spawned, and shows a spawning label where it matches and a ready label otherwise. Padded with zero bytes. |
SpawnStart
What a server sends to open the run of units a client is about to be told about. The header names no object: a server writes zero.
In every range of this book
Command 5 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| count | u8 | A client reads nothing here. A server writes zero. |
SpawnEnd
What a server sends to close the run of units it opened with. The header names no object: a server writes zero.
In every range of this book
Command 12 on events, sent by the server, reliable.
A client answers it at once with ClientReady.
No body.
StartGame
What a server sends to begin play. The header names no object: it carries zero.
ClientReady
What a client sends once it has loaded and is ready to play. The header names no object: it carries zero.
In every range of this book
Command 16 on requests, sent by the client, reliable.
The message is the header alone. A client sends it at once on SpawnEnd.
No body.
CharacterSelected
What a client sends once a character is settled on. It carries nothing of its own. The header names no object: it carries zero.
MatchIdentity
What a server sends to tell a client which match this is and what its player is called. The header carries zero.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 0.8.13.26–0.9.22.13 | 113 |
| 0.9.22.14–1.0.0.24 | 111 |
| Field | Type | What it is |
|---|---|---|
| game | i64 | The match’s identifier. A client only logs it. |
| name | text, 128 bytes | The player’s name, padded with zero bytes. A client reads nothing of it. |
Vectors (1)
ResyncEnded
What a server sends to end the resynchronising a client began on its own Reconnected, after which it takes spawns again as they come.