Author | Message | Time |
---|---|---|
Smithsonian | I'm about to tackle the icons.bni task. I've just added bnftp support to my client. I'm ready to download and process the file. I just wanted to get a few things out of the way. My client should first check to see if it has a copy of icons.bni in its directory, if it doesn't it should download it and process it. My client, on the second connect, should check the version of icons.bni using some packet I saw on bnetdocs, but either way, it should check the version of icons.bni - then if local version is older download the newer one, otherwise keep the local one. Once it's verified I have the current version of icons.bni - I should make my client extract the targa file, and somehow save it in memory and apply it to my list view. Does this process sound about right? | July 31, 2005, 11:49 PM |
UserLoser. | Well, yeah. To clarify: You send SID_GETICONDATA and the server will respond with the icons filename. Then you check if you have that file locally, if not, proceed to download it. If you do, then send SID_GETFILETIME to get the date of when the file was last modified. You then will have to check the filetime of your local icons file. If they do not match (i.e. servers filetime is more recent) then download the new file, otherwise keep what you have. As far as reading from the icons file, I suggest understanding this documentation of it's format. You'll have to 'pick it apart' first by Blizzard's icon file header. Then from there you'll extract the targa header, it's image data and decompress it if necessary (pretty sure it's never not necessary). Create a DIB/bitmap and store it in memory, then draw to your listview whenever using a function such as BitBlt. Hope this helps. | August 1, 2005, 3:02 AM |
LoRd | [quote]You send SID_GETICONDATA and the server will respond with the icons filename. Then you check if you have that file locally, if not, proceed to download it. If you do, then send SID_GETFILETIME to get the date of when the file was last modified. You then will have to check the filetime of your local icons file. If they do not match (i.e. servers filetime is more recent) then download the new file, otherwise keep what you have.[/quote] SID_GETICONDATA includes the filetime, so sending SID_GETFILETIME is not required. | August 1, 2005, 3:20 AM |
Arta | [quote author=UserLoser link=topic=12391.msg122678#msg122678 date=1122865352] If they do not match (i.e. servers filetime is more recent) then download the new file, otherwise keep what you have. [/quote] Actually, I'd suggest getting the one from the server even if the local time is more recent than the server. In other words, download if the times differ at all. I suggest this because the server should be authoritative: if the user connects to an emulator or something, it might have custom icons, and they might have an earlier filetime than Battle.net's icons. Fairly minor nit-pick though. | August 1, 2005, 9:00 AM |
UserLoser. | [quote author=Arta[vL] link=topic=12391.msg122700#msg122700 date=1122886823] [quote author=UserLoser link=topic=12391.msg122678#msg122678 date=1122865352] If they do not match (i.e. servers filetime is more recent) then download the new file, otherwise keep what you have. [/quote] Actually, I'd suggest getting the one from the server even if the local time is more recent than the server. In other words, download if the times differ at all. I suggest this because the server should be authoritative: if the user connects to an emulator or something, it might have custom icons, and they might have an earlier filetime than Battle.net's icons. Fairly minor nit-pick though. [/quote] Well we're not supposed to be connecting to emulators now are we!? :P | August 1, 2005, 10:52 AM |
tA-Kane | Are you suggesting that the bots recognize the difference between an emulated server and an authorized server? Umm, no, plzkthx. | August 1, 2005, 1:01 PM |
Arta | No. I'm suggesting that clients should download icons.bni, or any other file, when the filetimes differ, not just when the filetime is lower. In other words, the server's version should be authoritative. | August 1, 2005, 1:45 PM |
Spht | SphtBotv3 uses a series of _info.cfi (CFI = Check File Info) files which are used by CheckUpdateFileTime to perform versioning on files. [code]bool CheckUpdateFileTime(LPCSTR lpszFileName, const LPFILETIME lpFileTime)[/code] lpszFileName is the file to check info for and lpFileTime is the FILETIME to compare with. It returns true if current file is same or newer than Battle.net's file, and false if older. CheckUpdateFileTime also updates the recorded file info. This is used for all automated file downloads from Battle.net. [quote][14:43:39] Connected to Battle.net! [14:43:39] New IX86ver1.mpq available, downloading... [14:43:40] Checking versions and CD-key... [14:43:40] Passed version and CD-key check! [14:43:40] Attempting to log on... [14:43:40] New icons.bni available, downloading... [14:43:40] Successfully logged on![/quote] | August 1, 2005, 5:34 PM |