pub fn new_empty_packet(packet_id: PacketId) -> Vec<u8> 
Expand description

Initial a packet with PacketId

Packets posits:

  • 0..=1: PacketId
  • 2: 0x0
  • 3..=6: packet length (i32 as bytes)
  • 7..=N: packet data length (uleb128 as bytes) + data

Note: The maximum value of u8 is 255, currently the largest packet id of bancho is 109, so never overflow.