Welcome, Guest. Please login or register.
Did you miss your activation email?
September 06, 2010, 07:03 pm
Home | Help | Search | Calendar | Login | Register

Valhalla Legends Forum  |  Programming  |  Battle.net Bot Development (Moderators: Spht, Arta, Kp, MyndFyre, iago)  |  Topic: Optimal BNLS procedure?
« previous next »
Pages: 1 2 [3] Print
Author Topic: Optimal BNLS procedure?  (Read 1287 times)
MyndFyre
Moderator
King
*****
Offline

Posts: 4747


The wait is over.

View Profile WWW
« Reply #30 on: February 11, 2007, 12:33 am »

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.
Logged
Quote
Every 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?

MyndFyre.747 on Battle.net 2.0

You've just located global warming.
Barabajagal
Guest
« Reply #31 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.
Logged
Ringo
Marshall
***
Offline

Posts: 874


I Am Noob

View Profile
« Reply #32 on: February 11, 2007, 12:57 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 ;)
Logged

I Foolishly Believe That Belief Is A Fools Game.
Barabajagal
Guest
« Reply #33 on: February 11, 2007, 01:49 am »

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.
Logged
Mystical
Marshall
***
Offline

Posts: 789


What is your malfunction?

View Profile WWW
« Reply #34 on: February 11, 2007, 02:01 am »

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:
Code: [Select]
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:
Code: [Select]
CByte(expression)
Converts the value of expression to a Byte data type. The argument expression must be a numeric value between 0 and 255.

Logged
Barabajagal
Guest
« Reply #35 on: February 11, 2007, 02:04 am »

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.
Logged
rabbit
Hearthman
****
Offline

Posts: 1385


RAWR!

View Profile
« Reply #36 on: February 11, 2007, 06:39 am »

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.
Logged
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.
Pages: 1 2 [3] Print 
Valhalla Legends Forum  |  Programming  |  Battle.net Bot Development (Moderators: Spht, Arta, Kp, MyndFyre, iago)  |  Topic: Optimal BNLS procedure? « previous next »
 


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.118 seconds with 17 queries.