MKWii Network Protocol/ITEM

From Custom Mario Kart
Jump to navigation Jump to search

This pages is related to MKWii Network Protocol and describes the record type ITEM. One record for each player is transmitted together with the race data:

Record structure of a complete racing packet
Size Count Type Description
0x08 0–1 SLOT Only used for redirected data via a proxy. The record identifies the original client by its slot number.
0x10 1 HEADER A header for a race packet.
0x28 1 RACEHEADER_1 Basic race data, 1 record per client.
0x28 0-1 RACEHEADER_2 Basic race data, 1 record per client. Not present in live view.
0x40 1–2 RACEDATA Race data (with positions) for each player of a client.
0xc0 0–1 USER A USER record containing mii data and friendcode(s).
0x08 1–2 ITEM Item in the box for each player of a client incl. handshaking to limit some items.
>= 0x18 1 EVENT A list with 24 byte entries. If a value is not 0x10, it declares an EVENTDATA field is following. After that list, up to 24 EVENTDATA records follow.

Description of the record type ITEM in GNU C notation.

typedef struct udp_item_t
 /*00*/  u8	timer;               // start time of item in 8/60s := RACE.timer/8
 /*01*/  u8	item_box;            // item in the box => mkw_item_type_t
 /*02*/  u8	item_tail;           // item at tail => mkw_item_type_t
 /*03*/  u8	mode;                // activation mode: 0=no item, 1-7=handshake
 /*04*/  u8	tail_mode;           // ? 3=hold, 4=shoot, 5=3/3, 6=2/3, 7=1/3
 /*05*/  u8	acknowledge;         // ? 0=ok, 1=fail
 /*06*/  u8	ack_timer;           // return the timer value to accept item of other client
 /*07*/  u8	padding_07;          // padding, always 0

__attribute__ ((packed)) udp_item_t;

Item types

The members item_box and item_tail describe, which item is available in the box (top left of the screen) and at the tail of the vehicle (or around the vehicle). Sometimes item_box switch back to no item, but because of previous modes, a mushroom can be identified. This make some cheat detection more difficult.

The following table shows the item codes. Item cheats use the same codes:

Item codes of Mario Kart Wii
code name comments
0x00 Green Shell
0x01 Red Shell
0x02 Banana
0x03 Fake Item Box
0x04 Mushroom
0x05 Triple Mushroom
0x06 Bob-omb
0x07 Spiny Shell
0x08 Lightning
0x09 Star
0x0a Golden Mushroom
0x0b Mega Mushroom
0x0c Blooper
0x0d POW Block
0x0e Thundercloud
0x0f Bullet Bill
0x10 Triple Green Shell
0x11 Triple Red Shell
0x12 Triple Banana
0x13 not used This code was never seen.
0x14 none item Code for no item available. Sometimes (context dependent) this code means Mushroom.