Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Elitriare/ByteNet-Max/llms.txt
Use this file to discover all available pages before exploring further.
defineNamespace is the entry point for organizing your ByteNet Max network definitions. It registers a named scope on the server, assigns compact numeric IDs to every packet and query inside it, and replicates those IDs to the client automatically — so both sides always agree on which ID maps to which channel.
Signature
Parameters
A unique string identifier for this namespace. The server uses this name to store and replicate the numeric ID mappings to clients. Two namespaces with the same name will collide, so treat it like a primary key.
A function that returns a table with optional
packets and queries keys. Each value must be the result of ByteNetMax.definePacket(...) or ByteNetMax.defineQuery(...). The function is called immediately when defineNamespace runs.Return value
A table with two sub-tables:A key/value map of every packet defined in the namespace. Each entry is a fully initialized packet object ready to call
send, listen, etc.A key/value map of every query defined in the namespace. Each entry is a fully initialized query object ready to call
invoke, listen, etc.Example
The recommended pattern is to place thedefineNamespace call inside a ModuleScript and require it on both the server and the client.
The function passed as the second argument is called immediately — ByteNet Max does not defer it. Define all packets and queries inside that function; do not add them to the namespace after
defineNamespace returns.