Crate bancho_packets
source ·Modules
Predefined client related bancho packets.
Provide some convenient declarative macros to help build bancho packets.
Predefined server related bancho packets.
Macros
Structs
BanchoMessage is the message structure of the bancho client.Bancho packet, including
PacketHeader structure and payload bytes.PacketBuilder can help pack bancho packets.Bancho packet header, including
PacketId and payload (data) length.PacketReader helps to read Bacho packets.PayloadReader helps to read Bacho packet data.The
ScoreFrame uploaded by the bancho client during multiplayer games.Enums
The bancho client will handle these failure reasons when the user login fails.
The login result of the bancho client.
Returns
Success(user_id) if success.Known packet ids for bancho clients.
Constants
Packet header length
Traits
BanchoPacketLength is a trait used to calculate the byte length of the data converted to bancho packet.Can use
PayloadReader to read data from type T which implements this trait.BanchoPacketWrite is a trait used to convert rust internal data types to bancho packets (Vec<u8>).Functions
Initial a packet with PacketId
Pack channel info packet data
Pack message packet data
Convert
u32 to uleb128Convert
uleb128 bytes to u32Derive Macros
This derive macro will implement the
BanchoPacketLength trait for the struct.This derive macro will implement the
BanchoPacketRead trait for the struct.This derive macro will implement the
BanchoPacketWrite trait for the struct.