Extensions

This page documents the packet extensions of the 0.75 protocol: how a server and a client agree on one, the id registry, and the extensions our server speaks. The reference specification is zerospades/aosprotocol, written by the ZeroSpades authors, and the KyroSpades client speaks it too: who speaks what is a table below.

Overview

Every extension has a unique id, decided when it is first registered. There are two kinds:

TypePurposeExtension id range
HAS_PACKETSintroduces new packets0-191
PACKETLESSchanges existing packets or is only announced192-255

An extension with packets is reached by one legacy packet id equal to 64 + extension id. PACKETLESS extensions have no packet of their own.

Each extension packet carries one extra byte after the packet id: a sub packet id, used to have several packets per extension. It is always there, even when the extension needs only one packet.

Field NameField TypeNotes
Packet IDUint864 + extension id
Sub Packet IDUint80-255
DataUint8 arraythe sub packet's data

Ext Info

Client <-> Server

InfoValue
Packet ID60
Total size2 + 2 * n
Field NameField TypeNotes
CountUint8the number of entries that follow
EntriesExt Info Entry x count

An entry:

Field NameField TypeNotes
Extension IDUint8see the registry
VersionUint8at least 1; our server sends 1

Count is the entry count, with no +1. An older revision of the aosprotocol page worded it "length, length+1 entries will follow"; the current one says length entries follow, which is what every implementation (ZeroSpades, KyroSpades, ours) writes and reads. A client reading a server it does not know should still treat the field as a count; if the first entry is not a known extension id and count - 1 entries parse cleanly to the end of the packet, the old wording was meant.

Protocol Flow

The server must send an Ext Info on connect (our server sends it right after State Data). The client stores the list and must reply with an Ext Info naming the extensions it supports.

The reply is the intersection: never name an extension the server did not offer, and never one you do not implement. An extension's packets go only to clients that agreed to it. A server sends nothing of a PACKETLESS extension; the agreement alone changes how it writes existing packets.

Registry

IDNameKindPacketWhat it does
0x00Player PropertiesHAS_PACKETS64exact health, blocks, grenades, ammo and score of players
0x20Damage MarkersHAS_PACKETS96hit markers and floating damage numbers
0x30TeamplayHAS_PACKETS112config, pings, ESP marks, teammate names
0x31Pie MenuHAS_PACKETS113server-defined quick-chat rings
0x32FlashlightHAS_PACKETS114per-player lights
0x33Daytime and WeatherHAS_PACKETS115time of day and weather
0x35Player OutfitHAS_PACKETS117how players look (a draft)
0x36Edit ModeHAS_PACKETS118lifts the client's building limits
0xC0Player LimitPACKETLESS-how many players the server accepts
0xC1Message TypesPACKETLESS-chat types 3..6
0xC2Kick ReasonPACKETLESS-the kick text as a system line

Registered in the specification but not yet merged (open pull requests of zerospades/aosprotocol; the ids are reserved by the proposal, so a client should not name them until the extension is merged):

IDNameKindPacketWhat it does
0x02Client KeyHAS_PACKETS66a key the client proves it holds, so servers recognise it; an encrypted chat for commands
0x34Extended Spawn PacketHAS_PACKETS116per-player flags and a colour that replaces the team colour
0x35Player OutfitHAS_PACKETS117how players look (documented below)
0x37Teams and ScoresHAS_PACKETS119team count, names and colours, scores set by the server, the winning score
0x38Command CompletionHAS_PACKETS120the commands the server accepts and what each one takes
0x3BCustom Weapon (Loadout)HAS_PACKETS123classes, the items in each slot, and live fire-rate, spread and recoil changes
0x3CTeam FlagsHAS_PACKETS124leaves a whole team (a team of bots) out of the scoreboard, messages and kill feed

The specification also lists the chat commands servers share (piqueserver's and LSD's): a command is a chat line that starts with /, needs no packet and no negotiation, and is the cheapest way to add something that does not have to be drawn.

Implementations

What each project speaks, read from their code (ZeroSpades Sources/Client/NetProtocol.h, KyroSpades docs/networking.md, ngspades-client and ngspades-server's 0.75 profile) as of 2026-11-26. "Yes" means the extension is both negotiated and used.

ExtensionZeroSpadesKyroSpadesngspades-clientngspades-server (0.75)
Player Properties 0x00YesYesYesYes
Damage Markers 0x20YesYesYesYes
Client Key 0x02NoYes (proposal)NoNo
Teamplay 0x30YesYesYesYes
Pie Menu 0x31YesYesYesNo
Flashlight 0x32YesYes (with Flicker)YesYes
Daytime and Weather 0x33Yes (Sky)Yes (Sky)YesYes
Player Outfit 0x35NoYes (draft)Yes (draft, and KyroSpades' older form)No (1.0 has its own)
Edit Mode 0x36NoNoNoNo
Player Limit 0xC0YesYesYesYes
Message Types 0xC1YesYesYesYes
Kick Reason 0xC2YesYesYesYes
UTF-8 Chat (no id)YesYesYesYes

Things worth knowing about each:

  • ZeroSpades wrote the specification and implemented the extensions as they were merged: Teamplay (pull request 68), Damage Markers (74), Daytime and Weather (76), Pie Menu (79), Flashlight with its Light Config and Flicker, and UTF-8 chat. It reserves player id 255 for the server under Player Limit and checks every extension sub packet's length through one helper: a packet that is too short is dropped, never half read.
  • KyroSpades is a client only. It answers Ext Info with only the extensions it really implements, and nothing for one the server did not offer. Its Daytime and Weather keeps the world off the screen until the first Sky arrives (bounded at 3 seconds) and draws night as no sun, no shadows and black fog, so a flashlight is as bright by night as by day. It speaks Client Key (a per-server Ed25519 key, one reply per connection). Its Player Outfit is the draft's Set Outfit with the colour byte and Team Outfits.
  • ngspades-client speaks the same set plus KyroSpades' older Outfit form (outfit 1 undead, a three byte Set Outfit), which the Build and Shoot zombie servers use.
  • Edit Mode has a specification and no implementation yet.

Player Properties

Server -> Client — extension 0x00, packet 64, sub 0

Field NameField TypeNotes
SubUint80
Player IDUint8
HealthUint80 for an enemy
BlocksUint80 for an enemy
GrenadesUint80 for an enemy
MagazineUint8
ReserveUint8
ScoreUint32kills plus score

Sent when a value changes, at most every 100 ms per player. A client keeps the ammo and score of everyone (the ammo decides whether another player's shot is drawn) but the health, blocks and grenades of its own player only.

Damage Markers

Server -> Client — extension 0x20, packet 96

Sent to the player who dealt the damage, one packet per hit. There is no client to server form, and no state to clear on Player Left or Map Start. Unlike the other extensions this packet has no sub packet id; the length of the packet selects the type of the amount:

Field NameField TypeNotes
Packet IDUint896
Player IDUint8the player who took the damage
Hit Amountsee belowthe damage the server applied
Packet lengthHit Amount type
3 bytesUint8
4 bytesInt16, signed
6 bytesInt32, signed

A packet of any other length is dropped. A negative amount is a heal. The client draws a hit marker and floats the number over the victim (ZeroSpades and ours for about three seconds). While the extension is negotiated a client stops estimating the damage from its own weapon table.

Teamplay

Client <-> Server — extension 0x30, packet 112

SubNameDirectionPurpose
0ConfigServer -> Clientwhat the server allows
1Pingbotha mark for the team
2ESP MarkServer -> Clienta spot shown through walls

Config:

Field NameField TypeNotes
SubUint80
FlagsUint8bit 0 teammate ESP, bit 1 pings, bit 2 compass
North XFloatthe map direction the client calls north
North YFloata zero or NaN means the map's top

Features: bit 0 TEAM_ESP (teammates through walls, in their team colour), bit 1 PING, bit 2 COMPASS_HUD; the others are reserved and a client ignores unknown bits. Ping:

Field NameField TypeNotes
SubUint81
Player IDUint8on a relay, who pinged; 255 is the server itself. Ignored client to server
X, Y, ZFloat x 3the world position
DurationFloatseconds, see below; a client sends 0, the server fills it in
SurfacesUint8bit 0 world, bit 1 minimap, bit 2 compass; a client sends 0
Blue, Green, RedUint8 x 3only the server sets it; a server with no opinion sends the pinger's team colour
Message IDUint8reserved, 0
ReasonUTF-8 texta free label, the remaining bytes

ESP Mark:

Field NameField TypeNotes
SubUint82
Player IDUint8the player to reveal
DurationFloatseconds
SurfacesUint8as in Ping
FlagsUint8bit 0 clear on respawn, bit 1 show the name
Blue, Green, RedUint8 x 3the outline colour
Message IDUint8reserved, 0
ReasonUTF-8 texta free label, the remaining bytes

Duration: 0 removes the ping or mark, a positive finite number is its life in seconds (the client removes it itself), +inf (0x7F800000) stays until the server removes it or the target leaves, and a negative number or NaN is invalid and the packet is dropped. Our server sends the server's own pings as player

A server with this extension also registers the chat command /pingmark <x> <y> <z> [reason...], handled as a client to server Ping with that position and label under the same rules (the PING bit, the rate limit, the checks on the position). A key bind or a Pie Menu slice can send it as a plain chat line, for example /pingmark %h Enemy.

Pie Menu

Server -> Client — extension 0x31, packet 113

The server defines the client's quick-chat rings. One ring is a pie, one wedge a slice; choosing a slice sends its text as a chat line, often a command. Server to client only: a server that receives one drops it.

Menu (packet 113, sub 0):

Field NameField TypeNotes
SubUint80
Pie CountUint8how many pies follow
PiesPie x countthe remaining bytes

Strings are NUL-terminated and encoded as a chat message is (Code Page 437, or UTF-8 behind 0xFF) and drawn the way chat is, colour codes included. A Pie:

Field NameField TypeNotes
ContextsUint8where it is offered, below
Theme Message IDUint8reserved, 0
ThemeStringthe caption in the middle, empty for none
SlicesSlice x 6exactly six: a server that wants fewer leaves slices blank
Context bitNameOffered when the menu opens on
0BLOCKa block
1TEAMMATEa player of the opening player's team
2ENEMYa player of the other team
3SPECTATORanything, while the opening player spectates
4DEADanything, while the opening player is dead
5SKYnothing: no block and no player under the aim

A spectator is offered SPECTATOR pies alone, a dead player DEAD pies alone. A Slice:

Field NameField TypeNotes
Message IDUint8reserved, 0
FlagsUint8bit 0 GLOBAL: to everyone instead of the team (there is no enemy channel)
TextStringwhat it sends
LabelStringwhat it draws, empty means the Text unexpanded
TooltipStringshown while highlighted, never sent

A slice whose Text and Label are both empty is blank and cannot be chosen. These tokens in a Text are replaced just before it is sent, from the aim taken when the menu opened:

TokenExpands toExample
%p\# and the id of the player aimed at\#7
%bthe block aimed at, three integers257 298 40
%hthe point aimed at, three decimals (at least two places)256.37 298.02 40.00
%rthe camera ray: position then a unit direction255.50 300.12 40.25 0.7071 -0.7071 0.0000
%%a percent sign%

A token with nothing to name expands to nothing, so /votekick %p with nobody aimed at sends /votekick and not /votekick \#. Anything else after a % is reserved and left as it is. Slice 0 is at the top and the rest run clockwise, 60 degrees each; the centre selects nothing.

The menu belongs to the connection: Map Start and Player Left clear nothing. With no Menu received the client keeps its own; a Menu with pies replaces it whole (menus are never merged); a Menu with Pie Count 0 means there is no pie menu and the client's own does not come back. A Menu is parsed whole before any of it is applied and refused (the previous one stands, the client logs it) when a record or string runs past the end of the packet, bytes remain after the last pie, or a UTF-8 string is malformed.

Flashlight

Client <-> Server — extension 0x32, packet 114

SubNameDirectionPurpose
0Lightbotha player's light on or off
1Light StateServer -> Clientone bit per player id
2Light ConfigServer -> Clientthe beam

Light:

Field NameField TypeNotes
SubUint80
Player IDUint8
OnUint80 or 1

A client sends Light to ask; the server relays the accepted request to every client that agreed, the owner included (a client draws only a light the server switched on). A light goes off silently on Create Player, Kill Action, Player Left and a new map: no packet, every client clears it itself.

Light State is [114, 1, bitmask...], one bit per player id, low bit first.

Light Config:

Field NameField TypeNotes
SubUint82
Player IDUint8255 = every player without one
ReachUint8the distance in blocks at which the light reaches zero
ConeUint8the full angle in units of pi/256 radians: 128 is 90 degrees, 255 about 179.3
Red, Green, BlueUint8 x 3the beam's colour
FlickerUint80 is steady, otherwise the light drops out in short bursts, dark about Flicker / 512 of the time

A Reach or Cone of 0 gives no light. Our server's flashlight_cone is in the same unit (default 128). A Light Config for an equipped light is resent when the player equips another one or the light starts or stops flickering.

Daytime and Weather

Server -> Client — extension 0x33, packet 115

Field NameField TypeNotes
SubUint80
TimeUint160 is night, anything else is day (720, noon, is what the reference client writes)
ReservedUint16must be 0; a later version will carry the speed of the day here, so a version 1 client ignores it instead of refusing the packet
WeatherUint8 x 2not implemented in version 1, must be 0

The server sends it after the agreement and after every map. A client that agreed and got no Sky yet draws the night: with Time 0 the fog and the sky are black, and the flashlights are the only light. A new server starts by day. The time belongs to the connection: a new connection clears it, Map Start does not. A client answers 0x33 in its Ext Info only when the server offered version 1 or later, and ignores any packet 115 when it did not negotiate it.

Player Outfit

Server -> Client — extension 0x35, packet 117

A draft of the aosprotocol specification:

SubNameFields
0Set Outfitplayer, outfit, colour (0 team 1, 1 team 2, 255 its own)
1Team Outfitsteam, outfit pairs

Outfits: 0 soldier, 7 miner, 64 zombie, 255 the team's outfit. Cosmetic only. A player's outfit is reset when it leaves and at every map.

Edit Mode

Client <-> Server — extension 0x36, packet 118

Lifts the client's building limits, for map editing and creative servers. Specification only for now: no client or server speaks it yet.

SubNameDirectionPurpose
0Edit ModeServer -> Clientedit mode on or off for one player
1Block Batchbothbuild or destroy many blocks at once

Edit Mode:

Field NameField TypeNotes
SubUint80
Player IDUint8the player it applies to
StateUint80 off, anything else on

The server sends it to every client that negotiated the extension, and a joining client gets one for each player in edit mode. A player's edit mode is off when they join. In edit mode a player never runs out of blocks, a Block Line may be any length, they may build and destroy at any distance, build in the air, build and destroy at z 62 (z 63 never changes), with no delay between builds or spade hits, and as a spectator (blocks take the colour of Existing Player, then of each Set Colour). A client may also let the player fly the camera and build from it (client side only: it keeps sending the body's position and orientation). The server judges each block by the edit mode it has already sent and drops any it does not allow. The map is saved with the existing /savemap command.

Block Batch (the sender is told nothing, the server relays it to every client that negotiated, the sender included):

Field NameField TypeNotes
SubUint81
Player IDUint8the sender; ignored by the server
Action typeUint80 build, 1 destroy, others reserved
BlocksBlock x nto the end of the packet: Int32 X, Y, Z each, 12 bytes

A build takes the player's colour as Block Action 0 does, a destroy removes each block alone as Block Action 1. The server drops a whole batch with a reserved action, no blocks, or more blocks than it accepts.

A client that negotiated Edit Mode applies every Block Action, Block Line and Block Batch, whoever sent it: a line is drawn in full whatever its length, a destroy by a player in edit mode also removes z 62, nothing falls while any player is in edit mode, and otherwise after each destroy a block stays while solid blocks touching by faces connect it to z 63 and the rest fall. A client that did not negotiate it cannot follow this, so while anyone is in edit mode the server disconnects it or makes it a spectator and sends it no block packets, until it joins again or the next Map Start.

Player Limit

PACKETLESS — extension 0xC0

Announced through Ext Info only: the number of players the server accepts (the World Update's slot count). Nothing else is sent.

Message Types

PACKETLESS — extension 0xC1

A client that agreed may receive Chat Message types 3 (big), 4 (info), 5 (warning) and 6 (error); the others get type 2. Show 3..6 as popups.

Kick Reason

PACKETLESS — extension 0xC2

A system Chat Message from player 255 sent just before a disconnect is the kick text. Let it leave the ENet queue before disconnecting (enet_peer_disconnect_later, not enet_peer_disconnect).

UTF-8 Chat

Not an extension: a chat line or name beginning with byte 0xFF and valid UTF-8 after it is UTF-8. A client announces that it reads it through the extended version answer's feature bit 0 (below), and only then sends 0xFF lines itself.

Extra Packets

After a plain Version Send (34) a server may ask for more, once a connection:

Handshake Init

Server -> Client

InfoValue
Packet ID31
Total size5 bytes

Answer with the same four bytes (packet 32).

Extended Version Get

Server -> Client

InfoValue
Packet ID33
Total size1 + n

The bytes after the id are the property ids the server asks for. Answer with Existing Player (9) whose first byte is 'x' (0x78), then per property id, length, payload, one packet per property, each repeating the ones before.

IdMeaningPayload
0applicatione.g. BetterSpades 0.1.5
1languagee.g. en_us, pt_br
2feature flagsbit 0: reads UTF-8 chat

An unknown id gets an empty payload.

Other Resources