Modules§
- client
- Predefined client related bancho packets.
- macros
- Provide some convenient declarative macros to help build bancho packets.
- server
- Predefined server related bancho packets.
Macros§
- data
- Pack bancho packet data
- packet
- Pack bancho packets
- packet_
struct - Impl bancho packet
Structs§
- Bancho
Message BanchoMessage
is the message structure of the bancho client.- Client
Change Action - Match
Data MatchData
is the data of bancho client multiplayer game room.- Match
Update - Packet
- Bancho packet, including
PacketHeader
structure and payload bytes. - Packet
Builder PacketBuilder
can help pack bancho packets.- Packet
Header - Bancho packet header, including
PacketId
and payload (data) length. - Packet
Reader PacketReader
helps to read Bacho packets.- Payload
Reader PayloadReader
helps to read Bacho packet data.- Score
Frame - The
ScoreFrame
uploaded by the bancho client during multiplayer games.
Enums§
- Login
Failed Reason - The bancho client will handle these failure reasons when the user login fails.
- Login
Result - The login result of the bancho client.
Returns
Success(user_id)
if success. - Packet
Id - Known packet ids for bancho clients.
Constants§
- BANCHO_
PACKET_ HEADER_ LENGTH - Packet header length
- EMPTY_
STRING_ PACKET
Traits§
- Bancho
Packet - Bancho
Packet Length BanchoPacketLength
is a trait used to calculate the byte length of the data converted to bancho packet.- Bancho
Packet Read - Can use
PayloadReader
to read data from typeT
which implements this trait. - Bancho
Packet Write BanchoPacketWrite
is a trait used to convert rust internal data types to bancho packets (Vec<u8>
).
Functions§
- new_
empty_ packet - Initial a packet with PacketId
- u32_
to_ uleb128 - Convert
u32
touleb128
- uleb128_
to_ u32 - Convert
uleb128
bytes tou32
Type Aliases§
Derive Macros§
- Packet
Length - This derive macro will implement the
BanchoPacketLength
trait for the struct. - Read
Packet - This derive macro will implement the
BanchoPacketRead
trait for the struct. - Write
Packet - This derive macro will implement the
BanchoPacketWrite
trait for the struct.