Network Protocol/EVENT

From Custom Mario Kart
Jump to navigation Jump to search

Overview

This article describes the record type EVENT of the Network Protocol. This records transmits item events. These are activating, losing and picking up an item. A new event is placed in the first free slot of EVENT. The data of all events are stored after the slot list. This announcement is active for around 3 seconds and the data is not modified during this time. This means that each console calculates the item routes and the interaction on its own.

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.


Event Types

The byte describing an event type is split up into two parts: a 3 bit action type followed by a 5 bit object number for the item involved.

Types
ID Name Description
0 NONE The neutral value for unused slots (always paired with object ID 0x10).
1 USED Using an item, such as the Lightning or a Mushroom.
2 SHOT Throwing an item, either forwards or backwards, such as a Green Shell or Banana.
3 HIT-DRAGGED Hitting the dragged item of any player, either with your vehicle or an item.
4 HIT-FREE Hitting any item that is not being dragged, either with your vehicle or an item.
5 LOSE Used when a Thunder Cloud is lost, either from its timer running out or from passing it to another player.
6 Unknown Unknown
7 DROP Dropping an item when hit, including items that dissapear when landing.

Event Data Structure

The data structure depends on the data types defined by the slot list of EVENT. The data is not aligned. To find the DATA for a specific slot, the slots must be iterated to skip the previous data. The data size for a single event differs from 3 to 21 bytes, depending on the action type.

Data Sizes
ID Size (bytes)
1 3
2 Varies per item
3 20
4 5
5 5
6 4
7 20