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 match

How a match runs once play has begun, apart from the field: its clock, holds, its end, and players leaving and coming back.

The clock

A server states how long the match has run with ClockSync, and a client answers on the clock channel with ClockReply. Time says how the match clock is kept, and which clock each time on the wire is measured against.

GameSpeed sets how fast the match runs. StatTick hands every unit a span of seconds.

In 4.1–4.19

A client shows the speed GameSpeed sets over its champion. A client changes nothing it shows for StatTick.

In 4.1–4.19

Sent during a hold, GameSpeed takes effect as the match resumes.

StatTick asks every unit’s stats to advance by that span.

Holding and resuming

A client asks to hold the match with Pause, and to resume it with Resume. A server MUST attribute each to the connection it arrived on (see Objects and identifiers).

In 4.1–4.17

A client names no one in Pause or Resume.

In 4.18–4.19

A client puts 0 in the client id of Pause and Resume, the same id as the first seat’s, so a server takes no seat from that field.

A server holds the match with Paused.

Paused carries how long the hold can last, in seconds.

In 4.1–4.19

A client begins a hold only where the time Paused carries is above zero and the match is not already held.

In 4.1–4.19

A client shows a tournament’s hold, crediting the seat that asked, where the message says it is one.

A server ends the hold with Resumed.

Resumed ends the hold either at once or after a countdown the client shows, during which the match stays held.

A client announces in chat who resumed the match.

Input stays locked during the countdown.

The end

A server ends the match with GameEnded, saying which side won, and takes the interface down with HudDisabled. A client shows the win or loss for its player’s side and sends ClientFinished.

In 4.1–4.19

A client that receives GameEnded while still loading leaves at once.

A client sends ClientFinished once, and not while playing a replay.

VictoryDance sets units moving as winners or losers do. It ends nothing.

VictoryDance moves every unit.

Leaving and coming back

A client leaving as one abandoning the match sends Exit: as its player quits or closes the window, as a reconnection fails, or on a server’s Shutdown, which has it leave at once. A client also leaves at once on BotKick with the action that means leave.

In 4.1–4.17

The action of BotKick that means leave is 4.

In 4.18–4.20

The action of BotKick that means leave is 5.

A server tells the others that a player’s client dropped with PlayerDisconnected.

In 4.1–4.19

A client shows a notice in chat for PlayerDisconnected.

SoftReconnect rebuilds a client’s world without a new connection, as Objects and identifiers describes.

A client started again for a match in progress knows nothing of it, and joins as at the start: a server takes it through Joining a match from registering to StartGame, with a spawn run that states the field as it stands, and a ClockSync.

A client the server drops with the reason that means its player was away shows that, and does not connect again.

A server MUST NOT send SpawnStart to a client coming back from a drop: it returns the client to spawning, from which only another StartGame brings it back into play.

In 4.1–4.19

Reconnected announces that another player came back. A client shows it for an ally, or for anyone while it watches the match, and only notes it where it names its own client.

A client dropped during play connects again by itself, registers again, and sends ReconnectedInMatch right after the registration answer; one dropped while loading leaves instead.

A client dropped during play connects again to the same address and port, and shows its player that it is reconnecting until it is back. It goes on where it was: it asks for no status and no version, loads nothing, and keeps every seat, name and identifier it held. A server answers with SoftReconnect, sending between its two stages a message creating each unit the client is to hold.

Staying connected

In 4.1–4.19

A client’s view report, Camera, goes out as its view moves at least 200 units, at most every tenth of a second, and never while its view is locked.

Once loading is done, a client gives up on a connection where a reliable message it sent goes unacknowledged for 15 seconds.

In 4.1–4.19

Before loading is done, a client waits 60 seconds for an acknowledgement rather than 15.

Where it has heard nothing for 5 seconds in play, a client shows its player that it is trying to reconnect, and clears the notice as soon as anything arrives.

In 4.1–4.19

In play a client sends nothing on its own to show it is still there: what it sends answers what it is sent (ClockReply, TransientAck, WaypointAck) or follows from its player, and Camera goes out only as its view moves.

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

ClockSync

What a server sends to set a client’s idea of how long the match has run. The header names no object: a server writes zero.

Definition.

In every range of this book

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
4.1–4.10192
4.11–4.20193
FieldTypeWhat it is
elapsedf32How long the match has run, in seconds.
Vectors (5)

another-on-4-10, one-on-4-10, one-on-4-17, another-on-4-20, one-on-4-20

ClockReply

What a client sends back when a server states the match clock, carrying both readings so the server can tell how far apart they are. The header names no object: it carries zero.

Definition.

In every range of this book

Command 8 on clock, sent by the client, reliable.

FieldTypeWhat it is
serverSaidf32What the server last said the clock stood at, in seconds.
clientSaidf32What the client’s own clock stood at when that statement arrived, in seconds.
Vectors (3)

one-on-4-17, another-on-4-20, one-on-4-20

GameSpeed

What a server sends to set how fast the game’s clock runs. A client shows the new speed over its champion. The header carries zero.

Definition.

In every range of this book

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

Sent while paused, it takes effect on resuming.

FieldTypeWhat it is
speedf32How fast, 1 being normal. A client keeps it between 0 and 10.
Vectors (2)

one-on-4-17, one-on-4-20

Resumed

What a server sends to take the match off hold. The header names a champion: that of the player who resumed the match.

Definition.

In 4.1–4.17

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

The header has no effect. Resuming after the countdown, it keeps input locked and the pause panel open until a countdown of its own ends; resuming at once, it unlocks input and closes the panel.

FieldTypeWhat it is
clientIdu32The client id of the player who resumed the match, announced in chat in their side’s colour where their champion is known; 4294967295 announces no one.
how1-byte bits
how.afterCountdownbit 0Set where the match starts again after a countdown rather than at once.
how.unusedbit 1 to 7Unused; a server writes zero.
Vectors (1)

one-on-4-17

In 4.18–4.20

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

FieldTypeWhat it is
clientIdu32The client id of the client that lifted the hold.
how1-byte bits
how.afterCountdownbit 0Set where the match starts again after a countdown rather than at once.
how.unusedbit 1 to 7Unused; a server writes zero.
Vectors (2)

another-on-4-20, one-on-4-20

Pause

What a client sends to hold a match. The header names no object: it carries zero.

Definition.

In 4.1–4.17

Carried on requests, sent by the client, reliable, under these commands:

BuildsCommand
4.1–4.10160
4.11–4.17161

A client sends the same values in every Pause, as each field states.

FieldTypeWhat it is
clientIdu32A client writes 4294967295, the client id of no client.
timeLefti32A client sends zero.
how1-byte bits
how.tournamentbit 0A client sends it clear.
how.unusedbit 1 to 7Unused; a client writes zero.
Vectors (2)

one-on-4-10, one-on-4-17

In 4.18–4.20

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

FieldTypeWhat it is
clientIdu32The client id of the client that asked.
timeLefti32How much holding time is left to the side that asked, in seconds.
how1-byte bits
how.unlimitedbit 0Set where the hold is not counted against a limit.
how.unusedbit 1 to 7Unused; a client may leave any value here, and a server ignores it.
Vectors (1)

holding-on-4-20

Resume

What a client sends to start a paused match again. The header names no object: it carries zero.

Definition.

In 4.1–4.17

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

A client writes only delayed in how; the rest of the byte carries whatever it held there.

FieldTypeWhat it is
clientIdu32A client writes 4294967295, the client id of no client.
how1-byte bits
how.delayedbit 0A client sends it clear.
how.unusedbit 1 to 7A client leaves these bits unwritten; they carry no meaning, and a server ignores them.
Vectors (1)

one-on-4-17

In 4.18–4.20

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

FieldTypeWhat it is
clientIdu32A client writes zero; a server ignores it.
how1-byte bitsA client clears its lowest bit; the others vary from send to send, and a server ignores them.
how.delayedbit 0Set where the match is to start again after a countdown rather than at once.
how.unusedbit 1 to 7Unused; a client may leave any value here, and a server ignores it.
Vectors (1)

starting-again-on-4-20

Paused

What a server sends to put the match on hold. The header names no object: it carries zero.

Definition.

In 4.1–4.17

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
4.1–4.10160
4.11–4.17161
FieldTypeWhat it is
clientIdu32The client id of the client that asked for the hold; it applies only to a tournament’s hold.
timeLefti32The hold time left, in seconds, for any hold. A hold begins only where it is above zero and the match is not already held.
how1-byte bits
how.tournamentbit 0Set for a tournament’s hold: as the hold begins, a client shows its tournament display, crediting seat. A hold still needs timeLeft above zero.
how.unusedbit 1 to 7Unused; a server writes zero.
Vectors (2)

one-on-4-10, one-on-4-17

In 4.18–4.20

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

FieldTypeWhat it is
clientIdu32The client id of the client that called the hold.
timeLefti32How long the hold can run, in seconds.
how1-byte bits
how.unlimitedbit 0Set where the hold is not counted against a limit.
how.unusedbit 1 to 7Unused; a server writes zero.
Vectors (2)

another-on-4-20, one-on-4-20

GameEnded

What a server sends to end the match and say which side won. The header names no object: it carries zero.

Definition.

In 4.1–4.3

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

Arriving while the match still loads, it counts as a win or loss for the player’s side and the client leaves at once. Otherwise the client ends the match on its screen and sends ClientFinished, except while playing a replay.

FieldTypeWhat it is
result1-byte bits
result.side100Wonbit 0Set where side 100 won, clear where side 200 did.
result.unusedbit 1 to 7Unused; a server writes zero.
Vectors (1)

one-on-4-1

In 4.4–4.17

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
4.4–4.10197
4.11–4.17198

Arriving while the match still loads, it counts as a win or loss for the player’s side and the client leaves at once. Otherwise the client ends the match on its screen and sends ClientFinished, except while playing a replay.

FieldTypeWhat it is
result1-byte bits
result.side100Wonbit 0Set where side 100 won, clear where side 200 did.
result.surrenderedbit 1Set aside for a match ended by surrender. It has no effect.
result.unusedbit 2 to 7Unused; a server writes zero.
Vectors (2)

one-on-4-10, one-on-4-17

In 4.18–4.20

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

FieldTypeWhat it is
result1-byte bits
result.side100Wonbit 0Set where side 100 won and clear where side 200 won. A client compares the winning side with its own to show victory or defeat.
result.unusedbit 1 to 7Unused; a server writes zero.
Vectors (1)

one-on-4-20

ClientFinished

What a client sends when it has finished with the match.

Definition.

In 4.1–4.10

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

It is sent once, at the end.

No body.

Vectors (1)

one-on-4-10

In 4.11–4.20

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

It is sent once, as the end of the match is handled, and not while playing a replay. The header names no object: it carries zero.

No body.

Vectors (2)

one-on-4-17, one-on-4-20

VictoryDance

What a server sends to set units moving as winners or losers do. It ends nothing and changes nothing else on screen. The header carries zero.

Definition.

In every range of this book

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
4.1–4.10196
4.11–4.20197

It sets every unit on a side moving as winners or losers do: a winning champion dances, a losing one stands idle, and other units play a win or loss animation where they have one.

FieldTypeWhat it is
orderWonu8Nonzero where side 100 won, zero where side 200 won.
Vectors (3)

one-on-4-10, one-on-4-17, one-on-4-20

Exit

What a client sends as it leaves. It carries nothing of its own.

Definition.

In 4.1–4.10

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

A client sends it as it leaves as one abandoning the match: as its player confirms quitting or closes the window, as a reconnection fails, or on Shutdown or BotKick. The header names no object: it carries zero.

No body.

Vectors (1)

one-on-4-10

In 4.11–4.17

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

A client sends it only as it quits by abandoning the match; a match that reaches its end sends none. The header names no object: it carries zero.

No body.

Vectors (1)

one-on-4-17

In 4.18–4.20

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

The header names no object: it carries zero.

No body.

Vectors (1)

bare-on-4-20

Shutdown

What a server sends to have a client leave the match at once, as one abandoning it, sending Exit as it goes. It carries nothing of its own. The header carries zero.

Definition.

In every range of this book

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
4.1–4.10228
4.11–4.20229

No body.

Vectors (3)

one-on-4-10, one-on-4-17, one-on-4-20

BotKick

What a server sends to have a client it takes for a program rather than a player leave the match. The header carries zero.

Definition.

In 4.1–4.17

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
4.1–4.10221
4.11–4.17222
FieldTypeWhat it is
actionu8What to do. A client acts on 4 only. Values: 4 leave.
Vectors (2)

one-on-4-10, one-on-4-17

In 4.18–4.20

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

FieldTypeWhat it is
actionu32What to do. A client acts on 5 only. Values: 5 leave.
Vectors (1)

one-on-4-20

PlayerDisconnected

What a server sends as a player’s client drops out. The header carries zero.

Definition.

In every range of this book

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
4.1–4.10151
4.11–4.20152

A client shows a chat notice naming the player in their side’s colour, and nothing where player names no champion it knows, names its own champion, or the match is not under way.

FieldTypeWhat it is
championu32The player’s champion.
flags1-byte bitsWho is told.
flags.toEnemiesbit 0Set to show the notice only to the other side; clear to show it only to the player’s own side. A client with no champion of its own shows it only where this is clear.
flags.unusedbit 1 to 7Unused; a server writes zero.
Vectors (4)

another-on-4-10, one-on-4-10, one-on-4-17, one-on-4-20

SoftReconnect

What a server sends, in pairs, to rebuild a client’s world without a new connection: the first marks what the client holds, the second deletes whatever is still marked. The header carries zero.

Definition.

In 4.1–4.17

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
4.1–4.10238
4.11–4.17239
FieldTypeWhat it is
stage1-byte bitsWhich half of the pair.
stage.stagebit 0 to 10 to mark every unit, and every object kept until a checkpoint other than an inhibitor, also clearing floating text, any screen tint and the state of neutral camps; any other value to delete whatever is still marked.
stage.unusedbit 2 to 7Unused; a server writes zero.
Vectors (2)

one-on-4-10, one-on-4-17

In 4.18–4.20

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

FieldTypeWhat it is
stageu32Which half of the pair: 1 to mark every unit, and every object kept until a checkpoint other than an inhibitor, also clearing floating text, any screen tint and the state of neutral camps; any other value to delete whatever is still marked. Values: 1 mark.
Vectors (1)

one-on-4-20

ReconnectedInMatch

What a client sends right after the server answers its registration. The header carries zero.

Definition.

In every range of this book

Carried on requests, sent by the client, reliable, under these commands:

BuildsCommand
4.1–4.10155
4.11–4.20156

A client sends it once it has connected again to a match it was playing. A client dropped while playing reconnects by itself; one dropped while loading leaves instead. It carries nothing of its own.

No body.

Vectors (3)

one-on-4-10, one-on-4-17, one-on-4-20

Reconnected

What a server sends to say a client has reconnected. The header carries zero.

Definition.

In every range of this book

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

FieldTypeWhat it is
clientu32The client, by the seat it occupies.
Vectors (2)

one-on-4-17, one-on-4-20

ClockConvergence

What a server sends about how its clock and a client’s are being brought together. The header carries zero.

Definition.

In every range of this book

Carried on clock, sent by the server, reliable, under these commands:

BuildsCommand
4.1–4.10117
4.11–4.20118
FieldTypeWhat it is
clientTimef32The client’s clock, in seconds, as the client reported it.
roundTripf32The round trip time the server measures, in seconds.
Vectors (2)

one-on-4-11, one-on-4-20

Empty

A message with no body. The header carries zero.

Definition.

In every range of this book

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

No body.

Vectors (2)

one-on-4-17, one-on-4-20

Unhandled286

A message that changes nothing a client shows. The header carries zero.

Definition.

In every range of this book

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

No body.

Vectors (2)

one-on-4-17, one-on-4-20