• Welcome to Valhalla Legends Archive.
 

Fast question about a packet

Started by option, June 19, 2008, 03:17 PM

Previous topic - Next topic

Camel

Quote from: brew on June 20, 2008, 01:05 PM
Also, your myPacket.insertDWORD("whateverNTstringyouneedtosend"); wouldn't work at all. I assume insertDWORD takes an unsigned long (hence insertdword), not a string pointer. Putting that code in would result in an error. For inserting NT strings, you should check out mypacket.insertNTString.

Actually, since strings manifest as pointers to chars, and pointers are 32-bit integers, it would write to the packet the address in memory of the string literal. You definitely don't want to do that.

brew

Quote from: Camel on June 23, 2008, 03:39 AM
Quote from: brew on June 20, 2008, 01:05 PM
Also, your myPacket.insertDWORD("whateverNTstringyouneedtosend"); wouldn't work at all. I assume insertDWORD takes an unsigned long (hence insertdword), not a string pointer. Putting that code in would result in an error. For inserting NT strings, you should check out mypacket.insertNTString.

Actually, since strings manifest as pointers to chars, and pointers are 32-bit integers, it would write to the packet the address in memory of the string literal. You definitely don't want to do that.
If he writes an explicit cast to that parameter- and since he didn't in the code he spat out, it'd just error.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

MyndFyre

Quote from: Camel on June 23, 2008, 03:39 AM
Quote from: brew on June 20, 2008, 01:05 PM
Also, your myPacket.insertDWORD("whateverNTstringyouneedtosend"); wouldn't work at all. I assume insertDWORD takes an unsigned long (hence insertdword), not a string pointer. Putting that code in would result in an error. For inserting NT strings, you should check out mypacket.insertNTString.

Actually, since strings manifest as pointers to chars, and pointers are 32-bit integers, it would write to the packet the address in memory of the string literal. You definitely don't want to do that.
On my computer, pointers can be 64-bit integers.
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.

|