• Welcome to Valhalla Legends Archive.
 

WAR3 RoC / TFT stat string

Started by PunK, November 25, 2007, 08:16 PM

Previous topic - Next topic

UserLoser

Way back in the day W3 statstrings included the amount of wins

Camel

#16
That was two changes to W3 statstrings ago.

I keep an object linked to my 'bnet user' object that keeps track of the statstring info. It knows what the 'product id' and 'icon id' of the user are; both are stored as DWORDs. When I look for an icon do display in the userlist, if 'legacy icons' are enabled, I look for an entry matching the 'icon id' and fall back on Icons.bni against the 'product id'.

By using a DWORD for product id/icon id, you can avoid dealing with strings all together. This is particularly desirable for conditions where the information isn't really a string at all. These DWORDs just happens to be a human-readable. In reality, the only constraint is that they do not contain zero-value bytes, since they are stored in an NT string. Because of this, it's important to use binary-safe operations.