Expand description
The wire format of the navmesh data server (messages 3, 4 and 5).
All integers and floats are little-endian. This module parses and encodes message payloads; the
frame (u32 length, u32 messageId) belongs to the transport. WorldParams::parse_message
takes a payload that starts with the protocol version, WorldParams::parse one without it.
The readers check every count against the bytes left before they allocate, so a hostile payload cannot make them allocate more than a small multiple of its own size.
Structs§
- Cell
Class - One cell class: the voxel grid resolution of a tile (spec 3.4).
- Link
Class - One link class: an off-mesh jump or climb link type (spec 3.4).
- Tile
Group - One geometry group of a tile: an area id, its parts and its vertices.
- Tile
Input - A tile input message (id 5): one tile’s geometry.
- Tile
Part - One part of a tile group: an object (or a door state) and where its vertices start.
- World
Block - The 84-byte world block of the world params message (spec 3.4).
- World
Params - The world params message (id 4): world block, cell classes and link classes.
Constants§
- DEFAULT_
PORT - The default TCP port of the data server.
- PROTOCOL_
VERSION - The protocol version of the world params message.
Functions§
- encode_
tile_ request - Encodes a tile request (message 3, spec 3.3): tile x and z, then the tile’s min and max x and z
as
float(x) * tileWidth,float(z) * tileHeight,float(x + 1) * tileWidthandfloat(z + 1) * tileHeight.