Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Server Protocol #50

@mempler

Description

@mempler

Server Protocol

We're in a need for a more efficient packet structure than just Bancho v19.
First we thought we maybe go with v20 but then i decided to not go with it.

Basic Information

Most of the traffic is over WebSockets however Spectator and Multiplayer is over UDP.

Protocol packet structure

  • WebSockets
    • Packet id: int32
    • Packet data length: leb128
    • Packet Data: Binary
  • UDP
    • Authentication Token { random generated 256 bit number } (32 bytes)
    • Packet id: int32
    • Packet data length: leb128
    • Packet Data: Binary

Packet structures

  • Packet Structures
    • Authentication
      • Packet id 0x00
        • Client -> Server
          • Protocol Version: uint32
          • Game Version: uint32
          • Game Checksum: leb128 int8 Array
          • Username: leb128 String
          • Password Hash: leb128 int8 Array
            • MD5 due to stable support
          • Longitude: double
          • Latitude: double
          • Timezone: int8
            • UTC+n (N can be negative or positive)
          • Hardware Information
            • TODO
    • Authentication Reply
      • Packet id 0x00
        • Client <- Server
          • Client Id: int32
            • if Negative everything bellow Client Id doesn't have to be send.
            • -1 = User not found
            • -2 = Update required
            • -3 = Game checksum mismatch
            • -4 = Unsupported Protocol (Too new)
          • Server Protocol: uint32
          • Server Build: uint32
          • Nickname: leb128 String
          • Permission Flags: uint8 Bit Flags
            • Normal User: 1 << 0
            • Banned: 1 << 1
            • Silenced: 1 << 2
          • Duration: uint64
            • Unix timestamp
          • Chat Colour: uint24
            • R, G, B
          • Chat Highlighting: uint8 Bit Flags
            • Normal: 1 << 0
            • Bold: 1 << 1
            • Italic: 1 << 2
          • Message of the day: leb128 String
            • {Click URI}:{Image URI}
    • Ping
      • Packet id 0x02
        • Client -> Server
    • Pong
      • Packet id 0x03
        • Client <- Server

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions