• Welcome to Valhalla Legends Archive.
 

Optimal BNLS procedure?

Started by Don Cullen, February 04, 2007, 12:42 PM

Previous topic - Next topic

MyndFyre

Quote from: [RealityRipple] on February 10, 2007, 09:37 PM
why would it be a long... it's a verBYTE. a byte value.
Because the Battle.net protocol sends it as a 32-bit value, not an 8-bit value.

This is most likely due to greater efficiency in reading and writing data that is aligned to the native word size of the processor.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Barabajagal

That's why you do CLng(Config.VerByte). You define the variable as a byte because it's more efficient to have a byte variable than a long variable. Then when you need to send it, you send it as a long.

Ringo

Quote from: [RealityRipple] on February 11, 2007, 12:37 AM
That's why you do CLng(Config.VerByte). You define the variable as a byte because it's more efficient to have a byte variable than a long variable. Then when you need to send it, you send it as a long.
Until a version byte exceeds 0xFF, and your program hits a problem ;)

Barabajagal

oh noes, i'll have to set it to an int and release an update. how terrible. everyone else will also have to stop calling them verbytes then, too.

Mystical

I think you just like to argue with people, but wouldn't you mean CByte(Config.Verbyte) if you want it to be a byte? CLong() would be converting it to a long?


CLng Function:

CLng(expression)
Converts the value of expression to a Long data type. The argument expression must be a numeric value from -2,147,483,648 to 2,147,483,647. Fractions are rounded.


Cbyte Function:

CByte(expression)
Converts the value of expression to a Byte data type. The argument expression must be a numeric value between 0 and 255.



Barabajagal

that's the point... Config.VerByte is defined as a byte for less memory usage. the InsertDWORD requires a long, so you do CLng(Config.VerByte). and yes, I have a VERY argumentative nature.

rabbit

Or if you're using an even half-decent packet buffer you call your uint_32 insertion on the Config.VerByte and the procedure automatically converts it.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

|