Icons.bni

The Icons.bni is a file downloaded by Blizzard's games during their handshake with Battle.net and is used to display client icons in chat, including icons like tournament trophies and number of wins.

Icons.bni File Format:

(UINT32) Size of BNI header (always 16)
(UINT16)  BNI Version*
(UINT16)  Alignment Padding (Unused)
(UINT32) Number of Icons
(UINT32) Data Offset**

* This document only covers version 0x01 of the format.

** Value will equal the length of the BNI file header plus the starting position for the data structures below.

For each icon:

(UINT32)   Flags*
(UINT32)   X Size
(UINT32)   Y Size
(UINT32)[] Icon Code**
(VOID)     Image in Targa format

* The user's flags must match this value after a bitwise-and of the two for this icon to be valid.

** This array is empty if the flags field is non-zero, but it's always terminated with a null UINT32. The array has an upper bound limit of 32 items.

** For applicable clients, the Icon Code string sent by the server in a Chat Statstring is used to search for a matching icon in the loaded icons file.

Additional Notes:

If you plan on adding support for icons.bni to your client, you may find this document, written by Kane, useful. This document, which has more details on the Targa format, may also be helpful.

Developers should be aware that Warcraft III's icons file is not actually a BNI file, but is an MPQ file with a .bni extension.

| Edited: inetknght

Comments

xboi209

Icon Precedence:

  1. For any user, display the first icon in icons.bni that has icon flags matching the bitwise-and of the icon flags and user flags (given by server in SID_CHATEVENT).

  2. For StarCraft users displaying icons other StarCraft users' icons, the first icon in icons_STAR.bni that has an icon code matching the value in the Icon Code field in chat statstrings. For WarCraft 3 users displaying other WarCraft 3 users' icons, the first icon in icons-WAR3.bni that has an icon code matching the value in the Icon Code field in chat statstrings.

  3. For any user displaying icons of users with different product codes, display the first icon in icons.bni that has icon flags matching the Icon Code field in chat statstrings.

  4. For any user displaying icons of users with the same product code, display an internal icon. See http://classic.battle.net/info/icons.shtml and http://classic.battle.net/war3/ladder/w3xp-ladder-info-laddericons.aspx?Gateway=Lordaeron for examples.