Skip to content

API overview

The public module exports three definition functions and a set of composable data types.

Export Purpose
defineNamespace Group and initialize packets and queries
definePacket Define a one-way typed message
defineQuery Define a typed request and response
Data types Describe serialized values

Typical definition

return ByteNetMax.defineNamespace("Game", function()
    return {
        packets = {
            StatusChanged = ByteNetMax.definePacket({
                value = ByteNetMax.string,
            }),
        },
        queries = {
            GetStatus = ByteNetMax.defineQuery({
                request = ByteNetMax.nothing,
                response = ByteNetMax.string,
            }),
        },
    }
end)

All functions use dot syntax:

Packet.send(Data)
Packet.listen(Callback)

Do not use colon syntax (Packet:send(Data)).