|
Welcome to the home of by Kane
|
![]() KaneBot Generation 3 Macintosh Binary Battle.net Bot Software by Kane, affiliate of Clan-mAc http://linkware.clan-mac.com/kanebot | ||||||||||||||||||
|
Related and unrelated links are below. All links that lead to somewhere other than a local file will open a new window.
About KaneBot --BNLS Protocol Specification
KaneBot's Competition
Battlegram's author has requested not to be contacted.
Made with a Macintosh.
Miscellaneous Links --Clan mAc --Apple Computer --MacSoft --Blizzard Entertainment --Battle.net --Westwood Studios --EverythingMac.com --X Post Facto |
Loading icons.bni I've written this file because I do not know of any other documents that show how to read Battle.net's icons.bni file. Thanks to Skywing and Adron for some minor corrections and clarifications.
The following terms are used in this document... If you need to know about endians, all of the file is in little-endian format. If you don't know what endians are, then just ignore this, as you're most likely not going to need to know about it. The Battle.net's icons file (icons.bni, icons_STAR.bni, etc) file is basically a header decribing the contents of an embedded standard TGA (targa) file. So, here's the format of the header... DWORD - HeaderLength (always 0x10) - Length of this BNI header From there, there's an array of structures, the length of the array being NumIcons DWORD - FlagValue - User's flags must match this value after a BitwiseAnd of the two
for this icon to be valid Then from there, is the file data for the embedded standard TGA picture file. The TGA header format is as follows... BYTE - InfoLength - Length of the TGA file's INFO variable STRING - Info - Picture info. Not a null-terminated string, instead, the length-byte is InfoLength. From there is pixel data..., and even pixel data has its own structure. This provided structure is assuming the picture is a 24-bit TGA. BYTE - PacketHeader - Specifies whether the "packet of pixel data" is a run-length
packet (all pixels are same color), or not. Note that the PacketHeader's PixelCount is 0-based, so if the value is zero, then 1 pixel is to be colored, and if PixelCount is 127, then 128 pixels are to be colored. From there on is the TGA file footer, which I ignore.
Once you've created the TGA picture, you should display the picture and see if the picture makes any sese, or just looks like it's jargled. If it makes sense (eg, it looks like there's a bunch of icons stacked vertically ontop of eachother, then you've successfully created the picture) it's now up to you to extrapolate those icons from the TGA picture. If the TGA picture looks like jargled pixels, then either you screwed up in your code, or the icons file uses a format which I have not yet seen. ******************** Icons should be matched in the order in which they appear in the file... after the first match, you should stop searching and display that icon. Blizzard (flags 0x01), Battle.net (0x08), Operator (0x02), and Moderator (0x04) are always sorted above other users in that order; although these appear above all other icons in icons.bni, the [userlist] sort order is hardcoded in the game, and is not extracted from icons.bni. Blizzard's games support the .bni files to be in 24-bit and 32-bit TGAs. Though I have only seen 24-bit TGAs in the .bni files, it would be wise to support 32-bit TGAs as well.
Thanks to Skywing and Adron for some minor corrections and clarifications. Updated February 4, 2003 at 2:12 AM |