Network Protocol/ROOM

From Custom Mario Kart
Jump to navigation Jump to search

Overview

This article describes the record type ROOM of the Network Protocol. It is only used in private rooms.

Race Packet Sections
Name Amount Size Description
SLOT 0-1 0x08 Only used for redirected data via a proxy. The record identifies the original client by its slot number.
HEADER 1 0x10 A header for a race packet.
RACEHEADER_1 1 0x28 A record with basic race data.
RACEHEADER_2 0-1 0x28 A record with game-mode specific race data (not present in live view).
ROOM 0-1 0x04 A record containing a friend room message (not present outside friend room lobbies).
SELECT 0-1 0x38 A record containing data to set up a match (not present during races).
RACEDATA 1-2 0x40 A record containing race data for each player, such as positions or inputs.
USER 0-1 0xC0 A record containing user data such as Miis and friend codes.
ITEM 1-2 0x08 A record containing information about players' items.
EVENT 1 ≥ 0x18 A record transmitting item events.


Offset Size Description
0x00 1 byte Message Type:
  • 1: Event start
  • 2: Player registered another as a friend
  • 3: Player joined the room
  • 4: Chat message
0x01 2 bytes First parameter (different usage depending on message type).
0x03 1 byte Second parameter (different usage depending on message type).

Parameter Usage

  • For message type 1, the first parameter is the event type:
    • 0: Grand Prix
    • 1: Team Grand Prix
    • 2: Balloon Battle
    • 3: Coin Runners
  • For message type 4, the first parameter is the message index (value 0 to 59) and the second parameter is a sequence counter, used to display chat messages in the correct order.
  • For other message types, the parameters must be zero for the message to be accepted.