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,
}
| Member | Type | Description |
|---|---|---|
from-client | ||
from-server |
session-identity
The upstream login’s canonical player identity.
record session-identity {
display-name: string,
xuid: string,
uuid: string,
}
| Member | Type | Description |
|---|---|---|
display-name | string | |
xuid | string | |
uuid | string |
session-pack
A resource pack the mod adds to the session.
record session-pack {
archive: list<u8>,
above-server: bool,
}
| Member | Type | Description |
|---|---|---|
archive | list<u8> | The pack’s zip archive; its manifest identity must not repeat another pack in the stack. |
above-server | bool | Whether 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>,
}
| Member | Type | Description |
|---|---|---|
to-client | list<u8> | |
to-server | list<u8> |
Functions
This interface defines shared types and has no functions.