Crate bancho_packets

Source

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§

BanchoMessage
BanchoMessage is the message structure of the bancho client.
ClientChangeAction
MatchData
MatchData is the data of bancho client multiplayer game room.
MatchUpdate
Packet
Bancho packet, including PacketHeader structure and payload bytes.
PacketBuilder
PacketBuilder can help pack bancho packets.
PacketHeader
Bancho packet header, including PacketId and payload (data) length.
PacketReader
PacketReader helps to read Bacho packets.
PayloadReader
PayloadReader helps to read Bacho packet data.
ScoreFrame
The ScoreFrame uploaded by the bancho client during multiplayer games.

Enums§

LoginFailedReason
The bancho client will handle these failure reasons when the user login fails.
LoginResult
The login result of the bancho client. Returns Success(user_id) if success.
PacketId
Known packet ids for bancho clients.

Constants§

BANCHO_PACKET_HEADER_LENGTH
Packet header length
EMPTY_STRING_PACKET

Traits§

BanchoPacket
BanchoPacketLength
BanchoPacketLength is a trait used to calculate the byte length of the data converted to bancho packet.
BanchoPacketRead
Can use PayloadReader to read data from type T which implements this trait.
BanchoPacketWrite
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 to uleb128
uleb128_to_u32
Convert uleb128 bytes to u32

Type Aliases§

CowStr

Derive Macros§

PacketLength
This derive macro will implement the BanchoPacketLength trait for the struct.
ReadPacket
This derive macro will implement the BanchoPacketRead trait for the struct.
WritePacket
This derive macro will implement the BanchoPacketWrite trait for the struct.