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

Packet relay

cinnabar:extension/packet-relay@0.1.0

Every session packet, relayed through one trusted mod. A batch is the session contract’s batch body: each packet as a varuint32 byte length followed by the encoded packet, header included, in the session’s protocol.

Grants: packets to run packet-mod callbacks; wasi separately enables the restricted WASI runtime.

Types

direction

The way a batch travels.

enum direction {
    from-client,
    from-server,
}
MemberTypeDescription
from-client
from-server

session-identity

The upstream login’s canonical player identity.

record session-identity {
    display-name: string,
    xuid: string,
    uuid: string,
}
MemberTypeDescription
display-namestring
xuidstring
uuidstring

session-pack

A resource pack the mod adds to the session.

record session-pack {
    archive: list<u8>,
    above-server: bool,
}
MemberTypeDescription
archivelist<u8>The pack’s zip archive; its manifest identity must not repeat another pack in the stack.
above-serverboolWhether the pack applies above the server’s packs rather than below them.

outbound

Batch bodies the mod sends outside a relayed batch; an empty body sends nothing.

record outbound {
    to-client: list<u8>,
    to-server: list<u8>,
}
MemberTypeDescription
to-clientlist<u8>
to-serverlist<u8>

Functions

This interface defines shared types and has no functions.