Skip to content

Beat Sabers Packet Format 1.34.0

Michael R edited this page Dec 27, 2023 · 4 revisions

Beat Saber Formats it's data packets the following way

1. The Routing Header which consists of 3 bytes

SenderId, ReceiverId and PacketOption

These correspond to the players ConnectionId. After reading the routing header and determining that it should read the packets being received it continues into the reading loop.

The following steps will be looped until there's no data left to read

2. The packet length 1 byte VarUInt

The amount of bytes to read for the the first packet The length is mainly required so we know how many bytes to skip past if we don't read that packet Afterwards we can start deserializing the packet or route it to the next client, keeping in mind that we have to write a new routing header

3. The packet type 1 byte

The this lets us know which type of packet we're dealing with so we know how to deserialize that data.