Poke (http://www.javaop.com/~joe/datatypes/index.html).
I got bored, so I decided to write up a document on data types. Yeah, its rather dry, but I wanted to get it across with no nonsence. If you want to spice it up a bit, feel free to do so. I have a codeheader and code style in my stylesheet, so you can add code blocks if you want (see test.html for example).
If you'd like to host a copy on your server, do something like this.
cd ~/public_html
mkdir datatypes
wget http://www.javaop.com/~joe/datatypes/index.html
wget http://www.javaop.com/~joe/datatypes/test.html
wget http://www.javaop.com/~joe/datatypes/stylesheet.css
You should include Half-word and QuadWord. According to answers.com these are actual Word forms. I think by their name you will know what their value is to be.
nybble*
What about strings?
Obviously strings are a series of bytes. Silly Arta ^^
Quote from: rabbit on August 25, 2005, 11:49 AM
Obviously strings are a series of bytes. Silly Arta ^^
Yeah, but different types of strings are different kinds of sequences of bytes. :P
From the document (http://www.javaop.com/~joe/datatypes/index.html):
Quote
The Nibble
I am not aware of a nibble being used in Battle.net programming, but for completeness I will discuss it here. A nibble is four bits, half a byte. The biggest nibble is 2^4, or 16.
The large value of a nibble (nybble, however you want to spell it) is 15, not 16. There are, however, 16 possible values for a nibble.
Quote
The Byte
The byte is a single character, 8 bits. Any character is a single byte. The biggest byte possible is 2^8, or 256.
Same as above. The largest value of a byte is 255. There are 256 possible values though. It is not always true that any character is a single byte. That highly depends upon the type of encoding used, unless you're talking about 7-bit ASCII which should be noted then.
Actually, as I look more and more through the document, a lot of the information is wrong about sizes of datatypes.
Generally, the largest value of data is 2number-of-bits - 1
[edit]Corrected the rather egregious error. Thanks, Arta![/edit]
2number-of-bits-1, you mean :)
Thanks everyone. Its been fixed and you've all been credited.
Yegg, I have no experience with a HWORD. I'll look it up later. Seems as if it would be no different than a byte.
Quote from: Joex86] link=topic=12613.msg125433#msg125433 date=1125002871]
Thanks everyone. Its been fixed and you've all been credited.
Yegg, I have no experience with a HWORD. I'll look it up later. Seems as if it would be no different than a byte.
The size of your WORD and DWORDS are still wrong. The number of values they can represent are be 2^16 and 2^32, respectively. Subtract one to get the maximum value they can present (if they're unsigned, that is).
Byte booleans aren't seen in the BNCS protocol, and WORD booleans aren't either, only DWORD Booleans are (at least by the common BotDev definitions, where the sizes are all wrong). A more accurate term for "DWORD Boolean" would be "32-Bit Boolean", however. Nybble is in there for no reason; it is not used by the BNCS protocol nor by any future definition you present. A more accurate list:
Unsigned Byte: 7 (ANSI) or 8 (ASCII) bits; value range from 0 - 255 inclusive
HWORD: One half of the WORD-size of the CPU; on a 32-bit system a HWORD is 2 bytes, and on a 64-bit system a HWORD is 4 bytes.
WORD: The standard data size of the CPU; on a 32-bit system a WORD is 4 bytes, and on a 64-bit system a WORD is 8 bytes.
32-Bit Boolean: A 32-bit represenation of 0 or 1.
DWORD: Double the WORD-size of the CPU; on a 32-bit system a DWORD is 8 bytes, and on a 64-bit system a DWORD is 16 bytes.
QWORD: Quadruple the WORD-size of the CPU; on a 32-bit system a QWORD is 16 bytes, and on a 64-bit system it is 64 bytes.
I still say Arta and his crew need to update BnetDocs with the correct information.
I've never heard 'HWORD' before. That looks like a SHORT to me.
Nor have I. I have heard of QWORDS, though.
Quote from: dxoigmn on August 25, 2005, 04:07 PM
Quote from: Joex86] link=topic=12613.msg125433#msg125433 date=1125002871]
Thanks everyone. Its been fixed and you've all been credited.
Yegg, I have no experience with a HWORD. I'll look it up later. Seems as if it would be no different than a byte.
The size of your WORD and DWORDS are still wrong. The number of values they can represent are be 2^16 and 2^32, respectively. Subtract one to get the maximum value they can present (if they're unsigned, that is).
The above is correct
QuoteA WORD is not always the same size on all systems, but for the purpose of Battle.net bot development, we will consider it to always be 16 bits, or two bytes. A WORD can be up to 255^2, and coresponds with the BASIC data type Integer, and the C data type short.
A word can be up to 256
2-1, or 65525. It has 256
2, or 65536 possible values.
You'd be better off using the 2
x notation.
Quote from: Newby on August 25, 2005, 04:56 PM
Nor have I. I have heard of QWORDS, though.
QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II.
Quote from: dxoigmn on August 25, 2005, 05:32 PM
Quote from: Newby on August 25, 2005, 04:56 PM
Nor have I. I have heard of QWORDS, though.
QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II.
Technically, FILETIME is a QWORD.
Quote from: iago on August 25, 2005, 05:33 PM
Quote from: dxoigmn on August 25, 2005, 05:32 PM
Quote from: Newby on August 25, 2005, 04:56 PM
Nor have I. I have heard of QWORDS, though.
QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II.
Technically, FILETIME is a QWORD.
And they are also used in Warcraft III profiles to indicate last-game-played-time.
Quote from: dxoigmn on August 25, 2005, 05:32 PM
Quote from: Newby on August 25, 2005, 04:56 PM
Nor have I. I have heard of QWORDS, though.
QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II.
I know what they are. I had to deal with them in reversing a key generation algorithm. :)
Quote from: Newby on August 25, 2005, 06:11 PM
Quote from: dxoigmn on August 25, 2005, 05:32 PM
Quote from: Newby on August 25, 2005, 04:56 PM
Nor have I. I have heard of QWORDS, though.
QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II.
I know what they are. I had to deal with them in reversing a key generation algorithm. :)
Haha whoops. The placement of the two 'I's made my brain merge them into one, minus the period. Still good information :P
Yes, I did not know that the only QWORD known on Battle.net was based on experience.
Though, now that I think about it, I guess I could see that happening, since experience gets huge. :P
Rabbit: My WORD/DWORD/QWORD size is correct, for Battle.net BotDev. Thats what this document is for.
iago: Your BBCode went boom.
Quote from: MyndFyre on August 25, 2005, 06:05 PM
Quote from: iago on August 25, 2005, 05:33 PM
Quote from: dxoigmn on August 25, 2005, 05:32 PM
Quote from: Newby on August 25, 2005, 04:56 PM
Nor have I. I have heard of QWORDS, though.
QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II.
Technically, FILETIME is a QWORD.
And they are also used in Warcraft III profiles to indicate last-game-played-time.
Wouldn't that technically be a FILETIME? Nanoseconds since Jan 1/1970 I believe?
Isn't it just seconds?
Quote from: iago on August 25, 2005, 05:33 PM
Wouldn't that technically be a FILETIME? Nanoseconds since Jan 1/1970 I believe?
100-nanosecond intervals since then.
Quote
Quote
Quote from: iago on August 26, 2005, 08:30 AM
Wouldn't that technically be a FILETIME? Nanoseconds since Jan 1/1970 I believe?
Yes, but as you also said:
Quote from: iago on August 25, 2005, 05:33 PM
Technically, FILETIME is a QWORD.
:P
I think of it as a filetime as two DWORD since a filetime is a struct with the same SIZE as a QWORD (provided the structure padding is disabled).
Quote from: iago on August 25, 2005, 05:33 PM
Quote from: dxoigmn on August 25, 2005, 05:32 PM
Quote from: Newby on August 25, 2005, 04:56 PM
Nor have I. I have heard of QWORDS, though.
QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II.
Technically, FILETIME is a QWORD.
Since the two doublewords within the FILETIME structure are not
always aligned in-memory, the structure is not considered a QWORD.
Quote from: Joex86] link=topic=12613.msg125539#msg125539 date=1125056742]
Rabbit: My WORD/DWORD/QWORD size is correct, for Battle.net BotDev. Thats what this document is for.
No, it's not. The Battle.Net BotDev "definitions" of those terms are incorrect, so saying yours are correct as pertaining to Battle.Net BotDev means they are incorrect as well.
Quote from: iago on August 25, 2005, 05:18 PMA word can be up to 2562-1, or 65525. It has 2562, or 65536 possible values.
How can it have 65536 values if its biggest value is 655
25? ;)
Quote from: Kp on August 27, 2005, 11:28 AM
Quote from: iago on August 25, 2005, 05:18 PMA word can be up to 2562-1, or 65525. It has 2562, or 65536 possible values.
How can it have 65536 values if its biggest value is 65525? ;)
Because I hit the wrong key :-P